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 <I2SDriverESP32V1.h>
|
| static IRAM_ATTR bool | onSentCb (i2s_chan_handle_t handle, i2s_event_data_t *event, void *user_ctx) |
| |
◆ available()
we assume the data is already available in the buffer
Implements I2SDriverBase.
◆ availableForWrite()
| int availableForWrite |
( |
| ) |
|
|
inlinevirtual |
Reports the real free space in the TX DMA queue: capacity minus the backlog of bytes handed to i2s_channel_write() but not yet reported back as sent by the on_sent event callback (see DriverI2S::startChannels and onSentCb below). Falls back to the old constant if the callback was never wired up (e.g. dma_capacity_ still 0 before begin()).
Implements I2SDriverBase.
◆ begin() [1/5]
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/5]
◆ begin() [3/5]
◆ begin() [4/5]
◆ begin() [5/5]
starts the DAC with the default config
◆ config()
◆ defaultConfig()
◆ end()
◆ getDriver()
◆ newChannels()
◆ onSentCb()
| static IRAM_ATTR bool onSentCb |
( |
i2s_chan_handle_t |
handle, |
|
|
i2s_event_data_t * |
event, |
|
|
void * |
user_ctx |
|
) |
| |
|
inlinestaticprotected |
on_sent callback (ISR context): a DMA buffer of event->size bytes has just finished physically transmitting. Nested classes have access to enclosing-class members in C++, so DriverI2S can call this directly.
◆ readBytes()
| size_t readBytes |
( |
void * |
dest, |
|
|
size_t |
size_bytes |
|
) |
| |
|
inlinevirtual |
◆ setAudioInfo()
Potentially updates the sample rate (if supported)
Implements I2SDriverBase.
◆ setWaitTimeReadMs()
◆ setWaitTimeWriteMs()
◆ writeBytes()
| size_t writeBytes |
( |
const void * |
src, |
|
|
size_t |
size_bytes |
|
) |
| |
|
inlinevirtual |
◆ bytes_sent_
| std::atomic<uint32_t> bytes_sent_ {0} |
|
protected |
◆ bytes_written_
| std::atomic<uint32_t> bytes_written_ {0} |
|
protected |
◆ cfg
◆ dma_capacity_
| uint32_t dma_capacity_ = 0 |
|
protected |
◆ i2s
◆ i2s_config
| i2s_std_config_t i2s_config |
|
protected |
◆ is_started
◆ rx_chan
| i2s_chan_handle_t rx_chan = nullptr |
|
protected |
◆ ticks_to_wait_read
◆ ticks_to_wait_write
◆ tx_chan
| i2s_chan_handle_t tx_chan = nullptr |
|
protected |
The documentation for this class was generated from the following file: