2019-05-28 09:12:58 +00:00
|
|
|
#ifndef PWM_H
|
|
|
|
#define PWM_H
|
|
|
|
|
|
|
|
#include <avr/io.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
2019-05-28 10:32:31 +00:00
|
|
|
class PWM
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void init(void) const volatile;
|
|
|
|
void setFrequency(uint32_t) const volatile;
|
|
|
|
void setValue(uint8_t) const volatile;
|
|
|
|
uint8_t getTop(void) const volatile;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const static uint16_t PRESCALERS[];
|
|
|
|
const static uint8_t PRESCALER_COUNT;
|
|
|
|
};
|
2019-05-28 09:12:58 +00:00
|
|
|
|
|
|
|
#endif // PWM_H
|