/* param base Pointer to the FLEXIO_CAMERA_Type. param handle Pointer to the flexio_camera_edma_handle_t structure. param count Number of bytes sent so far by the non-blocking transaction. retval kStatus_Success Succeed get the transfer count. retval kStatus_InvalidArgument The count parameter is invalid.  */
status_t FLEXIO_CAMERA_TransferGetReceiveCountEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle, size_t *count)
/* param base Pointer to the FLEXIO_CAMERA_Type. param handle Pointer to the flexio_camera_edma_handle_t structure. param count Number of bytes sent so far by the non-blocking transaction. retval kStatus_Success Succeed get the transfer count. retval kStatus_InvalidArgument The count parameter is invalid.  */
status_t FLEXIO_CAMERA_TransferGetReceiveCountEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle, size_t *count)
{
    assert(handle->rxEdmaHandle != NULL);
    if (NULL == count)
    {
        return kStatus_InvalidArgument;
    }
    if ((uint8_t)kFLEXIO_CAMERA_RxBusy == handle->rxState)
    {
        *count = (handle->rxSize -
                  (uint32_t)handle->nbytes *
                      EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel));
    }
    else
    {
        *count = handle->rxSize;
    }
    return kStatus_Success;
}