arduino-audio-tools
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
I2SDriverESP32V1 Class Reference

Basic I2S API for the ESP32 (using the new API). https://docs.espressif.com/projects/esp-idf/en/v5.0.1/esp32/api-reference/peripherals/i2s.html#i2s-communication-mode. More...

#include <I2SESP32V1.h>

Classes

struct  DriverCommon
 
struct  DriverI2S
 

Public Member Functions

int available ()
 we assume the data is already available in the buffer
 
int availableForWrite ()
 We limit the write size to the buffer size.
 
bool begin ()
 
bool begin (I2SConfigESP32V1 cfg)
 starts the DAC
 
bool begin (RxTxMode mode)
 starts the DAC with the default config
 
I2SConfigESP32V1 config ()
 provides the actual configuration
 
I2SConfigESP32V1 defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
void end ()
 stops the I2C and unistalls the driver
 
size_t readBytes (void *dest, size_t size_bytes)
 
bool setAudioInfo (AudioInfo info)
 Potentially updates the sample rate (if supported)
 
void setWaitTimeReadMs (TickType_t ms)
 
void setWaitTimeWriteMs (TickType_t ms)
 
size_t writeBytes (const void *src, size_t size_bytes)
 writes the data to the I2S interface
 

Protected Member Functions

bool begin (I2SConfigESP32V1 cfg, int txPin, int rxPin)
 -> protected methods from I2SDriverESP32V1 More...
 
DriverCommongetDriver (I2SConfigESP32V1 &cfg)
 
bool newChannels (I2SConfigESP32V1 &cfg, DriverCommon &driver)
 

Protected Attributes

I2SConfigESP32V1 cfg = defaultConfig(RX_MODE)
 
audio_tools::I2SDriverESP32V1::DriverI2S i2s
 
i2s_std_config_t i2s_config
 
bool is_started = false
 
i2s_chan_handle_t rx_chan = nullptr
 
TickType_t ticks_to_wait_read = portMAX_DELAY
 
TickType_t ticks_to_wait_write = portMAX_DELAY
 
i2s_chan_handle_t tx_chan = nullptr
 

Detailed Description

Basic I2S API for the ESP32 (using the new API). https://docs.espressif.com/projects/esp-idf/en/v5.0.1/esp32/api-reference/peripherals/i2s.html#i2s-communication-mode.

Author
Phil Schatzmann

Member Function Documentation

◆ begin() [1/2]

bool begin ( )
inline

starts the DAC with the current config - if not started yet. If I2S has been started there is no action and we return true

◆ begin() [2/2]

bool begin ( I2SConfigESP32V1  cfg,
int  txPin,
int  rxPin 
)
inlineprotected

-> protected methods from I2SDriverESP32V1

starts I2S


The documentation for this class was generated from the following file: