Width and alignment

nRF54LM20A | nRF54LM20B Datasheet

Each audio data sample is followed by sufficient number of zero data bits to complete an M-bit word. The CONFIG.SWIDTH register defines the sample width of the data read and written to memory, as well as the number of SCK clock cycles per word. The M-bit word is sometimes referred to as a channel block.

The following figure illustrates a configuration with identical sample and channel/word widths. The number of SCK pulses matches the number of sample bits.
Figure 10. Aligned format, with CONFIG.SWIDTH configured to 16 bit samples in a 16 bit word
Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 16-bit word.
The next figure illustrates a configuration with greater word width than sample width. The number of SCK pulses are greater than the number of sample bits, with the sample being left-aligned in the word.
Figure 11. Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 32-bit word
Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 32-bit word.

Alignment of samples

If the word width differs from the sample width, the sample value can be either right or left-aligned inside a word, as specified in CONFIG.ALIGN.

When using left-alignment, each word starts with the MSB of the sample value, as illustrated in the following figure.
Figure 12. CONFIG.ALIGN set to left justified
CONFIG.ALIGN set to left justified.
When using right-alignment, each word ends with the LSB of the sample value. This is illustrated in the following figure.
Figure 13. CONFIG.ALIGN set to right justified
CONFIG.ALIGN equalling right justified.