/* param base Pointer to FLEXIO_SPI_Type structure. param handle FlexIO SPI eDMA handle pointer. param count Number of bytes transferred so far by the non-blocking transaction.  */
status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle, size_t *count)
/* param base Pointer to FLEXIO_SPI_Type structure. param handle FlexIO SPI eDMA handle pointer. param count Number of bytes transferred so far by the non-blocking transaction.  */
status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle, size_t *count)
{
    assert(handle);
    if (!count)
    {
        return kStatus_InvalidArgument;
    }
    if (handle->rxInProgress)
    {
        *count = (handle->transferSize -
                  (uint32_t)handle->nbytes *
                      EDMA_GetRemainingMajorLoopCount(handle->rxHandle->base, handle->rxHandle->channel));
    }
    else
    {
        *count = (handle->transferSize -
                  (uint32_t)handle->nbytes *
                      EDMA_GetRemainingMajorLoopCount(handle->txHandle->base, handle->txHandle->channel));
    }
    return kStatus_Success;
}