/* DMA callback function for FLEXIO SPI receive transfer.  */
static void FLEXIO_SPI_RxDMACallback(dma_handle_t *handle, void *param)
/* DMA callback function for FLEXIO SPI receive transfer.  */
static void FLEXIO_SPI_RxDMACallback(dma_handle_t *handle, void *param)
{
    flexio_spi_master_dma_private_handle_t *spiPrivateHandle = (flexio_spi_master_dma_private_handle_t *)param;
    FLEXIO_SPI_EnableDMA(spiPrivateHandle->base, kFLEXIO_SPI_RxDmaEnable, false);
    DMA_DisableInterrupts(handle->base, handle->channel);
    spiPrivateHandle->handle->rxInProgress = false;
    if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false))
    {
        if (spiPrivateHandle->handle->callback)
        {
            (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success,
                                                 spiPrivateHandle->handle->userData);
        }
    }
}