|
arduino-audio-tools
|
Audio output to PWM pins for the ESP32. The ESP32 supports up to 16 channels. More...
#include <PWMDriverESP32.h>
Public Member Functions | |
| PWMDriverESP32 () | |
| PWMConfig & | audioInfo () |
| virtual int | availableForWrite () |
| bool | begin (PWMConfig cfg) |
| virtual PWMConfig | defaultConfig () |
| virtual int | effectiveOutputSampleRate () |
| Provides the effective sample rate. | |
| virtual void | end () |
| uint32_t | framesPerSecond () |
| bool | isTimerStarted () |
| void | logPins () |
| virtual void | pwmWrite (int channel, int value) |
| void | setBuffer (BaseBuffer< uint8_t > *buffer) |
| virtual void | setupPWM () |
| Setup LED PWM. | |
| virtual void | setupTimer () |
| Setup ESP32 timer with callback. | |
| virtual void | startTimer () |
| uint32_t | underflowsPerSecond () |
| void | updateStatistics () |
| virtual size_t | write (const uint8_t *data, size_t len) |
Protected Member Functions | |
| virtual int | decimation () |
| Decimation factor to reduce the sample rate. | |
| void | deleteBuffer () |
| float | frequency (int resolution) |
| determiens the PWM frequency based on the requested resolution | |
| virtual bool | isDecimateActive () |
| virtual int | maxChannels () |
| virtual int | maxOutputValue () |
| provides the max value for the configured resulution | |
| virtual int | maxSampleRate () |
| Provides the max working sample rate. | |
| int | maxUnsignedValue (int resolution) |
| provides the max value for the indicated resulution | |
| virtual int | nextValue () |
| determines the next scaled value | |
| void | playNextFrame () |
| writes the next frame to the output pins | |
Static Protected Member Functions | |
| static void | pwm_callback (void *ptr) |
| timer callback: write the next frame to the pins | |
Protected Attributes | |
| AudioInfo | actual_info |
| uint32_t | actual_timer_frequency = 0 |
| PWMConfig | audio_config |
| BaseBuffer< uint8_t > * | buffer = nullptr |
| Decimate | decimate |
| int | decimation_factor = 0 |
| uint32_t | frame_count = 0 |
| uint32_t | frame_size = 0 |
| uint32_t | frames_per_second = 0 |
| bool | is_blocking_write = true |
| bool | is_timer_started = false |
| Vector< PinInfo > | pins |
| uint32_t | time_1_sec |
| TimerAlarmRepeating | timer |
| uint32_t | underflow_count = 0 |
| uint32_t | underflow_per_second = 0 |
Audio output to PWM pins for the ESP32. The ESP32 supports up to 16 channels.
|
inline |
|
inlineinherited |
Decimation factor to reduce the sample rate.
Reimplemented in PWMDriverRenesas.
Reimplemented in PWMDriverRenesas.
|
inlineprotectedinherited |
Provides the effective sample rate.
Reimplemented from DriverPWMBase.
|
inlineinherited |
determiens the PWM frequency based on the requested resolution
The requested sampling rate is too hight: we only process half of the samples so we can half the sampling rate
|
inlineinherited |
|
inline |
Implements DriverPWMBase.
provides the max value for the configured resulution
Implements DriverPWMBase.
Provides the max working sample rate.
Reimplemented in PWMDriverRenesas.
provides the max value for the indicated resulution
|
inlineprotectedinherited |
writes the next frame to the output pins
timer callback: write the next frame to the pins
write a pwm value to the indicated channel. The max value depends on the resolution
Implements DriverPWMBase.
|
inlineinherited |
You can assign your own custom buffer impelementation: must be allocated on the heap and will be cleaned up by this class
Setup LED PWM.
Implements DriverPWMBase.
Setup ESP32 timer with callback.
Implements DriverPWMBase.
when we get the first write -> we activate the timer to start with the output of data
Implements DriverPWMBase.
|
inlineinherited |
|
inlineinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |