31#include "ove_config.h"
void ove_i2s_destroy(ove_i2s_t i2s)
Destroy an I2S handle previously created with ove_i2s_create.
int ove_i2s_create(ove_i2s_t *i2s, const struct ove_i2s_cfg *cfg)
Heap-mode counterpart of ove_i2s_init() — allocates storage and DMA buffers internally.
int ove_i2s_start(ove_i2s_t i2s)
Start I2S DMA streaming.
void ove_i2s_tx_half_cplt_isr(ove_i2s_t i2s)
ISR helper — invoke from backend TX half-complete interrupt.
void(* ove_i2s_cb_t)(ove_i2s_t i2s, void *user_data)
I2S half-buffer completion callback.
Definition i2s.h:61
int ove_i2s_set_tx_callback(ove_i2s_t i2s, ove_i2s_cb_t cb, void *user_data)
Set the TX half-buffer completion callback.
int ove_i2s_pause(ove_i2s_t i2s)
Pause I2S DMA streaming (can be resumed).
void ove_i2s_deinit(ove_i2s_t i2s)
Release an I2S handle previously created with ove_i2s_init.
void * ove_i2s_tx_buf(ove_i2s_t i2s)
Get pointer to the TX half-buffer safe to write.
void ove_i2s_rx_half_cplt_isr(ove_i2s_t i2s)
ISR helper — invoke from backend RX half-complete interrupt.
void * ove_i2s_rx_buf(ove_i2s_t i2s)
Get pointer to the most recently completed RX half-buffer.
void ove_i2s_rx_cplt_isr(ove_i2s_t i2s)
ISR helper — invoke from backend RX full-complete interrupt.
int ove_i2s_init(ove_i2s_t *i2s, ove_i2s_storage_t *storage, void *tx_dma_buf, void *rx_dma_buf, const struct ove_i2s_cfg *cfg)
Initialise I2S with caller-provided static storage and DMA buffers.
int ove_i2s_stop(ove_i2s_t i2s)
Stop I2S DMA streaming.
ove_i2s_dir_t
I2S stream direction.
Definition i2s.h:43
int ove_i2s_resume(ove_i2s_t i2s)
Resume I2S DMA streaming after pause.
size_t ove_i2s_half_buf_size(ove_i2s_t i2s)
Get the size of one half-buffer in bytes.
void ove_i2s_tx_cplt_isr(ove_i2s_t i2s)
ISR helper — invoke from backend TX full-complete interrupt.
int ove_i2s_set_rx_callback(ove_i2s_t i2s, ove_i2s_cb_t cb, void *user_data)
Set the RX half-buffer completion callback.
@ OVE_I2S_DIR_RX
Definition i2s.h:45
@ OVE_I2S_DIR_TX
Definition i2s.h:44
@ OVE_I2S_DIR_TXRX
Definition i2s.h:46
struct ove_i2s * ove_i2s_t
Opaque handle for an I2S / SAI bus controller.
Definition types.h:271
@ OVE_ERR_NOT_SUPPORTED
Definition types.h:98
I2S bus configuration descriptor.
Definition i2s.h:68
uint32_t sample_rate
Definition i2s.h:70
size_t dma_buf_samples
Definition i2s.h:74
unsigned int instance
Definition i2s.h:69
ove_i2s_dir_t direction
Definition i2s.h:73
uint8_t bit_depth
Definition i2s.h:71
uint8_t channels
Definition i2s.h:72