|
arduino-audio-tools
|
Audio output to PWM pins for Zephyr RTOS. More...
#include <PWMDriverZephyr.h>
Public Member Functions | |
| PWMDriverZephyr ()=default | |
| PWMConfig & | audioInfo () |
| virtual int | availableForWrite () |
| bool | begin (PWMConfig cfg) |
| virtual PWMConfig | defaultConfig () |
| virtual int | effectiveOutputSampleRate () |
| Provides the effective sample rate. | |
| virtual void | end () override |
| Ends PWM output. | |
| uint32_t | framesPerSecond () |
| bool | isTimerStarted () |
| void | setBuffer (BaseBuffer< uint8_t > *buffer) |
| 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 | maxChannels () override |
| Maximum supported PWM channels. | |
| virtual int | maxOutputValue () override |
| Maximum output value (resolution-dependent) | |
| 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 | |
| virtual void | pwmWrite (int channel, int value) override |
| Write PWM value to a specific channel. | |
| virtual void | setupPWM () override |
| Setup PWM pins and devices. | |
| virtual void | setupTimer () override |
| Configure timer parameters (called after setupPWM) | |
| virtual void | startTimer () override |
| Start the timer for periodic playback. | |
Static Protected Member Functions | |
| static void | defaultPWMAudioOutputCallback (void *obj) |
| Timer callback: invoked periodically to write the next audio frame. | |
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 | period_ns = 0 |
| uint32_t | time_1_sec |
| AudioTimer | timer |
| uint32_t | underflow_count = 0 |
| uint32_t | underflow_per_second = 0 |
Audio output to PWM pins for Zephyr RTOS.
Supports PWM audio output on Zephyr targets using the native PWM driver API. Manages multiple PWM channels with configurable frequency and resolution.
Characteristics:
|
default |
|
inlineinherited |
Decimation factor to reduce the sample rate.
Reimplemented in PWMDriverRenesas.
Reimplemented in PWMDriverRenesas.
Timer callback: invoked periodically to write the next audio frame.
|
inlineprotectedinherited |
Provides the effective sample rate.
Ends PWM output.
Reimplemented from PWMDriverBase.
|
inlineinherited |
The requested sampling rate is too hight: we only process half of the samples so we can half the sampling rate
|
inlineinherited |
Maximum supported PWM channels.
Implements PWMDriverBase.
Maximum output value (resolution-dependent)
Implements PWMDriverBase.
Provides the max working sample rate.
Reimplemented in PWMDriverRenesas.
|
inlineprotectedinherited |
writes the next frame to the output pins
Write PWM value to a specific channel.
Implements PWMDriverBase.
|
inlineinherited |
You can assign your own custom buffer impelementation: must be allocated on the heap and will be cleaned up by this class
Setup PWM pins and devices.
Implements PWMDriverBase.
Configure timer parameters (called after setupPWM)
Implements PWMDriverBase.
Start the timer for periodic playback.
Implements PWMDriverBase.
|
inlineinherited |
|
inlineinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |