|
arduino-audio-tools
|
Base Class for all PWM drivers. More...
#include <PWMDriverBase.h>
Public Member Functions | |
| DriverPWMBase ()=default | |
| virtual | ~DriverPWMBase () |
| 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 () |
| virtual int | maxChannels ()=0 |
| virtual int | maxOutputValue ()=0 |
| virtual void | pwmWrite (int channel, int value)=0 |
| void | setBuffer (BaseBuffer< uint8_t > *buffer) |
| virtual void | setupPWM ()=0 |
| virtual void | setupTimer ()=0 |
| virtual void | startTimer ()=0 |
| 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 () |
| virtual bool | isDecimateActive () |
| virtual int | maxSampleRate () |
| Provides the max working sample rate. | |
| virtual int | nextValue () |
| determines the next scaled value | |
| void | playNextFrame () |
| writes the next frame to the output pins | |
Protected Attributes | |
| AudioInfo | actual_info |
| 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 |
| uint32_t | time_1_sec |
| uint32_t | underflow_count = 0 |
| uint32_t | underflow_per_second = 0 |
Base Class for all PWM drivers.
|
default |
|
inlinevirtual |
|
inline |
Decimation factor to reduce the sample rate.
Reimplemented in PWMDriverRenesas.
Reimplemented in PWMDriverRenesas.
|
inlineprotected |
Reimplemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
|
inline |
The requested sampling rate is too hight: we only process half of the samples so we can half the sampling rate
|
inline |
Implemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
Implemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
Provides the max working sample rate.
Reimplemented in PWMDriverRenesas.
|
inlineprotected |
writes the next frame to the output pins
Implemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
|
inline |
You can assign your own custom buffer impelementation: must be allocated on the heap and will be cleaned up by this class
Implemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
Implemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
Implemented in PWMComplementaryDriverESP32, PWMDriverAVR, PWMDriverESP32, PWMDriverMBED, PWMDriverRenesas, and PWMDriverSTM32.
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |