Driver for the I2SC - Inter-IC Sound Controller module.
I2SC provides a 5-wire, bidirectional, synchronous, digital audio link with off-chip audio devices: ISDI, ISDO, IWS, ISCK and IMCK pins.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the I2SC - Inter-IC Sound Controller. | |
Data Structures | |
struct | i2s_config |
Configuration setting structure. More... | |
struct | i2s_dev_inst |
Macros | |
#define | I2S_RETRY_VALUE 10000 |
Typedefs | |
typedef void(* | i2s_callback_t )(void) |
typedef enum i2s_interrupt_source | i2s_interrupt_source_t |
I2S interrupt source. More... | |
Functions | |
void | i2s_clear_status (struct i2s_dev_inst *const dev_inst, i2s_interrupt_source_t source) |
Clear the I2S status value. More... | |
void | i2s_disable (struct i2s_dev_inst *const dev_inst) |
Disable the I2S module. More... | |
static void | i2s_disable_clocks (struct i2s_dev_inst *dev_inst) |
Disable the clocks for the I2S module. More... | |
void | i2s_disable_interrupt (struct i2s_dev_inst *const dev_inst, i2s_interrupt_source_t source) |
Disable the specified interrput sources. More... | |
static void | i2s_disable_reception (struct i2s_dev_inst *dev_inst) |
Disable the I2S module in reception. More... | |
static void | i2s_disable_transmission (struct i2s_dev_inst *dev_inst) |
Disable the I2S module in transmission. More... | |
void | i2s_enable (struct i2s_dev_inst *const dev_inst) |
Enable the I2S module. More... | |
static void | i2s_enable_clocks (struct i2s_dev_inst *dev_inst) |
Enable the clocks for the I2S module. More... | |
void | i2s_enable_interrupt (struct i2s_dev_inst *const dev_inst, i2s_interrupt_source_t source) |
Enable the specified interrput sources. More... | |
static void | i2s_enable_reception (struct i2s_dev_inst *dev_inst) |
Enable the I2S module in reception. More... | |
static void | i2s_enable_transmission (struct i2s_dev_inst *dev_inst) |
Enable the I2S module in transmission. More... | |
static void | i2s_get_config_defaults (struct i2s_config *const cfg) |
Get the default I2S module configuration: Data format: 32 bits Sample frequecny ratio: 1024 Tx channel: Stereo Rx channel: Stereo DMA for Tx: 1 DMA channel for 1 I2S Tx channel DMA for Rx: 1 DMA channel for 1 I2S Rx channel Loopback: No Master mode: Yes Master clock enable: Yes Transmit data in underrun: Yes Slot length is 24: No. More... | |
static uint32_t | i2s_get_interrupt_mask (struct i2s_dev_inst *const dev_inst) |
Get the I2S interrupts mask value. More... | |
static uint32_t | i2s_get_status (struct i2s_dev_inst *dev_inst) |
Get the I2S status value. More... | |
enum status_code | i2s_init (struct i2s_dev_inst *const dev_inst, I2sc *i2sc, struct i2s_config *const cfg) |
Initialize and configure the I2S module. More... | |
enum status_code | i2s_read (struct i2s_dev_inst *dev_inst, uint32_t *data) |
Read a single message of data. More... | |
static void | i2s_reset (struct i2s_dev_inst *dev_inst) |
Resets the I2S module. More... | |
void | i2s_set_callback (struct i2s_dev_inst *const dev_inst, i2s_interrupt_source_t source, i2s_callback_t callback, uint8_t irq_level) |
Set callback for I2S. More... | |
enum status_code | i2s_write (struct i2s_dev_inst *dev_inst, uint32_t data) |
Write a single message of data. More... | |
#define I2S_RETRY_VALUE 10000 |
Referenced by i2s_read(), and i2s_write().
typedef void(* i2s_callback_t)(void) |
typedef enum i2s_interrupt_source i2s_interrupt_source_t |
I2S interrupt source.
enum i2s_data_format |
enum i2s_dma_channel |
enum i2s_fs_rate |
enum i2s_interrupt_source |
void i2s_clear_status | ( | struct i2s_dev_inst * | dev_inst, |
i2s_interrupt_source_t | source | ||
) |
Clear the I2S status value.
dev_inst | Device structure pointer. |
source | Interrupt source |
References Assert, i2s_dev_inst::hw_dev, I2S_INTERRUPT_RXOR, and I2S_INTERRUPT_TXUR.
void i2s_disable | ( | struct i2s_dev_inst *const | dev_inst | ) |
Disable the I2S module.
dev_inst | Device structure pointer. |
References SLEEPMGR_ACTIVE, sleepmgr_unlock_mode(), and UNUSED.
Referenced by run_i2s_test().
|
inlinestatic |
Disable the clocks for the I2S module.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
void i2s_disable_interrupt | ( | struct i2s_dev_inst *const | dev_inst, |
i2s_interrupt_source_t | source | ||
) |
Disable the specified interrput sources.
dev_inst | Device structure pointer. |
source | Interrupt source |
References Assert, i2s_dev_inst::hw_dev, I2S_INTERRUPT_ENDRX, I2S_INTERRUPT_ENDTX, I2S_INTERRUPT_RXBUFF, I2S_INTERRUPT_RXOR, I2S_INTERRUPT_RXRDY, I2S_INTERRUPT_TXBUFE, I2S_INTERRUPT_TXRDY, and I2S_INTERRUPT_TXUR.
|
inlinestatic |
Disable the I2S module in reception.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
|
inlinestatic |
Disable the I2S module in transmission.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
void i2s_enable | ( | struct i2s_dev_inst *const | dev_inst | ) |
Enable the I2S module.
dev_inst | Device structure pointer. |
References SLEEPMGR_ACTIVE, sleepmgr_lock_mode(), and UNUSED.
Referenced by run_i2s_test().
|
inlinestatic |
Enable the clocks for the I2S module.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
Referenced by run_i2s_test().
void i2s_enable_interrupt | ( | struct i2s_dev_inst *const | dev_inst, |
i2s_interrupt_source_t | source | ||
) |
Enable the specified interrput sources.
dev_inst | Device structure pointer. |
source | Interrupt source |
References Assert, i2s_dev_inst::hw_dev, I2S_INTERRUPT_ENDRX, I2S_INTERRUPT_ENDTX, I2S_INTERRUPT_RXBUFF, I2S_INTERRUPT_RXOR, I2S_INTERRUPT_RXRDY, I2S_INTERRUPT_TXBUFE, I2S_INTERRUPT_TXRDY, and I2S_INTERRUPT_TXUR.
Referenced by i2s_set_callback().
|
inlinestatic |
Enable the I2S module in reception.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
Referenced by run_i2s_test().
|
inlinestatic |
Enable the I2S module in transmission.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
Referenced by run_i2s_test().
|
inlinestatic |
Get the default I2S module configuration: Data format: 32 bits Sample frequecny ratio: 1024 Tx channel: Stereo Rx channel: Stereo DMA for Tx: 1 DMA channel for 1 I2S Tx channel DMA for Rx: 1 DMA channel for 1 I2S Rx channel Loopback: No Master mode: Yes Master clock enable: Yes Transmit data in underrun: Yes Slot length is 24: No.
cfg | Pointer to I2S configuration. |
References Assert, i2s_config::data_format, i2s_config::fs_ratio, I2S_CHANNEL_STEREO, I2S_DATA_32BIT, I2S_FS_RATE_1024, I2S_ONE_DMA_CHANNEL_FOR_ONE_CHANNEL, i2s_config::loopback, i2s_config::master_clock_divide, i2s_config::master_clock_enable, i2s_config::master_mode, i2s_config::rx_channels, i2s_config::rx_dma, i2s_config::slot_length_24, i2s_config::transmit_mode_underrun, i2s_config::tx_channels, and i2s_config::tx_dma.
Referenced by run_i2s_test().
|
inlinestatic |
Get the I2S interrupts mask value.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
Referenced by i2s_interrupt_handler().
|
inlinestatic |
Get the I2S status value.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
Referenced by i2s_interrupt_handler().
enum status_code i2s_init | ( | struct i2s_dev_inst *const | dev_inst, |
I2sc * | i2sc, | ||
struct i2s_config *const | cfg | ||
) |
Initialize and configure the I2S module.
dev_inst | Device structure pointer. |
i2sc | Base address of the I2SC instance. |
cfg | Pointer to I2S configuration. |
References _i2s_set_config(), Assert, i2s_dev_inst::cfg, i2s_dev_inst::hw_dev, i2s_reset(), and sysclk_enable_peripheral_clock().
Referenced by run_i2s_test().
enum status_code i2s_read | ( | struct i2s_dev_inst *const | dev_inst, |
uint32_t * | data | ||
) |
Read a single message of data.
dev_inst | Device structure pointer. |
*data | Pointer for receive data |
References Assert, i2s_dev_inst::hw_dev, I2S_RETRY_VALUE, STATUS_ERR_TIMEOUT, and STATUS_OK.
Referenced by wait_transfer().
|
inlinestatic |
Resets the I2S module.
dev_inst | Device structure pointer. |
References i2s_dev_inst::hw_dev.
Referenced by i2s_init().
void i2s_set_callback | ( | struct i2s_dev_inst *const | dev_inst, |
i2s_interrupt_source_t | source, | ||
i2s_callback_t | callback, | ||
uint8_t | irq_level | ||
) |
Set callback for I2S.
dev_inst | Device structure pointer. |
source | Interrupt source. |
callback | Callback function pointer. |
irq_level | Interrupt level. |
References Assert, callback, i2s_dev_inst::hw_dev, i2s_callback_pointer, and i2s_enable_interrupt().
enum status_code i2s_write | ( | struct i2s_dev_inst *const | dev_inst, |
uint32_t | data | ||
) |
Write a single message of data.
dev_inst | Device structure pointer. |
data | The data to write |
References Assert, i2s_dev_inst::hw_dev, I2S_RETRY_VALUE, STATUS_ERR_TIMEOUT, and STATUS_OK.
Referenced by wait_transfer().