1 Reply Latest reply on Feb 14, 2020 3:59 AM by EktaN_26

    How to read/write 16bit from I2S

    NiVa_4337911

      Unfortunately, there is no DMA in the chip I am using, so only way to read a byte from I2S is using the function "uint8 I2S_ReadByte(wordSelect)", here the word select is the channel ( L or R). Since my data has 16 bits, how can I get the next byte? I am not sure whether a second read will return next byte or not. I couldn't find anything in the documentation.

        • 1. Re: How to read/write 16bit from I2S
          EktaN_26

          Hello NiVa_4337911 ,

           

          The RX FIFO has a depth of 4, thus you can use it for receiving upto 32 bits. Thus, the I2S_ReadByte() needs to be called twice in order to read both the bytes. You need to take care in the firmware that the RX_FIFO is not empty before reading the data and also that the RX_FIFO overflow does not occur. You can use the I2S_ReadRxStatus() function for this purpose.

           

          Regards

          Ekta