Astra MCU SDK Peripheral Driver Library
Loading...
Searching...
No Matches
Enumerated Types

Enumerated types for I2S driver. More...

Enumerations

enum  i2s_status_en {
  I2S_OK = 0 ,
  I2S_ERROR ,
  I2S_ERROR_INVALID_PARAM ,
  I2S_ERROR_NOT_READY ,
  I2S_ERROR_BUSY ,
  I2S_ERROR_TIMEOUT ,
  I2S_ERROR_NO_MEMORY ,
  I2S_ERROR_INVALID_STATE ,
  I2S_ERROR_UNDERRUN ,
  I2S_ERROR_OVERRUN ,
  I2S_ERROR_NOT_SUPPORTED ,
  I2S_ERROR_HW_FAULT
}
 I2S return status codes. More...
enum  i2s_data_format_en {
  I2S_FMT_STANDARD_I2S = 0 ,
  I2S_FMT_LEFT_JUSTIFIED = 1 ,
  I2S_FMT_RIGHT_JUSTIFIED = 2 ,
  I2S_FMT_TDM = 3
}
 I2S Data Format selection. More...
enum  i2s_data_format_caps_en {
  I2S_FMT_CAP_STANDARD_I2S = (1 << 0) ,
  I2S_FMT_CAP_LEFT_JUSTIFIED = (1 << 1) ,
  I2S_FMT_CAP_RIGHT_JUSTIFIED = (1 << 2) ,
  I2S_FMT_CAP_TDM = (1 << 3)
}
 I2S data format capability flags. More...
enum  i2s_clock_mode_en {
  I2S_MODE_MASTER = 0 ,
  I2S_MODE_SLAVE = 1
}
 I2S Clock Mode selection. More...
enum  i2s_direction_en {
  I2S_DIR_TX = 0 ,
  I2S_DIR_RX = 1
}
 I2S transfer direction. More...
enum  i2s_state_en {
  I2S_STATE_NOT_READY = 0 ,
  I2S_STATE_READY = 1 ,
  I2S_STATE_RUNNING = 2 ,
  I2S_STATE_STOPPING = 3 ,
  I2S_STATE_ERROR = 4
}
 I2S operational state. More...
enum  i2s_trigger_cmd_en {
  I2S_TRIGGER_START = 0 ,
  I2S_TRIGGER_STOP = 1 ,
  I2S_TRIGGER_PREPARE = 2 ,
  I2S_TRIGGER_PAUSE = 3 ,
  I2S_TRIGGER_RESUME = 4
}
 I2S trigger commands. More...
enum  i2s_event_en {
  I2S_EVENT_TX_COMPLETE = (1 << 0) ,
  I2S_EVENT_RX_COMPLETE = (1 << 1) ,
  I2S_EVENT_TX_UNDERRUN = (1 << 2) ,
  I2S_EVENT_RX_OVERRUN = (1 << 3) ,
  I2S_EVENT_FRAME_ERROR = (1 << 4) ,
  I2S_EVENT_ERROR = (1 << 5)
}
 I2S event types. More...
enum  i2s_word_size_en {
  I2S_WORD_SIZE_8BIT = 8 ,
  I2S_WORD_SIZE_16BIT = 16 ,
  I2S_WORD_SIZE_24BIT = 24 ,
  I2S_WORD_SIZE_32BIT = 32
}
 I2S word size (bits per sample). More...
enum  i2s_word_size_caps_en {
  I2S_WORD_SIZE_CAP_8BIT = (1 << 0) ,
  I2S_WORD_SIZE_CAP_16BIT = (1 << 1) ,
  I2S_WORD_SIZE_CAP_24BIT = (1 << 2) ,
  I2S_WORD_SIZE_CAP_32BIT = (1 << 3)
}
 I2S word size capability flags. More...
enum  i2s_sample_rate_en {
  I2S_SAMPLE_RATE_8000 = 8000U ,
  I2S_SAMPLE_RATE_11025 = 11025U ,
  I2S_SAMPLE_RATE_12000 = 12000U ,
  I2S_SAMPLE_RATE_16000 = 16000U ,
  I2S_SAMPLE_RATE_22050 = 22050U ,
  I2S_SAMPLE_RATE_24000 = 24000U ,
  I2S_SAMPLE_RATE_32000 = 32000U ,
  I2S_SAMPLE_RATE_44100 = 44100U ,
  I2S_SAMPLE_RATE_48000 = 48000U ,
  I2S_SAMPLE_RATE_64000 = 64000U ,
  I2S_SAMPLE_RATE_88200 = 88200U ,
  I2S_SAMPLE_RATE_96000 = 96000U ,
  I2S_SAMPLE_RATE_176400 = 176400U ,
  I2S_SAMPLE_RATE_192000 = 192000U ,
  I2S_SAMPLE_RATE_384000 = 384000U
}
 Supported sample Rates.

Detailed Description

Enumerated types for I2S driver.

Enumeration Type Documentation

◆ i2s_status_en

I2S return status codes.

This enumeration defines various return and error codes used by the I2S driver to indicate operation success, failure, and specific error conditions.

Enumerator
I2S_OK 

Operation successful

I2S_ERROR 

Generic error

I2S_ERROR_INVALID_PARAM 

Invalid parameter

I2S_ERROR_NOT_READY 

Driver not initialized or ready

I2S_ERROR_BUSY 

Resource busy or operation in progress

I2S_ERROR_TIMEOUT 

Operation timed out

I2S_ERROR_NO_MEMORY 

Out of memory or buffer space

I2S_ERROR_INVALID_STATE 

Invalid state for requested operation

I2S_ERROR_UNDERRUN 

TX buffer underrun error

I2S_ERROR_OVERRUN 

RX buffer overrun error

I2S_ERROR_NOT_SUPPORTED 

Feature or operation not supported

I2S_ERROR_HW_FAULT 

Hardware fault or communication error

◆ i2s_data_format_en

I2S Data Format selection.

This enumeration defines the serial data format for I2S communication. Different formats vary in timing relationships between data, bit clock, and word select (frame sync) signals.

Enumerator
I2S_FMT_STANDARD_I2S 

Standard I2S format (MSB first, WS transition before data)

I2S_FMT_LEFT_JUSTIFIED 

Left Justified format (MSB aligned with WS transition)

I2S_FMT_RIGHT_JUSTIFIED 

Right Justified format (LSB aligned before WS transition)

I2S_FMT_TDM 

TDM format (Time Division Multiplexing)

◆ i2s_data_format_caps_en

I2S data format capability flags.

Use these flags to describe supported data formats. Multiple flags can be combined using bitwise OR.

Enumerator
I2S_FMT_CAP_STANDARD_I2S 

Standard I2S format supported

I2S_FMT_CAP_LEFT_JUSTIFIED 

Left Justified format supported

I2S_FMT_CAP_RIGHT_JUSTIFIED 

Right Justified format supported

I2S_FMT_CAP_TDM 

TDM format supported

◆ i2s_clock_mode_en

I2S Clock Mode selection.

This enumeration defines whether the I2S controller operates as master (generating clocks) or slave (receiving clocks from external source).

Enumerator
I2S_MODE_MASTER 

Controller generates bit clock and frame clock

I2S_MODE_SLAVE 

Controller receives bit clock and frame clock

◆ i2s_direction_en

I2S transfer direction.

This enumeration defines the data transfer direction for I2S operations. Full duplex (simultaneous TX and RX) is not represented as a single direction value; configure and operate TX and RX independently for full-duplex use cases.

Enumerator
I2S_DIR_TX 

Transmit direction only

I2S_DIR_RX 

Receive direction only

◆ i2s_state_en

I2S operational state.

This enumeration represents the current operational state of an I2S channel. State transitions follow a defined sequence: NOT_READY -> READY -> RUNNING -> STOPPING -> READY. ERROR state may be entered from any state and requires recovery using I2S_TRIGGER_PREPARE before returning to READY.

Enumerator
I2S_STATE_NOT_READY 

Not initialized or configured

I2S_STATE_READY 

Initialized and ready to start

I2S_STATE_RUNNING 

Currently running (transmitting/receiving)

I2S_STATE_STOPPING 

Stopping - draining buffers

I2S_STATE_ERROR 

Error state - requires recovery

◆ i2s_trigger_cmd_en

I2S trigger commands.

This enumeration defines commands to control I2S stream operation. These commands change the operational state and control data flow.

Enumerator
I2S_TRIGGER_START 

Start transmission/reception

I2S_TRIGGER_STOP 

Stop at end of current buffer

I2S_TRIGGER_PREPARE 

Prepare after error recovery

I2S_TRIGGER_PAUSE 

Pause transmission (can resume)

I2S_TRIGGER_RESUME 

Resume from pause

◆ i2s_event_en

I2S event types.

This enumeration defines events that trigger callbacks. Multiple events can be combined using bitwise OR for event masks.

Enumerator
I2S_EVENT_TX_COMPLETE 

TX buffer transfer complete

I2S_EVENT_RX_COMPLETE 

RX buffer transfer complete

I2S_EVENT_TX_UNDERRUN 

TX buffer underrun error

I2S_EVENT_RX_OVERRUN 

RX buffer overrun error

I2S_EVENT_FRAME_ERROR 

Frame synchronization error

I2S_EVENT_ERROR 

Generic hardware error

◆ i2s_word_size_en

I2S word size (bits per sample).

This enumeration defines supported sample word sizes in bits.

Enumerator
I2S_WORD_SIZE_8BIT 

8-bit samples

I2S_WORD_SIZE_16BIT 

16-bit samples

I2S_WORD_SIZE_24BIT 

24-bit samples

I2S_WORD_SIZE_32BIT 

32-bit samples

◆ i2s_word_size_caps_en

I2S word size capability flags.

This enumeration defines bitmask flags for indicating supported word sizes in hardware capabilities. Multiple flags can be combined using bitwise OR.

Enumerator
I2S_WORD_SIZE_CAP_8BIT 

8-bit word size supported

I2S_WORD_SIZE_CAP_16BIT 

16-bit word size supported

I2S_WORD_SIZE_CAP_24BIT 

24-bit word size supported

I2S_WORD_SIZE_CAP_32BIT 

32-bit word size supported