Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
i2s_config Struct Reference

Interface configuration options. More...

#include <i2s.h>

Data Fields

uint8_t word_size
 Number of bits representing one data word.
 
uint8_t channels
 Number of words per frame.
 
i2s_fmt_t format
 Data stream format as defined by I2S_FMT_* constants.
 
i2s_opt_t options
 Configuration options as defined by I2S_OPT_* constants.
 
uint32_t frame_clk_freq
 Frame clock (WS) frequency, this is sampling rate.
 
struct k_mem_slab * mem_slab
 Memory slab to store RX/TX data.
 
size_t block_size
 Size of one RX/TX memory block (buffer) in bytes.
 
int32_t timeout
 Read/Write timeout.
 

Detailed Description

Interface configuration options.

Memory slab pointed to by the mem_slab field has to be defined and initialized by the user. For I2S driver to function correctly number of memory blocks in a slab has to be at least 2 per queue. Size of the memory block should be multiple of frame_size where frame_size = (channels * word_size_bytes). As an example 16 bit word will occupy 2 bytes, 24 or 32 bit word will occupy 4 bytes.

Please check Zephyr Kernel Primer for more information on memory slabs.

Remarks
When I2S data format is selected parameter channels is ignored, number of words in a frame is always 2.

Field Documentation

◆ block_size

size_t i2s_config::block_size

Size of one RX/TX memory block (buffer) in bytes.

◆ channels

uint8_t i2s_config::channels

Number of words per frame.

◆ format

i2s_fmt_t i2s_config::format

Data stream format as defined by I2S_FMT_* constants.

◆ frame_clk_freq

uint32_t i2s_config::frame_clk_freq

Frame clock (WS) frequency, this is sampling rate.

◆ mem_slab

struct k_mem_slab* i2s_config::mem_slab

Memory slab to store RX/TX data.

◆ options

i2s_opt_t i2s_config::options

Configuration options as defined by I2S_OPT_* constants.

◆ timeout

int32_t i2s_config::timeout

Read/Write timeout.

Number of milliseconds to wait in case TX queue is full or RX queue is empty, or 0, or SYS_FOREVER_MS.

◆ word_size

uint8_t i2s_config::word_size

Number of bits representing one data word.


The documentation for this struct was generated from the following file: