ChibiOS/HAL
7.0.3
|
Generic I2S Driver. More...
![]() |
Generic I2S Driver.
This module implements a generic I2S driver.
HAL_USE_I2S
option must be enabled in halconf.h
.Macros | |
#define | i2s_lld_driver_fields |
Low level fields of the I2S driver structure. More... | |
#define | i2s_lld_config_fields |
Low level fields of the I2S configuration structure. More... | |
I2S modes | |
#define | I2S_MODE_SLAVE 0 |
#define | I2S_MODE_MASTER 1 |
Macro Functions | |
#define | i2sIsBufferComplete(i2sp) ((bool)((i2sp)->state == I2S_COMPLETE)) |
Buffer state. More... | |
#define | i2sStartExchangeI(i2sp) |
Starts a I2S data exchange. More... | |
#define | i2sStopExchangeI(i2sp) |
Stops the ongoing data exchange. More... | |
#define | _i2s_isr_half_code(i2sp) |
Common ISR code, half buffer event. More... | |
#define | _i2s_isr_full_code(i2sp) |
Common ISR code. More... | |
PLATFORM configuration options | |
#define | PLATFORM_I2S_USE_I2S1 FALSE |
I2SD1 driver enable switch. More... | |
Typedefs | |
typedef struct hal_i2s_driver | I2SDriver |
Type of a structure representing an I2S driver. More... | |
typedef struct hal_i2s_config | I2SConfig |
Type of a structure representing an I2S driver configuration. More... | |
typedef void(* | i2scallback_t) (I2SDriver *i2sp) |
I2S notification callback type. More... | |
Data Structures | |
struct | hal_i2s_driver |
Structure representing an I2S driver. More... | |
struct | hal_i2s_config |
Driver configuration structure. More... | |
Functions | |
void | i2sInit (void) |
I2S Driver initialization. More... | |
void | i2sObjectInit (I2SDriver *i2sp) |
Initializes the standard part of a I2SDriver structure. More... | |
void | i2sStart (I2SDriver *i2sp, const I2SConfig *config) |
Configures and activates the I2S peripheral. More... | |
void | i2sStop (I2SDriver *i2sp) |
Deactivates the I2S peripheral. More... | |
void | i2sStartExchange (I2SDriver *i2sp) |
Starts a I2S data exchange. More... | |
void | i2sStopExchange (I2SDriver *i2sp) |
Stops the ongoing data exchange. More... | |
void | i2s_lld_init (void) |
Low level I2S driver initialization. More... | |
void | i2s_lld_start (I2SDriver *i2sp) |
Configures and activates the I2S peripheral. More... | |
void | i2s_lld_stop (I2SDriver *i2sp) |
Deactivates the I2S peripheral. More... | |
void | i2s_lld_start_exchange (I2SDriver *i2sp) |
Starts a I2S data exchange. More... | |
void | i2s_lld_stop_exchange (I2SDriver *i2sp) |
Stops the ongoing data exchange. More... | |
Enumerations |
Variables | |
I2SDriver | I2SD1 |
I2S2 driver identifier. More... | |
#define i2sIsBufferComplete | ( | i2sp | ) | ((bool)((i2sp)->state == I2S_COMPLETE)) |
Buffer state.
[in] | i2sp | pointer to the I2SDriver object |
false | if the driver filled/sent the first half of the buffer. |
true | if the driver filled/sent the second half of the buffer. |
#define i2sStartExchangeI | ( | i2sp | ) |
Starts a I2S data exchange.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 158 of file hal_i2s.h.
Referenced by i2sStartExchange().
#define i2sStopExchangeI | ( | i2sp | ) |
Stops the ongoing data exchange.
The ongoing data exchange, if any, is stopped, if the driver was not active the function does nothing.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 172 of file hal_i2s.h.
Referenced by i2sStopExchange().
#define _i2s_isr_half_code | ( | i2sp | ) |
Common ISR code, half buffer event.
This code handles the portable part of the ISR code:
[in] | i2sp | pointer to the I2CDriver object |
#define _i2s_isr_full_code | ( | i2sp | ) |
Common ISR code.
This code handles the portable part of the ISR code:
[in] | i2sp | pointer to the I2CDriver object |
#define PLATFORM_I2S_USE_I2S1 FALSE |
I2SD1 driver enable switch.
If set to TRUE
the support for I2S1 is included.
FALSE
. Definition at line 48 of file hal_i2s_lld.h.
#define i2s_lld_driver_fields |
Low level fields of the I2S driver structure.
Definition at line 67 of file hal_i2s_lld.h.
#define i2s_lld_config_fields |
Low level fields of the I2S configuration structure.
Definition at line 74 of file hal_i2s_lld.h.
typedef struct hal_i2s_driver I2SDriver |
typedef struct hal_i2s_config I2SConfig |
typedef void(* i2scallback_t) (I2SDriver *i2sp) |
enum i2sstate_t |
void i2sInit | ( | void | ) |
I2S Driver initialization.
halInit()
, there is no need to explicitly initialize the driver.Definition at line 56 of file hal_i2s.c.
References i2s_lld_init().
Referenced by halInit().
void i2sObjectInit | ( | I2SDriver * | i2sp | ) |
Initializes the standard part of a I2SDriver
structure.
[out] | i2sp | pointer to the I2SDriver object |
Definition at line 68 of file hal_i2s.c.
References hal_i2s_driver::config, I2S_STOP, and hal_i2s_driver::state.
Referenced by i2s_lld_init().
Configures and activates the I2S peripheral.
[in] | i2sp | pointer to the I2SDriver object |
[in] | config | pointer to the I2SConfig object |
Definition at line 82 of file hal_i2s.c.
References hal_i2s_driver::config, i2s_lld_start(), I2S_READY, I2S_STOP, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), and hal_i2s_driver::state.
void i2sStop | ( | I2SDriver * | i2sp | ) |
Deactivates the I2S peripheral.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 102 of file hal_i2s.c.
References hal_i2s_driver::config, i2s_lld_stop(), I2S_READY, I2S_STOP, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), and hal_i2s_driver::state.
void i2sStartExchange | ( | I2SDriver * | i2sp | ) |
Starts a I2S data exchange.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 125 of file hal_i2s.c.
References I2S_READY, i2sStartExchangeI, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), and hal_i2s_driver::state.
void i2sStopExchange | ( | I2SDriver * | i2sp | ) |
Stops the ongoing data exchange.
The ongoing data exchange, if any, is stopped, if the driver was not active the function does nothing.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 144 of file hal_i2s.c.
References I2S_ACTIVE, I2S_COMPLETE, I2S_READY, i2sStopExchangeI, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), and hal_i2s_driver::state.
void i2s_lld_init | ( | void | ) |
Low level I2S driver initialization.
Definition at line 63 of file hal_i2s_lld.c.
References i2sObjectInit().
Referenced by i2sInit().
void i2s_lld_start | ( | I2SDriver * | i2sp | ) |
Configures and activates the I2S peripheral.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 77 of file hal_i2s_lld.c.
References I2S_STOP, and hal_i2s_driver::state.
Referenced by i2sStart().
void i2s_lld_stop | ( | I2SDriver * | i2sp | ) |
Deactivates the I2S peripheral.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 97 of file hal_i2s_lld.c.
References I2S_READY, and hal_i2s_driver::state.
Referenced by i2sStop().
void i2s_lld_start_exchange | ( | I2SDriver * | i2sp | ) |
Starts a I2S data exchange.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 116 of file hal_i2s_lld.c.
void i2s_lld_stop_exchange | ( | I2SDriver * | i2sp | ) |
Stops the ongoing data exchange.
The ongoing data exchange, if any, is stopped, if the driver was not active the function does nothing.
[in] | i2sp | pointer to the I2SDriver object |
Definition at line 130 of file hal_i2s_lld.c.
I2SDriver I2SD1 |
I2S2 driver identifier.
Definition at line 39 of file hal_i2s_lld.c.