I2S — Inter-IC sound interface

The I2S (Inter-IC Sound) module, supports the original two-channel I2S format, and left- or right-aligned formats. It implements EasyDMA for sample transfer directly to and from RAM without CPU intervention.

The I2S peripheral has the following main features:

Figure 1. I2S master
I2S block diagram

Mode

The I2S protocol specification defines two modes of operation, Master and Slave.

In the I2S protocol, the Master always supplies the LRCK and SCK clock signals to the Slave. The device can use either the Master or Slave mode, configured using the CONFIG.MODE register.

Transmitting and receiving

The I2S module supports both transmission (TX) and reception (RX) of serial data. In both cases the serial data is shifted synchronously to the clock signals SCK and LRCK.

TX data is written to the SDOUT pin on the falling edge of SCK, and RX data is read from the SDIN pin on the rising edge of SCK. The most significant bit (MSB) is always transmitted first.

Note: When starting a transmission in master mode, the first frame is filled with zeros.

TX and RX are available in both Master and Slave modes and can be enabled/disabled independently in the CONFIG.TXEN and CONFIG.RXEN.

Transmission and/or reception is started by triggering the START task. With transmission enabled in CONFIG.TXEN), the TXPTRUPD event is generated just before
ceil(RXTXD.MAXCNT/4)
data words have been transmitted. Similarly, with reception enabled in CONFIG.RXEN, the RXPTRUPD event will be generated for every
ceil(RXTXD.MAXCNT/4)
data words.
The FRAMESTART event is generated synchronously to the active LRCK edge at the beginning of a frame after transmitting
ceil(RXTXD.MAXCNT/4)
data words. The initial FRAMESTART event is generated at the first active edge of LRCK after the START task has been triggered. The FRAMESTART event is only defined for transmitting full left and right sample pairs. If RXTXD.MAXCNT is configured so that the frame ends between the left and right sample pairs, the missing left or right sample pairs will be transmitted as zeros.
Figure 2. Transmitting and receiving. CONFIG.FORMAT = Aligned, CONFIG.SWIDTH = 8Bit, CONFIG.CHANNELS = Stereo, RXTXD.MAXCNT = 4
Transmitting and receiving. CONFIG.FORMAT = Aligned, CONFIG.SWIDTH = 8Bit, CONFIG.CHANNELS = Stereo, RXTXD.MAXCNT = 4.

Left right clock (LRCK)

The left right clock (LRCK), often referred to as word clock, sample clock, or word select in I2S context, is the clock defining the frames in serial bitstreams sent and received on SDOUT and SDIN, respectively.

In I2S format, each frame contains one left and/or right sample pair. The left sample is transferred during the low half period of LRCK, followed by the right sample being transferred during the high half period of LRCK.

In Aligned format, each frame contains one left and/or right sample pair. The left sample is transferred during the high half period of LRCK, followed by the right sample being transferred during the low half period of LRCK.

For mono, the frame will contain only zeros for the unused half period of LRCK.

Consequently, the LRCK frequency is equivalent to the audio sample rate.

When operating in Master mode, the LRCK is generated from the MCK, and the frequency of LRCK is then given as:
LRCK = MCK / CONFIG.RATIO

LRCK always toggles around the falling edge of the serial clock SCK.

Serial clock (SCK)

The serial clock (SCK), often referred to as the serial bit clock, pulses once for each data bit being transferred on the serial data lines SDIN and SDOUT.

When operating in Master mode, the SCK is generated from the MCK, and the frequency of SCK is then given as:
SCK = 2 * LRCK * CONFIG.SWIDTH 

The falling edge of the SCK falls on the toggling edge of LRCK.

When operating in Slave mode, SCK is provided by the external I2S master.

Master clock (MCK)

The master clock (MCK) is the clock from which LRCK and SCK are derived when operating in Master mode.

The master clock generator always needs to be enabled when in Master mode, but the generator can also be enabled when in Slave mode. Enabling the generator when in Slave mode can be useful in the case where the external master is not able to generate its own master clock.

MCK is generated from the CONFIG.MCKFREQ registers.

The following equation can be used to calculate the value of CONFIG.MCKFREQ for given MCK and clock source frequency:

Figure 3. MCK clock frequency equation
MCK clock frequency equation

The parameter fMCK is the requested MCK clock frequency in Hz, and fsource is the frequency of the selected clock source in Hz. Because of rounding errors, an accurate MCK clock may not be achievable. The equation does not take into account the maximum register value of CONFIG.MCKFREQ.

The actual MCK frequency can be calculated using the equation below.

Figure 4. Actual MCK clock frequency
Actual MCK clock frequency

The clock error can be calculated using the equation below. The error e is the percentage difference from the requested fMCK frequency.

Figure 5. MCK frequency error equation
MCK frequency error equation

The master clock generator does not add any jitter to the clock source chosen.

The master clock generator is enabled/disabled using CONFIG.MCKEN, and the generator is started or stopped by the START or STOP tasks respectively.

The MCK frequency can be adjusted on-the-fly by using MCKFREQ.

In Master mode, the LRCK and the SCK frequencies are closely related as both are derived from MCK and set indirectly through CONFIG.RATIO and CONFIG.SWIDTH.

When configuring these registers, the user is responsible for fulfilling the following requirements:

  1. The SCK frequency can never exceed the MCK frequency.
  2. The MCK/LRCK ratio shall be a multiple of 2 * CONFIG.SWIDTH.

The MCK signal can be routed to an output pin (specified in PSEL.MCK) to supply external I2S devices that require the MCK to be supplied from the outside.

When operating in Slave mode, the I2S module does not use the MCK and the MCK generator does not need to be enabled.

Figure 6. Relation between RATIO, MCK and LRCK
Relation between RATIO, MCK and LRCK.

Configuration examples

The following are example configurations for popular sample rates.

Table 1. Configuration examples for 32 MHz PCLK
Source frequency [Hz]Requested LRCK [Hz]RATIORequested MCK [Hz]MCKFREQMCK [Hz]LRCK [Hz]LRCK error [%]
3200000016000325120006817382450793615873-0.8
32000000160006410240001352744961032258161290.8
32000000160002564096000516685824400000015625-2.3
32000000320003210240001352744961032258322580.8
3200000032000642048000266350592200000031250-2.3
32000000320002568192000974741504800000031250-2.3
3200000044100321411200185319424139130443478-1.4
32000000441006428224003628154882909090454553.1
3200000048000321536000201326592152380947619-0.8
32000000480006430720003934289923200000500004.2
320000009600032307200039342899232000001000004.2
320000009600064614400075240243264000001000004.2

Width, alignment and format

The register CONFIG.SWIDTH defines the sample width of the data read and written to memory, as well as the number of SCK clock cycles per half-frame. Figure Aligned format, with CONFIG.SWIDTH configured to 16 bit samples in a 16 bit half-frame illustrates a configuration with identical sample and half-frame widths. The number of SCK pulses matches the number of sample bits. Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 24-bit half-frame illustrates a configuration with greater half-frame 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 half-frame.
Figure 7. Aligned format, with CONFIG.SWIDTH configured to 16 bit samples in a 16 bit half-frame
Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 16-bit half-frame.
Figure 8. Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 24-bit half-frame
Aligned format, with CONFIG.SWIDTH configured to 16-bit samples in a 24-bit half-frame.
The register CONFIG.FORMAT is used to choose whether a word shall be aligned on the LRCK edge, or be delayed one bit period after this edge:
Figure 9. Aligned format. Identical sample width and half-frame width. Left sample on high level of LRCK
Aligned format. Identical sample width and half-frame width.
Figure 10. I2S format. Identical sample width and half-frame width. Left sample on low level of LRCK
I2S format. Identical sample width and half-frame width.
If the half-frame width differs from the sample width, the sample value can be either right or left-aligned inside a half-frame, as specified in CONFIG.ALIGN
Figure 11. CONFIG.ALIGN set to left justified
CONFIG.ALIGN equaling left justified.
Figure 12. CONFIG.ALIGN set to right justified
CONFIG.ALIGN equaling right justified.

Slave mode considerations

In Slave mode, the sample width does not need to equal the half-frame width, or even frame size. This means that there can be extra or fewer SCK pulses per half-frame than what the sample and half-frame widths specified in CONFIG.SWIDTH require.

In cases where left-alignment is used, and the number of SCK pulses per half-frame is higher than the configured width, the following will apply:

  • For data received on SDIN, all bits after the least significant bit (LSB) of the word value will be discarded.
  • For data sent on SDOUT, all bits after the LSB of the word value will be 0.

In cases where left-alignment is used, and the number of SCK pulses per frame is lower than the word width, the following will apply:

  • Data sent and received on SDOUT and SDIN will be truncated with the LSBs being removed first.

In cases where right-alignment is used, and the number of SCK pulses per frame is higher than the configured width, the following will apply:

  • For data received on SDIN, all bits before the MSB of the word value will be discarded.
  • For data sent on SDOUT, all bits after the LSB of the word value will be 0 (same behavior as for left-alignment).

In cases where right-alignment is used, and the number of SCK pulses per frame is lower than the configured width, the following will apply:

  • Data received on SDIN will be sign-extended to the same number of bits as the sample width before being written to memory.
  • Data sent on SDOUT will be truncated with the LSBs being removed first (same behavior as for left-alignment).

EasyDMA

The I2S module implements EasyDMA for accessing internal Data RAM without CPU intervention.

The source and destination pointers for the TX and RX data are configured in TXD.PTR and RXD.PTR. The memory pointed to by these pointers will only be read or written when TX or RX are enabled in CONFIG.TXEN, and CONFIG.RXEN.

The addresses written to the pointer registers TXD.PTR and RXD.PTR are double-buffered in hardware. These double buffers are updated for every number of transmitted bytes given by RXTXD.MAXCNT read from/written to memory. The events TXPTRUPD and RXPTRUPD are generated whenever the TXD.PTR and RXD.PTR are transferred to these double buffers.

If TXD.PTR is not pointing to the Data RAM region when transmission is enabled, or RXD.PTR is not pointing to the Data RAM region when reception is enabled, an EasyDMA transfer may result in a HardFault and/or memory corruption. See Memory for more information about the different memory regions.

Due to the nature of I2S, where the number of transmitted samples always equals the number of received samples (at least when both TX and RX are enabled), one common register RXTXD.MAXCNT is used for specifying the sizes of these two memory buffers. The size of the buffers is specified in bytes.

In Stereo mode (CONFIG.CHANNELS=Stereo), the samples are stored as left and right sample pairs in memory. Memory mapping for 8-bit stereo. CONFIG.SWIDTH = 8Bit, CONFIG.CHANNELS = Stereo., Memory mapping for 16-bit stereo. CONFIG.SWIDTH = 16Bit, CONFIG.CHANNELS = Stereo. and Memory mapping for 24-bit stereo. CONFIG.SWIDTH = 24Bit, CONFIG.CHANNELS = Stereo. show how the samples are mapped to memory in this mode. The mapping is valid for both RX and TX.

In Mono mode (CONFIG.CHANNELS=Left or Right), RX sample from only one channel in the frame is stored in memory, the other channel sample is ignored. Memory mapping for 8-bit mono. CONFIG.SWIDTH = 8Bit, CONFIG.CHANNELS = Left., Memory mapping for 16-bit mono, left channel only. CONFIG.SWIDTH = 16Bit, CONFIG.CHANNELS = Left. and Memory mapping for 24-bit mono, left channel only. CONFIG.SWIDTH = 24Bit, CONFIG.CHANNELS = Left. show how RX samples are mapped to memory in this mode. For TX, the same outgoing sample read from memory is transmitted on both left and right in a frame, resulting in a mono output stream.

Figure 13. Memory mapping for 8-bit stereo. CONFIG.SWIDTH = 8Bit, CONFIG.CHANNELS = Stereo.
Figure 14. Memory mapping for 8-bit mono. CONFIG.SWIDTH = 8Bit, CONFIG.CHANNELS = Left.
Figure 15. Memory mapping for 16-bit stereo. CONFIG.SWIDTH = 16Bit, CONFIG.CHANNELS = Stereo.
Figure 16. Memory mapping for 16-bit mono, left channel only. CONFIG.SWIDTH = 16Bit, CONFIG.CHANNELS = Left.
Figure 17. Memory mapping for 24-bit stereo. CONFIG.SWIDTH = 24Bit, CONFIG.CHANNELS = Stereo.
Figure 18. Memory mapping for 24-bit mono, left channel only. CONFIG.SWIDTH = 24Bit, CONFIG.CHANNELS = Left.
Figure 19. Memory mapping for 32-bit stereo. CONFIG.SWIDTH = 32Bit, CONFIG.CHANNELS = Stereo.
Figure 20. Memory mapping for 32-bit mono, left channel only. CONFIG.SWIDTH = 32Bit, CONFIG.CHANNELS = Left.

Module operation

Described here is a typical operating procedure for the I2S module.

  1. Configure the I2S module using the CONFIG registers
    // Enable reception
    NRF_I2S->CONFIG.RXEN = (I2S_CONFIG_RXEN_RXEN_Enabled <<
                                           I2S_CONFIG_RXEN_RXEN_Pos);
    // Enable transmission
    NRF_I2S->CONFIG.TXEN = (I2S_CONFIG_TXEN_TXEN_Enabled <<
                                           I2S_CONFIG_TXEN_TXEN_Pos);
    // Enable MCK generator
    NRF_I2S->CONFIG.MCKEN = (I2S_CONFIG_MCKEN_MCKEN_Enabled <<
                                           I2S_CONFIG_MCKEN_MCKEN_Pos);
    // MCKFREQ = 4 MHz
    NRF_I2S->CONFIG.MCKFREQ = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV8 <<
                                           I2S_CONFIG_MCKFREQ_MCKFREQ_Pos;
    // Ratio = 256 
    NRF_I2S->CONFIG.RATIO = I2S_CONFIG_RATIO_RATIO_256X <<
                                           I2S_CONFIG_RATIO_RATIO_Pos;
    // MCKFREQ = 4 MHz and Ratio = 256 gives sample rate = 15.625 ks/s
    // Sample width = 16 bit
    NRF_I2S->CONFIG.SWIDTH = I2S_CONFIG_SWIDTH_SWIDTH_16Bit <<
                                           I2S_CONFIG_SWIDTH_SWIDTH_Pos;
    // Alignment = Left
    NRF_I2S->CONFIG.ALIGN = I2S_CONFIG_ALIGN_ALIGN_Left <<
                                           I2S_CONFIG_ALIGN_ALIGN_Pos;
    // Format = I2S
    NRF_I2S->CONFIG.FORMAT = I2S_CONFIG_FORMAT_FORMAT_I2S <<
                                           I2S_CONFIG_FORMAT_FORMAT_Pos;
    // Use stereo 
    NRF_I2S->CONFIG.CHANNELS = I2S_CONFIG_CHANNELS_CHANNELS_Stereo <<
                                           I2S_CONFIG_CHANNELS_CHANNELS_Pos;
    
  2. Map IO pins using the PINSEL registers
    // MCK routed to pin 0
    NRF_I2S->PSEL.MCK = (0 << I2S_PSEL_MCK_PIN_Pos) | 
                        (I2S_PSEL_MCK_CONNECT_Connected <<
                                                     I2S_PSEL_MCK_CONNECT_Pos);
    // SCK routed to pin 1
    NRF_I2S->PSEL.SCK = (1 << I2S_PSEL_SCK_PIN_Pos) | 
                        (I2S_PSEL_SCK_CONNECT_Connected <<
                                                     I2S_PSEL_SCK_CONNECT_Pos); 
    // LRCK routed to pin 2
    NRF_I2S->PSEL.LRCK = (2 << I2S_PSEL_LRCK_PIN_Pos) | 
                         (I2S_PSEL_LRCK_CONNECT_Connected <<
                                                     I2S_PSEL_LRCK_CONNECT_Pos); 
    // SDOUT routed to pin 3
    NRF_I2S->PSEL.SDOUT = (3 << I2S_PSEL_SDOUT_PIN_Pos) | 
                          (I2S_PSEL_SDOUT_CONNECT_Connected <<
                                                     I2S_PSEL_SDOUT_CONNECT_Pos);
    // SDIN routed on pin 4
    NRF_I2S->PSEL.SDIN = (4 << I2S_PSEL_SDIN_PIN_Pos) | 
                         (I2S_PSEL_SDIN_CONNECT_Connected <<
                                                     I2S_PSEL_SDIN_CONNECT_Pos); 
                        
  3. Configure TX and RX data pointers using the TXD, RXD and RXTXD registers
    NRF_I2S->TXD.PTR = my_tx_buf;
    NRF_I2S->RXD.PTR = my_rx_buf;
    NRF_I2S->TXD.MAXCNT = sizeof(my_rx_buf);
                        
  4. Enable the I2S module using the ENABLE register
    NRF_I2S->ENABLE = 1;
  5. Start audio streaming using the START task
    NRF_I2S->TASKS_START = 1;
  6. Handle received and transmitted data when receiving the TXPTRUPD and RXPTRUPD events
    if(NRF_I2S->EVENTS_TXPTRUPD  != 0)
    {
        NRF_I2S->TXD.PTR = my_next_tx_buf;
        NRF_I2S->EVENTS_TXPTRUPD = 0;
    }
    
    if(NRF_I2S->EVENTS_RXPTRUPD != 0)
    {
        NRF_I2S->RXD.PTR = my_next_rx_buf;
        NRF_I2S->EVENTS_RXPTRUPD = 0;
    }
                        

Pin configuration

The MCK, SCK, LRCK, SDIN and SDOUT signals associated with the I2S module are mapped to physical pins according to the pin numbers specified in the PSEL.x registers.

These pins are acquired whenever the I2S module is enabled through the register ENABLE.

When a pin is acquired by the I2S module, the direction of the pin (input or output) will be configured automatically, and any pin direction setting done in the GPIO module will be overridden. The directions for the various I2S pins are shown below in GPIO configuration before enabling peripheral (Master mode) and GPIO configuration before enabling peripheral (Slave mode).

To secure correct signal levels on the pins in System OFF mode, and when the I2S module is disabled, these pins must be configured in the GPIO peripheral directly.

Table 2. GPIO configuration before enabling peripheral (Master mode)
I2S signalI2S pinDirectionOutput valueComment
MCKAs specified in PSEL.MCKOutput0
LRCKAs specified in PSEL.LRCKOutput0
SCKAs specified in PSEL.SCKOutput0
SDINAs specified in PSEL.SDINInputNot applicable
SDOUTAs specified in PSEL.SDOUTOutput0
Table 3. GPIO configuration before enabling peripheral (Slave mode)
I2S signalI2S pinDirectionOutput valueComment
MCKAs specified in PSEL.MCKOutput0
LRCKAs specified in PSEL.LRCKInputNot applicable
SCKAs specified in PSEL.SCKInputNot applicable
SDINAs specified in PSEL.SDINInputNot applicable
SDOUTAs specified in PSEL.SDOUTOutput0

Registers

Instances

InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
I2S20 : S
I2S20 : NS
GLOBAL0x500DD000
0x400DD000
USSSANoInter-IC sound interface I2S20

Configuration

InstanceDomainConfiguration
I2S20 : S
I2S20 : NS
GLOBALAvailable GPIO port: P1

Register overview

RegisterOffsetTZDescription
TASKS_START0x000Starts continuous I2S transfer. Also starts MCK generator when this is enabled
TASKS_STOP0x004Stops I2S transfer and MCK generator. Triggering this task will cause the event STOPPED to be generated.
SUBSCRIBE_START0x080Subscribe configuration for task START
SUBSCRIBE_STOP0x084Subscribe configuration for task STOP
EVENTS_RXPTRUPD0x104The RXD.PTR register has been copied to internal double-buffers. When the I2S module is started and RX is enabled, this event will be generated for every ceil(RXTXD.MAXCNT/4) words received on the SDIN pin.
EVENTS_STOPPED0x108I2S transfer stopped.
EVENTS_TXPTRUPD0x114The TDX.PTR register has been copied to internal double-buffers. When the I2S module is started and TX is enabled, this event will be generated for every ceil(RXTXD.MAXCNT/4) words that are sent on the SDOUT pin.
EVENTS_FRAMESTART0x11CFrame start event, generated on the active edge of LRCK
PUBLISH_RXPTRUPD0x184Publish configuration for event RXPTRUPD
PUBLISH_STOPPED0x188Publish configuration for event STOPPED
PUBLISH_TXPTRUPD0x194Publish configuration for event TXPTRUPD
PUBLISH_FRAMESTART0x19CPublish configuration for event FRAMESTART
INTEN0x300Enable or disable interrupt
INTENSET0x304Enable interrupt
INTENCLR0x308Disable interrupt
ENABLE0x500Enable I2S module
CONFIG.MODE0x504I2S mode
CONFIG.RXEN0x508Reception (RX) enable
CONFIG.TXEN0x50CTransmission (TX) enable
CONFIG.MCKEN0x510Master clock generator enable
CONFIG.MCKFREQ0x514I2S clock generator control
CONFIG.RATIO0x518MCK / LRCK ratio
CONFIG.SWIDTH0x51CSample width
CONFIG.ALIGN0x520Alignment of sample within a frame
CONFIG.FORMAT0x524Frame format
CONFIG.CHANNELS0x528Enable channels
RXD.PTR0x538Receive buffer RAM start address.
TXD.PTR0x540Transmit buffer RAM start address
RXTXD.MAXCNT0x550Size of RXD and TXD buffers
PSEL.MCK0x560Pin select for MCK signal
PSEL.SCK0x564Pin select for SCK signal
PSEL.LRCK0x568Pin select for LRCK signal
PSEL.SDIN0x56CPin select for SDIN signal
PSEL.SDOUT0x570Pin select for SDOUT signal
CHANNEL[n].TERMINATEONBUSERROR0x580Terminate the transaction if a BUSERROR event is detected.
CHANNEL[n].BUSERRORADDRESS0x584Address of transaction that generated the last BUSERROR event.

TASKS_START

Address offset: 0x000

Starts continuous I2S transfer. Also starts MCK generator when this is enabled

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_STARTStarts continuous I2S transfer. Also starts MCK generator when this is enabled
Trigger1Trigger task

TASKS_STOP

Address offset: 0x004

Stops I2S transfer and MCK generator. Triggering this task will cause the event STOPPED to be generated.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_STOPStops I2S transfer and MCK generator. Triggering this task will cause the event STOPPED to be generated.
Trigger1Trigger task

SUBSCRIBE_START

Address offset: 0x080

Subscribe configuration for task START

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task START will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

SUBSCRIBE_STOP

Address offset: 0x084

Subscribe configuration for task STOP

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task STOP will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

EVENTS_RXPTRUPD

Address offset: 0x104

The RXD.PTR register has been copied to internal double-buffers. When the I2S module is started and RX is enabled, this event will be generated for every ceil(RXTXD.MAXCNT/4) words received on the SDIN pin.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_RXPTRUPDThe RXD.PTR register has been copied to internal double-buffers. When the I2S module is started and RX is enabled, this event will be generated for every ceil(RXTXD.MAXCNT/4) words received on the SDIN pin.
NotGenerated0Event not generated
Generated1Event generated

EVENTS_STOPPED

Address offset: 0x108

I2S transfer stopped.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_STOPPEDI2S transfer stopped.
NotGenerated0Event not generated
Generated1Event generated

EVENTS_TXPTRUPD

Address offset: 0x114

The TDX.PTR register has been copied to internal double-buffers. When the I2S module is started and TX is enabled, this event will be generated for every ceil(RXTXD.MAXCNT/4) words that are sent on the SDOUT pin.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_TXPTRUPDThe TDX.PTR register has been copied to internal double-buffers. When the I2S module is started and TX is enabled, this event will be generated for every ceil(RXTXD.MAXCNT/4) words that are sent on the SDOUT pin.
NotGenerated0Event not generated
Generated1Event generated

EVENTS_FRAMESTART

Address offset: 0x11C

Frame start event, generated on the active edge of LRCK

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_FRAMESTARTFrame start event, generated on the active edge of LRCK
NotGenerated0Event not generated
Generated1Event generated

PUBLISH_RXPTRUPD

Address offset: 0x184

Publish configuration for event RXPTRUPD

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event RXPTRUPD will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_STOPPED

Address offset: 0x188

Publish configuration for event STOPPED

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event STOPPED will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_TXPTRUPD

Address offset: 0x194

Publish configuration for event TXPTRUPD

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event TXPTRUPD will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_FRAMESTART

Address offset: 0x19C

Publish configuration for event FRAMESTART

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event FRAMESTART will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

INTEN

Address offset: 0x300

Enable or disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWRXPTRUPDEnable or disable interrupt for event RXPTRUPD
Disabled0Disable
Enabled1Enable
BRWSTOPPEDEnable or disable interrupt for event STOPPED
Disabled0Disable
Enabled1Enable
CRWTXPTRUPDEnable or disable interrupt for event TXPTRUPD
Disabled0Disable
Enabled1Enable
DRWFRAMESTARTEnable or disable interrupt for event FRAMESTART
Disabled0Disable
Enabled1Enable

INTENSET

Address offset: 0x304

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARW
W1S
RXPTRUPDWrite '1' to enable interrupt for event RXPTRUPD
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
BRW
W1S
STOPPEDWrite '1' to enable interrupt for event STOPPED
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
CRW
W1S
TXPTRUPDWrite '1' to enable interrupt for event TXPTRUPD
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
DRW
W1S
FRAMESTARTWrite '1' to enable interrupt for event FRAMESTART
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled

INTENCLR

Address offset: 0x308

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARW
W1C
RXPTRUPDWrite '1' to disable interrupt for event RXPTRUPD
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
BRW
W1C
STOPPEDWrite '1' to disable interrupt for event STOPPED
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
CRW
W1C
TXPTRUPDWrite '1' to disable interrupt for event TXPTRUPD
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
DRW
W1C
FRAMESTARTWrite '1' to disable interrupt for event FRAMESTART
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled

ENABLE

Address offset: 0x500

Enable I2S module

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLEEnable I2S module
Disabled0Disable
Enabled1Enable

CONFIG.MODE

Address offset: 0x504

I2S mode

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWMODEI2S mode
Master0Master mode. SCK and LRCK generated from internal master clcok (MCK) and output on pins defined by PSEL.xxx.
Slave1Slave mode. SCK and LRCK generated by external master and received on pins defined by PSEL.xxx

CONFIG.RXEN

Address offset: 0x508

Reception (RX) enable

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWRXENReception (RX) enable
Disabled0Reception disabled and now data will be written to the RXD.PTR address.
Enabled1Reception enabled.

CONFIG.TXEN

Address offset: 0x50C

Transmission (TX) enable

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARWTXENTransmission (TX) enable
Disabled0Transmission disabled and now data will be read from the RXD.TXD address.
Enabled1Transmission enabled.

CONFIG.MCKEN

Address offset: 0x510

Master clock generator enable

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARWMCKENMaster clock generator enable
Disabled0Master clock generator disabled and PSEL.MCK not connected(available as GPIO).
Enabled1Master clock generator running and MCK output on PSEL.MCK.

CONFIG.MCKFREQ

Address offset: 0x514

I2S clock generator control

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x2000000000100000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWMCKFREQ

I2S MCK frequency configuration

NOTE: Enumerations are deprecated, use MCKFREQ equation.

NOTE: The 12 least significant bits of the register are ignored and shall be set to zero.

32MDIV20x80000000

32 MHz / 2 = 16.0 MHz

Deprecated, use MCKFREQ equation.

32MDIV30x50000000

32 MHz / 3 = 10.6666667 MHz

Deprecated, use MCKFREQ equation.

32MDIV40x40000000

32 MHz / 4 = 8.0 MHz

Deprecated, use MCKFREQ equation.

32MDIV50x30000000

32 MHz / 5 = 6.4 MHz

Deprecated, use MCKFREQ equation.

32MDIV60x28000000

32 MHz / 6 = 5.3333333 MHz

Deprecated, use MCKFREQ equation.

32MDIV80x20000000

32 MHz / 8 = 4.0 MHz

Deprecated, use MCKFREQ equation.

32MDIV100x18000000

32 MHz / 10 = 3.2 MHz

Deprecated, use MCKFREQ equation.

32MDIV110x16000000

32 MHz / 11 = 2.9090909 MHz

Deprecated, use MCKFREQ equation.

32MDIV150x11000000

32 MHz / 15 = 2.1333333 MHz

Deprecated, use MCKFREQ equation.

32MDIV160x10000000

32 MHz / 16 = 2.0 MHz

Deprecated, use MCKFREQ equation.

32MDIV210x0C000000

32 MHz / 21 = 1.5238095 MHz

Deprecated, use MCKFREQ equation.

32MDIV230x0B000000

32 MHz / 23 = 1.3913043 MHz

Deprecated, use MCKFREQ equation.

32MDIV300x08800000

32 MHz / 30 = 1.0666667 MHz

Deprecated, use MCKFREQ equation.

32MDIV310x08400000

32 MHz / 31 = 1.0322581 MHz

Deprecated, use MCKFREQ equation.

32MDIV320x08000000

32 MHz / 32 = 1.0 MHz

Deprecated, use MCKFREQ equation.

32MDIV420x06000000

32 MHz / 42 = 0.7619048 MHz

Deprecated, use MCKFREQ equation.

32MDIV630x04100000

32 MHz / 63 = 0.5079365 MHz

Deprecated, use MCKFREQ equation.

32MDIV1250x020C0000

32 MHz / 125 = 0.256 MHz

Deprecated, use MCKFREQ equation.

CONFIG.RATIO

Address offset: 0x518

MCK / LRCK ratio

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000600000000000000000000000000000110
IDR/WFieldValue IDValueDescription
ARWRATIOMCK / LRCK ratio
32X0LRCK = MCK / 32
48X1LRCK = MCK / 48
64X2LRCK = MCK / 64
96X3LRCK = MCK / 96
128X4LRCK = MCK / 128
192X5LRCK = MCK / 192
256X6LRCK = MCK / 256
384X7LRCK = MCK / 384
512X8LRCK = MCK / 512

CONFIG.SWIDTH

Address offset: 0x51C

Sample width

Bit number313029282726252423222120191817161514131211109876543210
IDAAA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARWSWIDTHSample and half-frame width
8Bit08 bit sample.
16Bit116 bit sample.
24Bit224 bit sample.
32Bit332 bit sample.
8BitIn1648 bit sample in a 16-bit half-frame.
8BitIn3258 bit sample in a 32-bit half-frame.
16BitIn32616 bit sample in a 32-bit half-frame.
24BitIn32724 bit sample in a 32-bit half-frame.

CONFIG.ALIGN

Address offset: 0x520

Alignment of sample within a frame

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWALIGNAlignment of sample within a frame
Left0Left-aligned.
Right1Right-aligned.

CONFIG.FORMAT

Address offset: 0x524

Frame format

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWFORMATFrame format
I2S0Original I2S format.
Aligned1Alternate (left- or right-aligned) format.

CONFIG.CHANNELS

Address offset: 0x528

Enable channels

Bit number313029282726252423222120191817161514131211109876543210
IDAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHANNELSEnable channels
Stereo0Stereo.
Left1Left only.
Right2Right only.

RXD.PTR

Address offset: 0x538

Receive buffer RAM start address.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x2000000000100000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWPTR

Receive buffer Data RAM start address. When receiving, words containing samples will be written to this address. This address is a word aligned Data RAM address.

Note: See the memory chapter for details about which memories are available for EasyDMA.

TXD.PTR

Address offset: 0x540

Transmit buffer RAM start address

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x2000000000100000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWPTR

Transmit buffer Data RAM start address. When transmitting, words containing samples will be fetched from this address. This address is a word aligned Data RAM address.

Note: See the memory chapter for details about which memories are available for EasyDMA.

RXTXD.MAXCNT

Address offset: 0x550

Size of RXD and TXD buffers

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWMAXCNTSize of RXD and TXD buffers in number of bytes

PSEL.MCK

Address offset: 0x560

Pin select for MCK signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

PSEL.SCK

Address offset: 0x564

Pin select for SCK signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

PSEL.LRCK

Address offset: 0x568

Pin select for LRCK signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

PSEL.SDIN

Address offset: 0x56C

Pin select for SDIN signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

PSEL.SDOUT

Address offset: 0x570

Pin select for SDOUT signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

CHANNEL[n].TERMINATEONBUSERROR

Address offset: 0x580 + (n × 0x8)

Terminate the transaction if a BUSERROR event is detected.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLE
Disabled0Disable
Enabled1Enable

CHANNEL[n].BUSERRORADDRESS

Address offset: 0x584 + (n × 0x8)

Address of transaction that generated the last BUSERROR event.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARADDRESS