/* param base SPDIF base pointer. param handle Pointer to the spdif_handle_t structure which stores the transfer state. param count Bytes count received. retval kStatus_Success Succeed get the transfer count. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress.  */
status_t SPDIF_TransferGetReceiveCount(SPDIF_Type *base, spdif_handle_t *handle, size_t *count)
/* param base SPDIF base pointer. param handle Pointer to the spdif_handle_t structure which stores the transfer state. param count Bytes count received. retval kStatus_Success Succeed get the transfer count. retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress.  */
status_t SPDIF_TransferGetReceiveCount(SPDIF_Type *base, spdif_handle_t *handle, size_t *count)
{
    assert(handle);
    status_t status = kStatus_Success;
    if (handle->state != kSPDIF_Busy)
    {
        status = kStatus_NoTransferInProgress;
    }
    else
    {
        *count = (handle->transferSize[handle->queueDriver] - handle->spdifQueue[handle->queueDriver].dataSize);
    }
    return status;
}