I2S Master Initialization API#

The following structures and functions are used to initialize and start an I2S master driver instance.

void rtos_i2s_master_init(rtos_i2s_t *i2s_ctx, uint32_t io_core_mask, port_t p_dout[], size_t num_out, port_t p_din[], size_t num_in, port_t p_bclk, port_t p_lrclk, port_t p_mclk, xclock_t bclk)#

Initializes an RTOS I2S driver instance in master mode. This must only be called by the tile that owns the driver instance. It should be called before starting the RTOS, and must be called before calling rtos_i2s_start() or any of the core I2S driver functions with this instance.

Parameters:
  • i2s_ctx – A pointer to the I2S driver instance to initialize.

  • io_core_mask – A bitmask representing the cores on which the low level I2S I/O thread created by the driver is allowed to run. Bit 0 is core 0, bit 1 is core 1, etc.

  • p_dout – An array of data output ports.

  • num_out – The number of output data ports.

  • p_din – An array of data input ports.

  • num_in – The number of input data ports.

  • p_bclk – The bit clock output port.

  • p_lrclk – The word clock output port.

  • p_mclk – Input port which supplies the master clock.

  • bclk – A clock that will get configured for use with the bit clock.

void rtos_i2s_master_ext_clock_init(rtos_i2s_t *i2s_ctx, uint32_t io_core_mask, port_t p_dout[], size_t num_out, port_t p_din[], size_t num_in, port_t p_bclk, port_t p_lrclk, xclock_t bclk)#

Initializes an RTOS I2S driver instance in master mode but that uses an externally generated bit clock. This must only be called by the tile that owns the driver instance. It should be called before starting the RTOS, and must be called before calling rtos_i2s_start() or any of the core I2S driver functions with this instance.

Parameters:
  • i2s_ctx – A pointer to the I2S driver instance to initialize.

  • io_core_mask – A bitmask representing the cores on which the low level I2S I/O thread created by the driver is allowed to run. Bit 0 is core 0, bit 1 is core 1, etc.

  • p_dout – An array of data output ports.

  • num_out – The number of output data ports.

  • p_din – An array of data input ports.

  • num_in – The number of input data ports.

  • p_bclk – The bit clock output port.

  • p_lrclk – The word clock output port.

  • bclk – A clock that is configured externally to be used as the bit clock