Skip to content

I2S endianness clarification, do we need to convert byte order? #9278

Discussion options

You must be logged in to vote

No byte order conversion is needed. For the read(buf) method, buf will contain samples in little endian format. For the write(buf) method, sample data in buf must be arranged in little endian format.

Here is an example for sample data received from an I2S microphone using the read(buf) method.

I2S SD line                                                                   MicroPython buf[]
=======                                                                       ============
1st byte (Most significant byte, first to be transmitted from the mic)        buf[i+3]
2nd byte                                                                      buf[i+2]
3rd byte (Least significant byte of data …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@saraverbeecke
Comment options

Answer selected by saraverbeecke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants