/* param base SPI peripheral base address. param handle Pointer to the spi_master_handle_t structure which stores the transfer state. param count The number of bytes transferred by using the non-blocking transaction. return status of status_t.  */
status_t SPI_MasterTransferGetCount(SPI_Type *base, spi_master_handle_t *handle, size_t *count)
/* param base SPI peripheral base address. param handle Pointer to the spi_master_handle_t structure which stores the transfer state. param count The number of bytes transferred by using the non-blocking transaction. return status of status_t.  */
status_t SPI_MasterTransferGetCount(SPI_Type *base, spi_master_handle_t *handle, size_t *count)
{
    assert(NULL != handle);
    if (NULL == count)
    {
        return kStatus_InvalidArgument;
    }
    if (handle->state != (uint32_t)kStatus_SPI_Busy)
    {
        *count = 0;
        return kStatus_NoTransferInProgress;
    }
    *count = handle->totalByteCount - handle->rxRemainingBytes;
    return kStatus_Success;
}