/* param handle DMA handle pointer. param config Pointer to DMA transfer configuration structure. retval kStatus_DMA_Success It means submit transfer request succeed. retval kStatus_DMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. retval kStatus_DMA_Busy It means the given channel is busy, need to submit request later.  */
status_t DMA_SubmitTransfer(dma_handle_t *handle, dma_transfer_config_t *config)
/* param handle DMA handle pointer. param config Pointer to DMA transfer configuration structure. retval kStatus_DMA_Success It means submit transfer request succeed. retval kStatus_DMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. retval kStatus_DMA_Busy It means the given channel is busy, need to submit request later.  */
status_t DMA_SubmitTransfer(dma_handle_t *handle, dma_transfer_config_t *config)
{
    assert((NULL != handle) && (NULL != config));
    assert(handle->channel < (uint32_t)FSL_FEATURE_DMA_NUMBER_OF_CHANNELSn(handle->base));
    uint32_t instance            = DMA_GetInstance(handle->base);
    dma_descriptor_t *descriptor = (dma_descriptor_t *)(&s_dma_descriptor_table[instance][handle->channel]);
    if (DMA_ChannelIsActive(handle->base, handle->channel))
    {
        return kStatus_DMA_Busy;
    }
    if (config->isPeriph)
    {
        DMA_EnableChannelPeriphRq(handle->base, handle->channel);
    }
    else
    {
        DMA_DisableChannelPeriphRq(handle->base, handle->channel);
    }
    DMA_CreateDescriptor(descriptor, &config->xfercfg, config->srcAddr, config->dstAddr, config->nextDesc);
    handle->base->CHANNEL[handle->channel].XFERCFG = descriptor->xfercfg;
    return kStatus_Success;
}