Experimental: Audio output to PWM pins for the AVR. The AVR supports only up to 2 channels.  
 More...
#include <PWMDriverAVR.h>
 | 
| 
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  | logConfig () | 
|   | 
| virtual int  | maxChannels () | 
|   | 
| virtual void  | pwmWrite (int channel, int value) | 
|   | 
| void  | setBuffer (BaseBuffer< uint8_t > *buffer) | 
|   | 
| 
void  | setupPin (int pin) | 
|   | 
| void  | setupPWM () | 
|   | Setup LED PWM.  
  | 
|   | 
| void  | setupTimer () | 
|   | 
| void  | startTimer () | 
|   | 
| 
uint32_t  | underflowsPerSecond () | 
|   | 
| 
void  | updateStatistics () | 
|   | 
| 
virtual size_t  | write (const uint8_t *data, size_t len) | 
|   | 
 | 
| virtual int  | decimation () | 
|   | Decimation factor to reduce the sample rate.  
  | 
|   | 
| 
void  | deleteBuffer () | 
|   | 
| virtual bool  | isDecimateActive () | 
|   | 
| virtual int  | maxOutputValue () | 
|   | 
| 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 
  | 
|   | 
 | 
| 
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 | 
|   | 
| 
int  | pins [2] = {3, 11} | 
|   | 
| 
uint32_t  | time_1_sec | 
|   | 
| 
uint32_t  | underflow_count = 0 | 
|   | 
| 
uint32_t  | underflow_per_second = 0 | 
|   | 
Experimental: Audio output to PWM pins for the AVR. The AVR supports only up to 2 channels. 
- Author
 - Phil Schatzmann 
 
- Copyright
 - GPLv3 
 
 
◆ decimation()
  
  
      
        
          | virtual int decimation  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineprotectedvirtualinherited   | 
  
 
 
◆ end()
◆ 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 
 
 
◆ maxChannels()
  
  
      
        
          | virtual int maxChannels  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinevirtual   | 
  
 
 
◆ maxOutputValue()
  
  
      
        
          | virtual int maxOutputValue  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineprotectedvirtual   | 
  
 
 
◆ maxSampleRate()
  
  
      
        
          | virtual int maxSampleRate  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineprotectedvirtualinherited   | 
  
 
 
◆ pwmWrite()
  
  
      
        
          | virtual void pwmWrite  | 
          ( | 
          int  | 
          channel,  | 
         
        
           | 
           | 
          int  | 
          value  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlinevirtual   | 
  
 
 
◆ setBuffer()
You can assign your own custom buffer impelementation: must be allocated on the heap and will be cleaned up by this class 
 
 
◆ setupPWM()
◆ setupTimer()
◆ startTimer()
◆ defaultPWMAudioOutputCallback
  
  
      
        
          | void defaultPWMAudioOutputCallback  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
friend   | 
  
 
separate method that can be defined as friend so that we can access protected information 
 
 
The documentation for this class was generated from the following file: