PDM object with IRQ-based callbacks to a FreeRTOS task, for use with BackgroundAudio.
More...
|
| ESP32PDMAudio (int8_t dout=0) |
| Construct ESP32-based PDM object with IRQ-based callbacks to a FreeRTOS task, for use with BackgroundAudio.
|
|
void | setPin (int8_t dout) |
| Set the PDM GPIO pin before calling begin
|
|
bool | setFrequency (int freq) override |
| Set the sample rate of the PDM interface. Can be called while running.
|
|
bool | begin () override |
| Start the PDM interface.
|
|
| ESP32I2SAudio (int8_t bclk=0, int8_t ws=1, int8_t dout=2, int8_t mclk=-1) |
| Construct ESP32-based I2S object with IRQ-based callbacks to a FreeRTOS task, for use with BackgroundAudio.
|
|
void | setPins (int8_t bclk, int8_t ws, int8_t dout, int8_t mclk=-1) |
| Set the I2S GPIO pins before calling begin
|
|
void | setInverted (bool bclk, bool ws, bool mclk=false) |
| Set the I2S GPIO inversions before calling begin
|
|
bool | setBuffers (size_t buffers, size_t bufferWords, int32_t silenceSample=0) override |
| Set the size and number of the I2S buffers before begin
|
|
bool | setBitsPerSample (int bps) override |
| Set the bits per sample for the I2S output. Only 16-bit supported.
|
|
bool | setFrequency (int freq) override |
| Set the sample rate (LRCLK/WS) of the I2S interface. Can be called while running.
|
|
bool | setStereo (bool stereo=true) override |
| Set mono or stereo mode. Only stereo supported.
|
|
bool | begin () override |
| Start the I2S interface.
|
|
void | _backgroundTask () |
| Background I2S DMA buffer notification task. Tracks number of bytes available to be written.
|
|
void | _saturating_add_available (uint32_t add) |
|
void | _saturating_sub_available (uint32_t sub) |
|
uint32_t | frames () |
| Get number of DMA frames(buffers) processed.
|
|
uint32_t | irqs () |
| Get the number of input data shifts processed by decoder since begin
|
|
uint32_t | underflows () |
| Get the number of times the MP3 decoder has underflowed waiting on raw data since begin
|
|
IRAM_ATTR bool | _onSentCB (i2s_chan_handle_t handle, i2s_event_data_t *event) |
| Object-based callback for I2S Sent notification.
|
|
bool | end () override |
| Stop the I2S device.
|
|
bool | getUnderflow () override |
| Determine if there was an underflow since the last time this was called. Cleared on read.
|
|
void | onTransmit (void(*cb)(void *), void *cbData) override |
| Set the callback function to be called every DMA buffer completion.
|
|
size_t | write (const uint8_t *buffer, size_t size) override |
| Write data to the I2S interface. Not legal from IRQ context. Will not block and may write less than requested.
|
|
size_t | write (uint8_t d) override |
| Write single byte to I2S buffers. Not supported.
|
|
int | availableForWrite () override |
| Determine the number of frames we can write to the DMA buffers at this instant.
|
|
PDM object with IRQ-based callbacks to a FreeRTOS task, for use with BackgroundAudio.