28#if (HAL_USE_I2S == TRUE) || defined(__DOXYGEN__)
38#define I2S_MODE_SLAVE 0
39#define I2S_MODE_MASTER 1
149#define i2sIsBufferComplete(i2sp) ((bool)((i2sp)->state == I2S_COMPLETE))
158#define i2sStartExchangeI(i2sp) { \
159 i2s_lld_start_exchange(i2sp); \
160 (i2sp)->state = I2S_ACTIVE; \
172#define i2sStopExchangeI(i2sp) { \
173 i2s_lld_stop_exchange(i2sp); \
174 (i2sp)->state = I2S_READY; \
189#define _i2s_isr_half_code(i2sp) { \
190 if ((i2sp)->config->end_cb != NULL) { \
191 (i2sp)->config->end_cb(i2sp); \
208#define _i2s_isr_full_code(i2sp) { \
209 if ((i2sp)->config->end_cb) { \
210 (i2sp)->state = I2S_COMPLETE; \
211 (i2sp)->config->end_cb(i2sp); \
212 if ((i2sp)->state == I2S_COMPLETE) { \
213 (i2sp)->state = I2S_ACTIVE; \
void i2sInit(void)
I2S Driver initialization.
#define i2s_lld_config_fields
Low level fields of the I2S configuration structure.
struct hal_i2s_config I2SConfig
Type of a structure representing an I2S driver configuration.
void i2sStopExchange(I2SDriver *i2sp)
Stops the ongoing data exchange.
void i2sObjectInit(I2SDriver *i2sp)
Initializes the standard part of a I2SDriver structure.
void i2sStartExchange(I2SDriver *i2sp)
Starts a I2S data exchange.
struct hal_i2s_driver I2SDriver
Type of a structure representing an I2S driver.
#define i2s_lld_driver_fields
Low level fields of the I2S driver structure.
msg_t i2sStart(I2SDriver *i2sp, const I2SConfig *config)
Configures and activates the I2S peripheral.
void(* i2scallback_t)(I2SDriver *i2sp)
I2S notification callback type.
void i2sStop(I2SDriver *i2sp)
Deactivates the I2S peripheral.
i2sstate_t
Driver state machine possible states.
int32_t msg_t
Type of a message.
PLATFORM I2S subsystem low level driver header.
Driver configuration structure.
i2scallback_t end_cb
Callback function called during streaming.
size_t size
TX and RX buffers size as number of samples.
void * rx_buffer
Receive buffer pointer.
const void * tx_buffer
Transmission buffer pointer.
Structure representing an I2S driver.
i2sstate_t state
Driver state.
const I2SConfig * config
Current configuration data.