Audio output to PWM pins for STM32. We use one timer to generate the sample rate and one timer for the PWM signal.
More...
#include <PWMDriverSTM32.h>
Audio output to PWM pins for STM32. We use one timer to generate the sample rate and one timer for the PWM signal.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ PWMDriverSTM32()
◆ audioInfo()
◆ availableForWrite()
| virtual int availableForWrite |
( |
| ) |
|
|
inlinevirtualinherited |
◆ begin()
◆ decimation()
| virtual int decimation |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
◆ defaultConfig()
◆ defaultPWMAudioOutputCallback()
| static void defaultPWMAudioOutputCallback |
( |
void * |
obj | ) |
|
|
inlinestaticprotected |
timer callback: write the next frame to the pins
◆ deleteBuffer()
◆ effectiveOutputSampleRate()
| virtual int effectiveOutputSampleRate |
( |
| ) |
|
|
inlinevirtualinherited |
Provides the effective sample rate.
◆ end()
◆ framesPerSecond()
| uint32_t framesPerSecond |
( |
| ) |
|
|
inlineinherited |
◆ isDecimateActive()
| virtual bool isDecimateActive |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
The requested sampling rate is too hight: we only process half of the samples so we can half the sampling rate
◆ isTimerStarted()
◆ maxChannels()
| virtual int maxChannels |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ maxOutputValue()
| virtual int maxOutputValue |
( |
| ) |
|
|
inlineprotectedvirtual |
provides the max value for the configured resulution
Implements PWMDriverBase.
◆ maxSampleRate()
| virtual int maxSampleRate |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
◆ nextValue()
| virtual int nextValue |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
determines the next scaled value
◆ playNextFrame()
writes the next frame to the output pins
◆ pwmWrite()
| virtual void pwmWrite |
( |
int |
channel, |
|
|
int |
value |
|
) |
| |
|
inlineprotectedvirtual |
write a pwm value to the indicated channel. The max value depends on the resolution
Implements PWMDriverBase.
◆ setBuffer()
You can assign your own custom buffer impelementation: must be allocated on the heap and will be cleaned up by this class
◆ setPWMTimer()
| void setPWMTimer |
( |
HardwareTimer & |
t | ) |
|
|
inline |
Defines the timer which is used to generate the PWM signal.
◆ setupPWM()
| virtual void setupPWM |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ setupTimer()
| virtual void setupTimer |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ startTimer()
| virtual void startTimer |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
when we get the first write -> we activate the timer to start with the output of data
Implements PWMDriverBase.
◆ underflowsPerSecond()
| uint32_t underflowsPerSecond |
( |
| ) |
|
|
inlineinherited |
◆ updateStatistics()
| void updateStatistics |
( |
| ) |
|
|
inlineinherited |
◆ write()
| virtual size_t write |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtualinherited |
◆ actual_info
◆ audio_config
◆ buffer
◆ decimate
◆ decimation_factor
| int decimation_factor = 0 |
|
protectedinherited |
◆ frame_count
◆ frame_size
◆ frames_per_second
| uint32_t frames_per_second = 0 |
|
protectedinherited |
◆ is_blocking_write
| bool is_blocking_write = true |
|
protectedinherited |
◆ is_timer_started
| bool is_timer_started = false |
|
protectedinherited |
◆ max_value
◆ p_pwm_timer
| HardwareTimer* p_pwm_timer = nullptr |
|
protected |
◆ pwm
◆ ticker
◆ time_1_sec
◆ underflow_count
| uint32_t underflow_count = 0 |
|
protectedinherited |
◆ underflow_per_second
| uint32_t underflow_per_second = 0 |
|
protectedinherited |
The documentation for this class was generated from the following file: