/* Receive a piece of data in non-blocking way.  */
static void SAI_ReadNonBlocking(I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t endChannel, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
/* Receive a piece of data in non-blocking way.  */
static void SAI_ReadNonBlocking(I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t endChannel, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
{
    uint32_t i = 0;
    uint8_t j = 0, m = 0;
    uint8_t bytesPerWord = bitWidth / 8U;
    uint32_t data        = 0;
    for (i = 0; i < size / bytesPerWord; i++)
    {
        for (j = channel; j <= endChannel; j++)
        {
            if ((1U << j) & channelMask)
            {
                data = base->RDR[j];
                for (m = 0; m < bytesPerWord; m++)
                {
                    *buffer = (data >> (8U * m)) & 0xFF;
                    buffer++;
                }
            }
        }
    }
}