Zephyr Project API 4.0.0
A Scalable Open Source RTOS
|
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. | |
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.
size_t i2s_config::block_size |
Size of one RX/TX memory block (buffer) in bytes.
uint8_t i2s_config::channels |
Number of words per frame.
i2s_fmt_t i2s_config::format |
Data stream format as defined by I2S_FMT_* constants.
uint32_t i2s_config::frame_clk_freq |
Frame clock (WS) frequency, this is sampling rate.
struct k_mem_slab* i2s_config::mem_slab |
Memory slab to store RX/TX data.
i2s_opt_t i2s_config::options |
Configuration options as defined by I2S_OPT_* constants.
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.
uint8_t i2s_config::word_size |
Number of bits representing one data word.