/* param base asrc base pointer. param channelPair ASRC channel pair number. param buffer input sample numbers. param outSampleWidth output sample width. param remainSamples output sample rate. retval remain samples number.  */
uint32_t ASRC_GetRemainFifoSamples(ASRC_Type *base, asrc_channel_pair_t channelPair, uint32_t *buffer, uint32_t outSampleWidth, uint32_t remainSamples)
/* param base asrc base pointer. param channelPair ASRC channel pair number. param buffer input sample numbers. param outSampleWidth output sample width. param remainSamples output sample rate. retval remain samples number.  */
uint32_t ASRC_GetRemainFifoSamples(ASRC_Type *base, asrc_channel_pair_t channelPair, uint32_t *buffer, uint32_t outSampleWidth, uint32_t remainSamples)
{
    uint32_t remainSamplesInFifo = 0U;
    uint32_t audioChannels       = ASRC_GET_CHANNEL_COUNTER(base, channelPair);
    remainSamplesInFifo =
        ((ASRC_ASRFST_ADDR(base, channelPair) & ASRC_ASRFSTA_OUTFIFO_FILLA_MASK) >> ASRC_ASRFSTA_OUTFIFO_FILLA_SHIFT) *
        audioChannels;
    if (remainSamples < remainSamplesInFifo)
    {
        remainSamplesInFifo = remainSamples;
    }
    ASRC_ReadNonBlocking(base, channelPair, (uint32_t *)buffer, remainSamplesInFifo, outSampleWidth);
    return remainSamplesInFifo;
}