XCORE SDK
XCORE Software Development Kit
|
Classes | |
struct | i2s_config |
struct | i2s_callback_group_t |
Macros | |
#define | I2S_MAX_DATALINES 8 |
#define | I2S_CHANS_PER_FRAME 2 |
#define | I2S_CALLBACK_ATTR __attribute__((fptrgroup("i2s_callback"))) |
Typedefs | |
typedef enum i2s_mode | i2s_mode_t |
typedef enum i2s_slave_bclk_polarity | i2s_slave_bclk_polarity_t |
typedef struct i2s_config | i2s_config_t |
typedef enum i2s_restart | i2s_restart_t |
typedef void(* | i2s_init_t) (void *app_data, i2s_config_t *i2s_config) |
typedef i2s_restart_t(* | i2s_restart_check_t) (void *app_data) |
typedef void(* | i2s_receive_t) (void *app_data, size_t num_in, const int32_t *samples) |
typedef void(* | i2s_send_t) (void *app_data, size_t num_out, int32_t *samples) |
Enumerations | |
enum | i2s_mode { I2S_MODE_I2S , I2S_MODE_LEFT_JUSTIFIED } |
enum | i2s_slave_bclk_polarity { I2S_SLAVE_SAMPLE_ON_BCLK_RISING , I2S_SLAVE_SAMPLE_ON_BCLK_FALLING } |
enum | i2s_restart { I2S_NO_RESTART = 0 , I2S_RESTART , I2S_SHUTDOWN } |
The public API for using the HIL I2S core.
#define I2S_CALLBACK_ATTR __attribute__((fptrgroup("i2s_callback"))) |
This attribute must be specified on all I2S callback functions provided by the application.
typedef struct i2s_config i2s_config_t |
I2S configuration structure.
This structure describes the configuration of an I2S bus.
typedef void(* i2s_init_t) (void *app_data, i2s_config_t *i2s_config) |
I2S initialization event callback.
The I2S component will call this when it first initializes on first run of after a restart.
app_data | Points to application specific data supplied by the application. May be used for context data specific to each I2S task instance. |
i2s_config | This structure is provided if the connected component drives an I2S bus. The members of the structure should be set to the required configuration. |
typedef enum i2s_mode i2s_mode_t |
I2S mode.
This type is used to describe the I2S mode.
typedef void(* i2s_receive_t) (void *app_data, size_t num_in, const int32_t *samples) |
Receive an incoming frame of samples.
This callback will be called when a new frame of samples is read in by the I2S task.
app_data | Points to application specific data supplied by the application. May be used for context data specific to each I2S task instance. |
num_in | The number of input channels contained within the array. |
samples | The samples data array as signed 32-bit values. The component may not have 32-bits of accuracy (for example, many I2S codecs are 24-bit), in which case the bottom bits will be arbitrary values. |
typedef i2s_restart_t(* i2s_restart_check_t) (void *app_data) |
I2S restart check callback.
This callback is called once per frame. The application must return the required restart behavior.
app_data | Points to application specific data supplied by the application. May be used for context data specific to each I2S task instance. |
typedef enum i2s_restart i2s_restart_t |
Restart command type.
Restart commands that can be signalled to the I2S or TDM component.
typedef void(* i2s_send_t) (void *app_data, size_t num_out, int32_t *samples) |
Request an outgoing frame of samples.
This callback will be called when the I2S task needs a new frame of samples.
app_data | Points to application specific data supplied by the application. May be used for context data specific to each I2S task instance. |
num_out | The number of output channels contained within the array. |
samples | The samples data array as signed 32-bit values. The component may not have 32-bits of accuracy (for example, many I2S codecs are 24-bit), in which case the bottom bits will be arbitrary values. |
typedef enum i2s_slave_bclk_polarity i2s_slave_bclk_polarity_t |
I2S slave bit clock polarity.
Standard I2S is positive, that is toggle data and LR clock on falling edge of bit clock and sample them on rising edge of bit clock. Some masters have it the other way around.
enum i2s_mode |
enum i2s_restart |
Restart command type.
Restart commands that can be signalled to the I2S or TDM component.
I2S slave bit clock polarity.
Standard I2S is positive, that is toggle data and LR clock on falling edge of bit clock and sample them on rising edge of bit clock. Some masters have it the other way around.
Enumerator | |
---|---|
I2S_SLAVE_SAMPLE_ON_BCLK_RISING | Toggle falling, sample rising (default if not set) |
I2S_SLAVE_SAMPLE_ON_BCLK_FALLING | Toggle rising, sample falling |