arduino-audio-tools
Loading...
Searching...
No Matches
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
 
DriverCommongetDriver (I2SConfigESP32V1 &cfg)
 
bool newChannels (I2SConfigESP32V1 &cfg, DriverCommon &driver)
 

Protected Attributes

I2SConfigESP32V1 cfg = defaultConfig(RXTX_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

◆ available()

int available ( )
inline

we assume the data is already available in the buffer

◆ availableForWrite()

int availableForWrite ( )
inline

We limit the write size to the buffer size.

◆ begin() [1/4]

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/4]

bool begin ( I2SConfigESP32V1  cfg)
inline

starts the DAC

◆ begin() [3/4]

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

-> protected methods from I2SDriverESP32V1

starts I2S

◆ begin() [4/4]

bool begin ( RxTxMode  mode)
inline

starts the DAC with the default config

◆ config()

I2SConfigESP32V1 config ( )
inline

provides the actual configuration

◆ defaultConfig()

I2SConfigESP32V1 defaultConfig ( RxTxMode  mode)
inline

Provides the default configuration.

◆ end()

void end ( )
inline

stops the I2C and unistalls the driver

◆ getDriver()

DriverCommon & getDriver ( I2SConfigESP32V1 cfg)
inlineprotected

◆ newChannels()

bool newChannels ( I2SConfigESP32V1 cfg,
DriverCommon driver 
)
inlineprotected

◆ readBytes()

size_t readBytes ( void dest,
size_t  size_bytes 
)
inline

◆ setAudioInfo()

bool setAudioInfo ( AudioInfo  info)
inline

Potentially updates the sample rate (if supported)

◆ setWaitTimeReadMs()

void setWaitTimeReadMs ( TickType_t  ms)
inline

◆ setWaitTimeWriteMs()

void setWaitTimeWriteMs ( TickType_t  ms)
inline

◆ writeBytes()

size_t writeBytes ( const void src,
size_t  size_bytes 
)
inline

writes the data to the I2S interface

Member Data Documentation

◆ cfg

◆ i2s

◆ i2s_config

i2s_std_config_t i2s_config
protected

◆ is_started

bool is_started = false
protected

◆ rx_chan

i2s_chan_handle_t rx_chan = nullptr
protected

◆ ticks_to_wait_read

TickType_t ticks_to_wait_read = portMAX_DELAY
protected

◆ ticks_to_wait_write

TickType_t ticks_to_wait_write = portMAX_DELAY
protected

◆ tx_chan

i2s_chan_handle_t tx_chan = nullptr
protected

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