30#include "ove_config.h"
31#include "ove/storage.h"
91int ove_i2s_init(
ove_i2s_t *i2s, ove_i2s_storage_t *storage,
92 void *tx_dma_buf,
void *rx_dma_buf,
99#elif !defined(__ZIG_CIMPORT__)
100#define ove_i2s_create(pi2s, cfg) \
101 ({ static ove_i2s_storage_t _ove_stor_; \
102 static uint8_t _ove_txbuf_[((cfg)->dma_buf_samples) * ((cfg)->bit_depth / 8)] \
103 __attribute__((aligned(32))); \
104 static uint8_t _ove_rxbuf_[((cfg)->dma_buf_samples) * ((cfg)->bit_depth / 8)] \
105 __attribute__((aligned(32))); \
106 ove_i2s_init((pi2s), &_ove_stor_, \
107 ((cfg)->direction & OVE_I2S_DIR_TX) ? _ove_txbuf_ : (void *)0, \
108 ((cfg)->direction & OVE_I2S_DIR_RX) ? _ove_rxbuf_ : (void *)0, \
110#define ove_i2s_destroy(i2s) ove_i2s_deinit(i2s)
187size_t ove_i2s_half_buf_size(
ove_i2s_t i2s);
191void ove_i2s_rx_half_cplt_isr(
ove_i2s_t i2s);
193void ove_i2s_tx_half_cplt_isr(
ove_i2s_t i2s);
199static inline void ove_i2s_destroy(
ove_i2s_t i) { (void)i; }
206static inline void *ove_i2s_rx_buf(
ove_i2s_t i) { (void)i;
return (
void *)0; }
207static inline void *ove_i2s_tx_buf(
ove_i2s_t i) { (void)i;
return (
void *)0; }
208static inline size_t ove_i2s_half_buf_size(
ove_i2s_t i) { (void)i;
return 0; }
void(* ove_i2s_cb_t)(ove_i2s_t i2s, void *user_data)
I2S half-buffer completion callback.
Definition i2s.h:60
ove_i2s_dir_t
I2S stream direction.
Definition i2s.h:42
@ OVE_I2S_DIR_RX
Definition i2s.h:44
@ OVE_I2S_DIR_TX
Definition i2s.h:43
@ OVE_I2S_DIR_TXRX
Definition i2s.h:45
#define OVE_ERR_NOT_SUPPORTED
The requested feature is not supported by the active backend.
Definition types.h:38
struct ove_i2s * ove_i2s_t
Opaque handle for an I2S / SAI bus controller.
Definition types.h:145
I2S bus configuration descriptor.
Definition i2s.h:67
uint32_t sample_rate
Definition i2s.h:69
size_t dma_buf_samples
Definition i2s.h:73
unsigned int instance
Definition i2s.h:68
ove_i2s_dir_t direction
Definition i2s.h:72
uint8_t bit_depth
Definition i2s.h:70
uint8_t channels
Definition i2s.h:71