/* param config Pointer to DMA channel transfer configuration structure. param srcStartAddr source start address. param dstStartAddr destination start address. param xferCfg xfer configuration, user can reference DMA_CHANNEL_XFER about to how to get xferCfg value. param type transfer type. param trigger DMA channel trigger configurations. param nextDesc address of next descriptor.  */
void DMA_PrepareChannelTransfer(dma_channel_config_t *config, void *srcStartAddr, void *dstStartAddr, uint32_t xferCfg, dma_transfer_type_t type, dma_channel_trigger_t *trigger, void *nextDesc)
/* param config Pointer to DMA channel transfer configuration structure. param srcStartAddr source start address. param dstStartAddr destination start address. param xferCfg xfer configuration, user can reference DMA_CHANNEL_XFER about to how to get xferCfg value. param type transfer type. param trigger DMA channel trigger configurations. param nextDesc address of next descriptor.  */
void DMA_PrepareChannelTransfer(dma_channel_config_t *config, void *srcStartAddr, void *dstStartAddr, uint32_t xferCfg, dma_transfer_type_t type, dma_channel_trigger_t *trigger, void *nextDesc)
{
    assert((NULL != config) && (NULL != srcStartAddr) && (NULL != dstStartAddr));
    assert((((uint32_t)(uint32_t *)nextDesc) & ((uint32_t)FSL_FEATURE_DMA_LINK_DESCRIPTOR_ALIGN_SIZE - 1UL)) == 0UL);
    (void)memset(config, 0, sizeof(*config));
    if (type == kDMA_MemoryToMemory)
    {
        config->isPeriph = false;
    }
    else if (type == kDMA_PeripheralToMemory)
    {
        config->isPeriph = true;
    }
    else if (type == kDMA_MemoryToPeripheral)
    {
        config->isPeriph = true;
    }
    else
    {
        config->isPeriph = true;
    }
    config->dstStartAddr = (uint8_t *)dstStartAddr;
    config->srcStartAddr = (uint8_t *)srcStartAddr;
    config->nextDesc     = (uint8_t *)nextDesc;
    config->trigger      = trigger;
    config->xferCfg      = xferCfg;
}