/* param base Pointer to the FLEXIO_CAMERA_Type. param handle Pointer to the flexio_camera_edma_handle_t structure. param xfer Camera eDMA transfer structure, see #flexio_camera_transfer_t. retval kStatus_Success if succeeded, others failed. retval kStatus_CAMERA_RxBusy Previous transfer on going.  */
status_t FLEXIO_CAMERA_TransferReceiveEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle, flexio_camera_transfer_t *xfer)
/* param base Pointer to the FLEXIO_CAMERA_Type. param handle Pointer to the flexio_camera_edma_handle_t structure. param xfer Camera eDMA transfer structure, see #flexio_camera_transfer_t. retval kStatus_Success if succeeded, others failed. retval kStatus_CAMERA_RxBusy Previous transfer on going.  */
status_t FLEXIO_CAMERA_TransferReceiveEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle, flexio_camera_transfer_t *xfer)
{
    assert(handle->rxEdmaHandle);
    edma_transfer_config_t xferConfig;
    status_t status;
    if (kFLEXIO_CAMERA_RxBusy == handle->rxState)
    {
        status = kStatus_FLEXIO_CAMERA_RxBusy;
    }
    else
    {
        handle->rxState = kFLEXIO_CAMERA_RxBusy;
        EDMA_PrepareTransfer(&xferConfig, (void *)FLEXIO_CAMERA_GetRxBufferAddress(base), 32, (void *)xfer->dataAddress,
                             32, 32, xfer->dataNum, kEDMA_PeripheralToMemory);
        handle->nbytes = 32;
        EDMA_SubmitTransfer(handle->rxEdmaHandle, &xferConfig);
        EDMA_StartTransfer(handle->rxEdmaHandle);
        FLEXIO_CAMERA_EnableRxDMA(base, true);
        status = kStatus_Success;
    }
    return status;
}