/* FLEXSPI DMA transfer finished callback function. 
This function is called when FLEXSPI DMA transfer finished. It disables the FLEXSPI TX/RX DMA request and sends status to FLEXSPI callback. */
static void FLEXSPI_TransferDMACallback(dma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
/* FLEXSPI DMA transfer finished callback function. 
This function is called when FLEXSPI DMA transfer finished. It disables the FLEXSPI TX/RX DMA request and sends status to FLEXSPI callback. */
static void FLEXSPI_TransferDMACallback(dma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
{
    flexspi_dma_private_handle_t *flexspiPrivateHandle = (flexspi_dma_private_handle_t *)param;
    handle = handle;
    tcds   = tcds;
    if (transferDone)
    {
        while (!FLEXSPI_GetBusIdleStatus(flexspiPrivateHandle->base))
        {
        }
        FLEXSPI_TransferAbortDMA(flexspiPrivateHandle->base, flexspiPrivateHandle->handle);
        if (flexspiPrivateHandle->handle->completionCallback != NULL)
        {
            flexspiPrivateHandle->handle->completionCallback(flexspiPrivateHandle->base, flexspiPrivateHandle->handle,
                                                             kStatus_Success, flexspiPrivateHandle->handle->userData);
        }
    }
}