/* param base SAI base pointer. param handle Pointer to the sai_handle_t structure which stores the transfer state. param count Bytes count sent. retval kStatus_Success Succeed get the transfer count. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress.  */
status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count)
/* param base SAI base pointer. param handle Pointer to the sai_handle_t structure which stores the transfer state. param count Bytes count sent. retval kStatus_Success Succeed get the transfer count. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress.  */
status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count)
{
    assert(handle != NULL);
    status_t status           = kStatus_Success;
    uint32_t queueDriverIndex = handle->queueDriver;
    if (handle->state != (uint32_t)kSAI_Busy)
    {
        status = kStatus_NoTransferInProgress;
    }
    else
    {
        *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize);
    }
    return status;
}