PMSIS API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pi_i2s_conf Struct Reference

Interface configuration options.

Data Fields

uint32_t frame_clk_freq
 
size_t block_size
 
pi_mem_slab_t * mem_slab
 
void * pingpong_buffers [2]
 
uint16_t pdm_decimation
 
pi_i2s_fmt_t format
 
uint8_t word_size
 
int8_t mem_word_size
 
uint8_t channels
 
uint8_t itf
 
pi_i2s_opt_t options
 
int8_t pdm_shift
 
uint8_t pdm_filter_ena
 
uint8_t channel_id
 
int8_t asrc_channel
 

Field Documentation

int8_t pi_i2s_conf::asrc_channel

If different from -1, this redirect the specified stream(can be input or output) to/from the ASRC block with the channel specified here.

size_t pi_i2s_conf::block_size

Size of one RX/TX memory block(buffer) in bytes. On some chips, this size may have to be set under a maximum size, check the chip-specific section.

uint8_t pi_i2s_conf::channel_id

Channel ID, from 0 to the number of channels minus 1. In TDM mode this gives the ID of the slot to be configured. The options field can be used to specify if the RX or TX channel must be configured.

uint8_t pi_i2s_conf::channels

Number of words per frame.

pi_i2s_fmt_t pi_i2s_conf::format

Data stream format as defined by PI_I2S_FMT_* constants.

uint32_t pi_i2s_conf::frame_clk_freq

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

uint8_t pi_i2s_conf::itf

I2S device ID.

pi_mem_slab_t* pi_i2s_conf::mem_slab

memory slab to store RX/TX data.

int8_t pi_i2s_conf::mem_word_size

Number of bits representing one data word in memory. If it is -1, this is equal to word_size.

pi_i2s_opt_t pi_i2s_conf::options

Configuration options as defined by PI_I2S_OPT_* constants.

uint16_t pi_i2s_conf::pdm_decimation

In PDM mode, this gives the decimation factor to be used, e.g. the number of bits on which the filter is applied. This factor is usually in the range between 48 and 128. PDM_freq = sampling_rate * pdm_decimation.

  • PDM_freq is the clock frequency of the microphone.
  • sampling_rate is the audio sampling rate(22050kHz, 44100kHZ, 48000kHZ,...).
  • pdm_decimation is the decimation factor to apply.
uint8_t pi_i2s_conf::pdm_filter_ena

When using PDM mode, enable PDM filter.

int8_t pi_i2s_conf::pdm_shift

In PDM mode, the shift value to shift data when applying filter.

void* pi_i2s_conf::pingpong_buffers[2]

Pair of buffers used in double-bufferin mode to capture the incoming samples.

uint8_t pi_i2s_conf::word_size

Number of bits representing one data word.