nrfx 2.5
Macros | Enumerations | Functions
I2S HAL

Hardware access layer for managing the Inter-IC Sound (I2S) peripheral. More...

Macros

#define NRF_I2S_HAS_CLKCONFIG   1
 Symbol indicating whether clock source configuration is available.
 
#define NRF_I2S_PIN_NOT_CONNECTED   0xFFFFFFFF
 This value can be provided as a parameter for the nrf_i2s_pins_set function call to specify that the given I2S signal (SDOUT, SDIN, or MCK) shall not be connected to a physical pin.
 

Enumerations

enum  nrf_i2s_task_t {
  NRF_I2S_TASK_START = offsetof(NRF_I2S_Type, TASKS_START),
  NRF_I2S_TASK_STOP = offsetof(NRF_I2S_Type, TASKS_STOP)
}
 I2S tasks. More...
 
enum  nrf_i2s_event_t {
  NRF_I2S_EVENT_RXPTRUPD = offsetof(NRF_I2S_Type, EVENTS_RXPTRUPD),
  NRF_I2S_EVENT_TXPTRUPD = offsetof(NRF_I2S_Type, EVENTS_TXPTRUPD),
  NRF_I2S_EVENT_STOPPED = offsetof(NRF_I2S_Type, EVENTS_STOPPED)
}
 I2S events. More...
 
enum  nrf_i2s_int_mask_t {
  NRF_I2S_INT_RXPTRUPD_MASK = I2S_INTENSET_RXPTRUPD_Msk,
  NRF_I2S_INT_TXPTRUPD_MASK = I2S_INTENSET_TXPTRUPD_Msk,
  NRF_I2S_INT_STOPPED_MASK = I2S_INTENSET_STOPPED_Msk
}
 I2S interrupts. More...
 
enum  nrf_i2s_mode_t {
  NRF_I2S_MODE_MASTER = I2S_CONFIG_MODE_MODE_Master,
  NRF_I2S_MODE_SLAVE = I2S_CONFIG_MODE_MODE_Slave
}
 I2S modes of operation. More...
 
enum  nrf_i2s_mck_t {
  NRF_I2S_MCK_DISABLED = 0,
  NRF_I2S_MCK_32MDIV2 = (int)I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV2,
  NRF_I2S_MCK_32MDIV3 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV3,
  NRF_I2S_MCK_32MDIV4 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV4,
  NRF_I2S_MCK_32MDIV5 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV5,
  NRF_I2S_MCK_32MDIV6 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV6,
  NRF_I2S_MCK_32MDIV8 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV8,
  NRF_I2S_MCK_32MDIV10 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV10,
  NRF_I2S_MCK_32MDIV11 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV11,
  NRF_I2S_MCK_32MDIV15 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV15,
  NRF_I2S_MCK_32MDIV16 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV16,
  NRF_I2S_MCK_32MDIV21 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV21,
  NRF_I2S_MCK_32MDIV23 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV23,
  NRF_I2S_MCK_32MDIV30 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV30,
  NRF_I2S_MCK_32MDIV31 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV31,
  NRF_I2S_MCK_32MDIV32 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV32,
  NRF_I2S_MCK_32MDIV42 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV42,
  NRF_I2S_MCK_32MDIV63 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV63,
  NRF_I2S_MCK_32MDIV125 = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV125
}
 I2S master clock generator settings. More...
 
enum  nrf_i2s_ratio_t {
  NRF_I2S_RATIO_32X = I2S_CONFIG_RATIO_RATIO_32X,
  NRF_I2S_RATIO_48X = I2S_CONFIG_RATIO_RATIO_48X,
  NRF_I2S_RATIO_64X = I2S_CONFIG_RATIO_RATIO_64X,
  NRF_I2S_RATIO_96X = I2S_CONFIG_RATIO_RATIO_96X,
  NRF_I2S_RATIO_128X = I2S_CONFIG_RATIO_RATIO_128X,
  NRF_I2S_RATIO_192X = I2S_CONFIG_RATIO_RATIO_192X,
  NRF_I2S_RATIO_256X = I2S_CONFIG_RATIO_RATIO_256X,
  NRF_I2S_RATIO_384X = I2S_CONFIG_RATIO_RATIO_384X,
  NRF_I2S_RATIO_512X = I2S_CONFIG_RATIO_RATIO_512X
}
 I2S MCK/LRCK ratios. More...
 
enum  nrf_i2s_swidth_t {
  NRF_I2S_SWIDTH_8BIT = I2S_CONFIG_SWIDTH_SWIDTH_8Bit,
  NRF_I2S_SWIDTH_16BIT = I2S_CONFIG_SWIDTH_SWIDTH_16Bit,
  NRF_I2S_SWIDTH_24BIT = I2S_CONFIG_SWIDTH_SWIDTH_24Bit,
  NRF_I2S_SWIDTH_32BIT = I2S_CONFIG_SWIDTH_SWIDTH_32Bit,
  NRF_I2S_SWIDTH_8BIT_IN16BIT = I2S_CONFIG_SWIDTH_SWIDTH_8BitIn16,
  NRF_I2S_SWIDTH_8BIT_IN32BIT = I2S_CONFIG_SWIDTH_SWIDTH_8BitIn32,
  NRF_I2S_SWIDTH_16BIT_IN32BIT = I2S_CONFIG_SWIDTH_SWIDTH_16BitIn32,
  NRF_I2S_SWIDTH_24BIT_IN32BIT = I2S_CONFIG_SWIDTH_SWIDTH_24BitIn32
}
 I2S sample widths. More...
 
enum  nrf_i2s_align_t {
  NRF_I2S_ALIGN_LEFT = I2S_CONFIG_ALIGN_ALIGN_Left,
  NRF_I2S_ALIGN_RIGHT = I2S_CONFIG_ALIGN_ALIGN_Right
}
 I2S alignments of sample within a frame. More...
 
enum  nrf_i2s_format_t {
  NRF_I2S_FORMAT_I2S = I2S_CONFIG_FORMAT_FORMAT_I2S,
  NRF_I2S_FORMAT_ALIGNED = I2S_CONFIG_FORMAT_FORMAT_Aligned
}
 I2S frame formats. More...
 
enum  nrf_i2s_channels_t {
  NRF_I2S_CHANNELS_STEREO = I2S_CONFIG_CHANNELS_CHANNELS_Stereo,
  NRF_I2S_CHANNELS_LEFT = I2S_CONFIG_CHANNELS_CHANNELS_Left,
  NRF_I2S_CHANNELS_RIGHT = I2S_CONFIG_CHANNELS_CHANNELS_Right
}
 I2S enabled channels. More...
 
enum  nrf_i2s_clksrc_t {
  NRF_I2S_CLKSRC_PCLK32M = I2S_CONFIG_CLKCONFIG_CLKSRC_PCLK32M,
  NRF_I2S_CLKSRC_ACLK = I2S_CONFIG_CLKCONFIG_CLKSRC_ACLK
}
 I2S Clock source selection. More...
 

Functions

NRF_STATIC_INLINE void nrf_i2s_task_trigger (NRF_I2S_Type *p_reg, nrf_i2s_task_t task)
 Function for activating the specified I2S task. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_task_address_get (NRF_I2S_Type const *p_reg, nrf_i2s_task_t task)
 Function for getting the address of the specified I2S task register. More...
 
NRF_STATIC_INLINE void nrf_i2s_event_clear (NRF_I2S_Type *p_reg, nrf_i2s_event_t event)
 Function for clearing the specified I2S event. More...
 
NRF_STATIC_INLINE bool nrf_i2s_event_check (NRF_I2S_Type const *p_reg, nrf_i2s_event_t event)
 Function for retrieving the state of the I2S event. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_event_address_get (NRF_I2S_Type const *p_reg, nrf_i2s_event_t event)
 Function for getting the address of the specified I2S event register. More...
 
NRF_STATIC_INLINE void nrf_i2s_int_enable (NRF_I2S_Type *p_reg, uint32_t mask)
 Function for enabling specified interrupts. More...
 
NRF_STATIC_INLINE void nrf_i2s_int_disable (NRF_I2S_Type *p_reg, uint32_t mask)
 Function for disabling specified interrupts. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_int_enable_check (NRF_I2S_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled. More...
 
NRF_STATIC_INLINE void nrf_i2s_enable (NRF_I2S_Type *p_reg)
 Function for enabling the I2S peripheral. More...
 
NRF_STATIC_INLINE void nrf_i2s_disable (NRF_I2S_Type *p_reg)
 Function for disabling the I2S peripheral. More...
 
NRF_STATIC_INLINE void nrf_i2s_subscribe_set (NRF_I2S_Type *p_reg, nrf_i2s_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given I2S task. More...
 
NRF_STATIC_INLINE void nrf_i2s_subscribe_clear (NRF_I2S_Type *p_reg, nrf_i2s_task_t task)
 Function for clearing the subscribe configuration for a given I2S task. More...
 
NRF_STATIC_INLINE void nrf_i2s_publish_set (NRF_I2S_Type *p_reg, nrf_i2s_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given I2S event. More...
 
NRF_STATIC_INLINE void nrf_i2s_publish_clear (NRF_I2S_Type *p_reg, nrf_i2s_event_t event)
 Function for clearing the publish configuration for a given I2S event. More...
 
NRF_STATIC_INLINE void nrf_i2s_pins_set (NRF_I2S_Type *p_reg, uint32_t sck_pin, uint32_t lrck_pin, uint32_t mck_pin, uint32_t sdout_pin, uint32_t sdin_pin)
 Function for configuring I2S pins. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_sck_pin_get (NRF_I2S_Type const *p_reg)
 Function for getting the SCK pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_lrck_pin_get (NRF_I2S_Type const *p_reg)
 Function for getting the LRCK pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_mck_pin_get (NRF_I2S_Type const *p_reg)
 Function for getting the MCK pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_sdout_pin_get (NRF_I2S_Type const *p_reg)
 Function for getting the SDOUT pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_i2s_sdin_pin_get (NRF_I2S_Type const *p_reg)
 Function for getting the SDIN pin selection. More...
 
NRF_STATIC_INLINE bool nrf_i2s_configure (NRF_I2S_Type *p_reg, nrf_i2s_mode_t mode, nrf_i2s_format_t format, nrf_i2s_align_t alignment, nrf_i2s_swidth_t sample_width, nrf_i2s_channels_t channels, nrf_i2s_mck_t mck_setup, nrf_i2s_ratio_t ratio)
 Function for setting the I2S peripheral configuration. More...
 
NRF_STATIC_INLINE void nrf_i2s_transfer_set (NRF_I2S_Type *p_reg, uint16_t size, uint32_t *p_rx_buffer, uint32_t const *p_tx_buffer)
 Function for setting up the I2S transfer. More...
 
NRF_STATIC_INLINE void nrf_i2s_rx_buffer_set (NRF_I2S_Type *p_reg, uint32_t *p_buffer)
 Function for setting the pointer to the receive buffer. More...
 
NRF_STATIC_INLINE uint32_t * nrf_i2s_rx_buffer_get (NRF_I2S_Type const *p_reg)
 Function for getting the pointer to the receive buffer. More...
 
NRF_STATIC_INLINE void nrf_i2s_tx_buffer_set (NRF_I2S_Type *p_reg, uint32_t const *p_buffer)
 Function for setting the pointer to the transmit buffer. More...
 
NRF_STATIC_INLINE uint32_t * nrf_i2s_tx_buffer_get (NRF_I2S_Type const *p_reg)
 Function for getting the pointer to the transmit buffer. More...
 
NRF_STATIC_INLINE void nrf_i2s_clk_configure (NRF_I2S_Type *p_reg, nrf_i2s_clksrc_t clksrc, bool enable_bypass)
 Function for configuring I2S Clock. More...
 

Detailed Description

Hardware access layer for managing the Inter-IC Sound (I2S) peripheral.

Enumeration Type Documentation

◆ nrf_i2s_align_t

I2S alignments of sample within a frame.

Enumerator
NRF_I2S_ALIGN_LEFT 

Left-aligned.

NRF_I2S_ALIGN_RIGHT 

Right-aligned.

◆ nrf_i2s_channels_t

I2S enabled channels.

Enumerator
NRF_I2S_CHANNELS_STEREO 

Stereo.

NRF_I2S_CHANNELS_LEFT 

Left only.

NRF_I2S_CHANNELS_RIGHT 

Right only.

◆ nrf_i2s_clksrc_t

I2S Clock source selection.

Enumerator
NRF_I2S_CLKSRC_PCLK32M 

32MHz peripheral clock.

NRF_I2S_CLKSRC_ACLK 

Audio PLL clock.

◆ nrf_i2s_event_t

I2S events.

Enumerator
NRF_I2S_EVENT_RXPTRUPD 

The RXD.PTR register has been copied to internal double buffers.

NRF_I2S_EVENT_TXPTRUPD 

The TXD.PTR register has been copied to internal double buffers.

NRF_I2S_EVENT_STOPPED 

I2S transfer stopped.

◆ nrf_i2s_format_t

I2S frame formats.

Enumerator
NRF_I2S_FORMAT_I2S 

Original I2S format.

NRF_I2S_FORMAT_ALIGNED 

Alternate (left-aligned or right-aligned) format.

◆ nrf_i2s_int_mask_t

I2S interrupts.

Enumerator
NRF_I2S_INT_RXPTRUPD_MASK 

Interrupt on RXPTRUPD event.

NRF_I2S_INT_TXPTRUPD_MASK 

Interrupt on TXPTRUPD event.

NRF_I2S_INT_STOPPED_MASK 

Interrupt on STOPPED event.

◆ nrf_i2s_mck_t

I2S master clock generator settings.

Enumerator
NRF_I2S_MCK_DISABLED 

MCK disabled.

NRF_I2S_MCK_32MDIV2 

32 MHz / 2 = 16.0 MHz.

NRF_I2S_MCK_32MDIV3 

32 MHz / 3 = 10.6666667 MHz.

NRF_I2S_MCK_32MDIV4 

32 MHz / 4 = 8.0 MHz.

NRF_I2S_MCK_32MDIV5 

32 MHz / 5 = 6.4 MHz.

NRF_I2S_MCK_32MDIV6 

32 MHz / 6 = 5.3333333 MHz.

NRF_I2S_MCK_32MDIV8 

32 MHz / 8 = 4.0 MHz.

NRF_I2S_MCK_32MDIV10 

32 MHz / 10 = 3.2 MHz.

NRF_I2S_MCK_32MDIV11 

32 MHz / 11 = 2.9090909 MHz.

NRF_I2S_MCK_32MDIV15 

32 MHz / 15 = 2.1333333 MHz.

NRF_I2S_MCK_32MDIV16 

32 MHz / 16 = 2.0 MHz.

NRF_I2S_MCK_32MDIV21 

32 MHz / 21 = 1.5238095 MHz.

NRF_I2S_MCK_32MDIV23 

32 MHz / 23 = 1.3913043 MHz.

NRF_I2S_MCK_32MDIV30 

32 MHz / 30 = 1.0666667 MHz.

NRF_I2S_MCK_32MDIV31 

32 MHz / 31 = 1.0322581 MHz.

NRF_I2S_MCK_32MDIV32 

32 MHz / 32 = 1.0 MHz.

NRF_I2S_MCK_32MDIV42 

32 MHz / 42 = 0.7619048 MHz.

NRF_I2S_MCK_32MDIV63 

32 MHz / 63 = 0.5079365 MHz.

NRF_I2S_MCK_32MDIV125 

32 MHz / 125 = 0.256 MHz.

◆ nrf_i2s_mode_t

I2S modes of operation.

Enumerator
NRF_I2S_MODE_MASTER 

Master mode.

NRF_I2S_MODE_SLAVE 

Slave mode.

◆ nrf_i2s_ratio_t

I2S MCK/LRCK ratios.

Enumerator
NRF_I2S_RATIO_32X 

LRCK = MCK / 32.

NRF_I2S_RATIO_48X 

LRCK = MCK / 48.

NRF_I2S_RATIO_64X 

LRCK = MCK / 64.

NRF_I2S_RATIO_96X 

LRCK = MCK / 96.

NRF_I2S_RATIO_128X 

LRCK = MCK / 128.

NRF_I2S_RATIO_192X 

LRCK = MCK / 192.

NRF_I2S_RATIO_256X 

LRCK = MCK / 256.

NRF_I2S_RATIO_384X 

LRCK = MCK / 384.

NRF_I2S_RATIO_512X 

LRCK = MCK / 512.

◆ nrf_i2s_swidth_t

I2S sample widths.

Enumerator
NRF_I2S_SWIDTH_8BIT 

8 bit.

NRF_I2S_SWIDTH_16BIT 

16 bit.

NRF_I2S_SWIDTH_24BIT 

24 bit.

NRF_I2S_SWIDTH_32BIT 

32 bit.

NRF_I2S_SWIDTH_8BIT_IN16BIT 

8 bit sample in a 16-bit half-frame.

NRF_I2S_SWIDTH_8BIT_IN32BIT 

8 bit sample in a 32-bit half-frame.

NRF_I2S_SWIDTH_16BIT_IN32BIT 

16 bit sample in a 32-bit half-frame.

NRF_I2S_SWIDTH_24BIT_IN32BIT 

24 bit sample in a 32-bit half-frame.

◆ nrf_i2s_task_t

I2S tasks.

Enumerator
NRF_I2S_TASK_START 

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

NRF_I2S_TASK_STOP 

Stops I2S transfer. Also stops the MCK generator.

Function Documentation

◆ nrf_i2s_clk_configure()

NRF_STATIC_INLINE void nrf_i2s_clk_configure ( NRF_I2S_Type *  p_reg,
nrf_i2s_clksrc_t  clksrc,
bool  enable_bypass 
)

Function for configuring I2S Clock.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]clksrcI2S Clock source selection.
[in]enable_bypassBypass clock generator. MCK will be equal to source input. If bypass is enabled the MCKFREQ setting has no effect.

◆ nrf_i2s_configure()

NRF_STATIC_INLINE bool nrf_i2s_configure ( NRF_I2S_Type *  p_reg,
nrf_i2s_mode_t  mode,
nrf_i2s_format_t  format,
nrf_i2s_align_t  alignment,
nrf_i2s_swidth_t  sample_width,
nrf_i2s_channels_t  channels,
nrf_i2s_mck_t  mck_setup,
nrf_i2s_ratio_t  ratio 
)

Function for setting the I2S peripheral configuration.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]modeMode of operation (master or slave).
[in]formatI2S frame format.
[in]alignmentAlignment of sample within a frame.
[in]sample_widthSample width.
[in]channelsEnabled channels.
[in]mck_setupMaster clock generator setup.
[in]ratioMCK/LRCK ratio.
Return values
trueThe configuration has been set successfully.
falseThe specified configuration is not allowed.

◆ nrf_i2s_disable()

NRF_STATIC_INLINE void nrf_i2s_disable ( NRF_I2S_Type *  p_reg)

Function for disabling the I2S peripheral.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_i2s_enable()

NRF_STATIC_INLINE void nrf_i2s_enable ( NRF_I2S_Type *  p_reg)

Function for enabling the I2S peripheral.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_i2s_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_event_address_get ( NRF_I2S_Type const *  p_reg,
nrf_i2s_event_t  event 
)

Function for getting the address of the specified I2S event register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventSpecified event.
Returns
Address of the specified event register.

◆ nrf_i2s_event_check()

NRF_STATIC_INLINE bool nrf_i2s_event_check ( NRF_I2S_Type const *  p_reg,
nrf_i2s_event_t  event 
)

Function for retrieving the state of the I2S event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrf_i2s_event_clear()

NRF_STATIC_INLINE void nrf_i2s_event_clear ( NRF_I2S_Type *  p_reg,
nrf_i2s_event_t  event 
)

Function for clearing the specified I2S event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to clear.

◆ nrf_i2s_int_disable()

NRF_STATIC_INLINE void nrf_i2s_int_disable ( NRF_I2S_Type *  p_reg,
uint32_t  mask 
)

Function for disabling specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled.

◆ nrf_i2s_int_enable()

NRF_STATIC_INLINE void nrf_i2s_int_enable ( NRF_I2S_Type *  p_reg,
uint32_t  mask 
)

Function for enabling specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled.

◆ nrf_i2s_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_i2s_int_enable_check ( NRF_I2S_Type const *  p_reg,
uint32_t  mask 
)

Function for checking if the specified interrupts are enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked.
Returns
Mask of enabled interrupts.

◆ nrf_i2s_lrck_pin_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_lrck_pin_get ( NRF_I2S_Type const *  p_reg)

Function for getting the LRCK pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
LRCK pin selection.

◆ nrf_i2s_mck_pin_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_mck_pin_get ( NRF_I2S_Type const *  p_reg)

Function for getting the MCK pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
MCK pin selection.

◆ nrf_i2s_pins_set()

NRF_STATIC_INLINE void nrf_i2s_pins_set ( NRF_I2S_Type *  p_reg,
uint32_t  sck_pin,
uint32_t  lrck_pin,
uint32_t  mck_pin,
uint32_t  sdout_pin,
uint32_t  sdin_pin 
)

Function for configuring I2S pins.

Usage of the SDOUT, SDIN, and MCK signals is optional. If a given signal is not needed, pass the NRF_I2S_PIN_NOT_CONNECTED value instead of its pin number.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]sck_pinSCK pin number.
[in]lrck_pinLRCK pin number.
[in]mck_pinMCK pin number.
[in]sdout_pinSDOUT pin number.
[in]sdin_pinSDIN pin number.

◆ nrf_i2s_publish_clear()

NRF_STATIC_INLINE void nrf_i2s_publish_clear ( NRF_I2S_Type *  p_reg,
nrf_i2s_event_t  event 
)

Function for clearing the publish configuration for a given I2S event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrf_i2s_publish_set()

NRF_STATIC_INLINE void nrf_i2s_publish_set ( NRF_I2S_Type *  p_reg,
nrf_i2s_event_t  event,
uint8_t  channel 
)

Function for setting the publish configuration for a given I2S event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to set the configuration.
[in]channelChannel through which to publish the event.

◆ nrf_i2s_rx_buffer_get()

NRF_STATIC_INLINE uint32_t * nrf_i2s_rx_buffer_get ( NRF_I2S_Type const *  p_reg)

Function for getting the pointer to the receive buffer.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the receive buffer.

◆ nrf_i2s_rx_buffer_set()

NRF_STATIC_INLINE void nrf_i2s_rx_buffer_set ( NRF_I2S_Type *  p_reg,
uint32_t *  p_buffer 
)

Function for setting the pointer to the receive buffer.

Note
The size of the buffer can be set only by calling nrf_i2s_transfer_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufferPointer to the receive buffer.

◆ nrf_i2s_sck_pin_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_sck_pin_get ( NRF_I2S_Type const *  p_reg)

Function for getting the SCK pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
SCK pin selection.

◆ nrf_i2s_sdin_pin_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_sdin_pin_get ( NRF_I2S_Type const *  p_reg)

Function for getting the SDIN pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
SDIN pin selection.

◆ nrf_i2s_sdout_pin_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_sdout_pin_get ( NRF_I2S_Type const *  p_reg)

Function for getting the SDOUT pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
SDOUT pin selection.

◆ nrf_i2s_subscribe_clear()

NRF_STATIC_INLINE void nrf_i2s_subscribe_clear ( NRF_I2S_Type *  p_reg,
nrf_i2s_task_t  task 
)

Function for clearing the subscribe configuration for a given I2S task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrf_i2s_subscribe_set()

NRF_STATIC_INLINE void nrf_i2s_subscribe_set ( NRF_I2S_Type *  p_reg,
nrf_i2s_task_t  task,
uint8_t  channel 
)

Function for setting the subscribe configuration for a given I2S task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to set the configuration.
[in]channelChannel through which to subscribe events.

◆ nrf_i2s_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_i2s_task_address_get ( NRF_I2S_Type const *  p_reg,
nrf_i2s_task_t  task 
)

Function for getting the address of the specified I2S task register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskSpecified task.
Returns
Address of the specified task register.

◆ nrf_i2s_task_trigger()

NRF_STATIC_INLINE void nrf_i2s_task_trigger ( NRF_I2S_Type *  p_reg,
nrf_i2s_task_t  task 
)

Function for activating the specified I2S task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

◆ nrf_i2s_transfer_set()

NRF_STATIC_INLINE void nrf_i2s_transfer_set ( NRF_I2S_Type *  p_reg,
uint16_t  size,
uint32_t *  p_rx_buffer,
uint32_t const *  p_tx_buffer 
)

Function for setting up the I2S transfer.

This function sets up the RX and TX buffers and enables reception or transmission (or both) accordingly. If the transfer in a given direction is not required, pass NULL instead of the pointer to the corresponding buffer.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]sizeSize of the buffers (in 32-bit words).
[in]p_rx_bufferPointer to the receive buffer. Pass NULL to disable reception.
[in]p_tx_bufferPointer to the transmit buffer. Pass NULL to disable transmission.

◆ nrf_i2s_tx_buffer_get()

NRF_STATIC_INLINE uint32_t * nrf_i2s_tx_buffer_get ( NRF_I2S_Type const *  p_reg)

Function for getting the pointer to the transmit buffer.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the transmit buffer.

◆ nrf_i2s_tx_buffer_set()

NRF_STATIC_INLINE void nrf_i2s_tx_buffer_set ( NRF_I2S_Type *  p_reg,
uint32_t const *  p_buffer 
)

Function for setting the pointer to the transmit buffer.

Note
The size of the buffer can be set only by calling nrf_i2s_transfer_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufferPointer to the transmit buffer.

Documentation feedback | Developer Zone | Subscribe | Updated