Components/driver/include/driver/i2s.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <esp_attr.h>
Include dependency graph for Components/driver/include/driver/i2s.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  i2s_sample_t
 I2S sample. More...
 
struct  i2s_module_config_t
 I2S module configuration (TX or RX) More...
 
struct  i2s_config_t
 I2S configuration parameters. More...
 
struct  i2s_buffer_info_t
 Defines a buffer with available content. More...
 
struct  i2s_buffer_stat_t
 Contains I2S buffer status information. More...
 

Typedefs

typedef void(* i2s_callback_t) (void *param, i2s_event_type_t event)
 Callback function type. More...
 
typedef unsigned TickType_t
 Defines the wait interval (presently milliseconds) More...
 
typedef uint8_t i2s_pin_set_t
 

Enumerations

enum  i2s_bits_per_sample_t { I2S_BITS_PER_SAMPLE_8BIT = 8, I2S_BITS_PER_SAMPLE_16BIT = 16, I2S_BITS_PER_SAMPLE_24BIT = 24 }
 I2S bit width per sample. More...
 
enum  i2s_channel_t { I2S_CHANNEL_MONO = 1, I2S_CHANNEL_STEREO = 2 }
 I2S channel. More...
 
enum  i2s_comm_format_t { I2S_COMM_FORMAT_I2S = 0x01, I2S_COMM_FORMAT_I2S_MSB = 0x01, I2S_COMM_FORMAT_I2S_LSB = 0x03 }
 I2S communication standard format. More...
 
enum  i2s_channel_fmt_t {
  I2S_CHANNEL_FMT_RIGHT_LEFT = 0x00, I2S_CHANNEL_FMT_ALL_RIGHT, I2S_CHANNEL_FMT_ALL_LEFT, I2S_CHANNEL_FMT_ONLY_RIGHT,
  I2S_CHANNEL_FMT_ONLY_LEFT
}
 I2S channel format type. More...
 
enum  i2s_mode_t { I2S_MODE_DISABLED, I2S_MODE_MASTER, I2S_MODE_SLAVE }
 I2S Mode, default is I2S_MODE_MASTER. More...
 
enum  i2s_event_type_t { I2S_EVENT_DMA_ERROR, I2S_EVENT_TX_DONE, I2S_EVENT_RX_DONE, I2S_EVENT_MAX }
 I2S event types. More...
 
enum  i2s_pin_t {
  I2S_PIN_BCK_OUT = 0x01, I2S_PIN_WS_OUT = 0x02, I2S_PIN_DATA_OUT = 0x04, I2S_PIN_BC_IN = 0x10,
  I2S_PIN_WS_IN = 0x20, I2S_PIN_DATA_IN = 0x40
}
 I2S pin enable for i2s_set_pin. More...
 

Functions

bool i2s_driver_install (const i2s_config_t *config)
 Install and start I2S driver. More...
 
void i2s_driver_uninstall ()
 Uninstall I2S driver. More...
 
bool i2s_start ()
 Start I2S driver. More...
 
bool i2s_stop ()
 Stop I2S driver. More...
 
bool i2s_set_sample_rates (uint32_t rate)
 
bool i2s_set_dividers (uint8_t bck_div, uint8_t mclk_div)
 
float i2s_get_real_rate ()
 
bool i2s_dma_read (i2s_buffer_info_t *info, size_t max_bytes)
 Fetch a DMA buffer containing received data (zero-copy) More...
 
bool i2s_dma_write (i2s_buffer_info_t *info, size_t max_bytes)
 Fetch a DMA buffer for direct writing (zero-copy) More...
 
size_t i2s_write (const void *src, size_t size, TickType_t ticks_to_wait)
 writes a buffer of frames into the DMA memory, returns the amount of frames written. More...
 
size_t i2s_read (void *dest, size_t size, TickType_t ticks_to_wait)
 Reads a block of received data. More...
 
bool i2s_zero_dma_buffer ()
 Zero the contents of the TX DMA buffer. More...
 
void i2s_set_pins (i2s_pin_set_t pins, bool enable)
 Configure I2S pins. More...
 
bool i2s_enable_loopback (bool enable)
 
bool i2s_stat_tx (i2s_buffer_stat_t *stat)
 Obtain state information for TX buffers. More...
 
bool i2s_stat_rx (i2s_buffer_stat_t *stat)
 Obtain state information for RX buffers. More...