2017-02-20 18:55:16 +00:00
|
|
|
#ifndef __TEENSY_SPEAKER_H
|
|
|
|
#define __TEENSY_SPEAKER_H
|
|
|
|
|
|
|
|
#include "physicalspeaker.h"
|
|
|
|
|
|
|
|
class TeensySpeaker : public PhysicalSpeaker {
|
|
|
|
public:
|
|
|
|
TeensySpeaker(uint8_t pinNum);
|
|
|
|
virtual ~TeensySpeaker();
|
|
|
|
|
2017-12-31 22:21:34 +00:00
|
|
|
virtual void toggle(uint32_t c);
|
2018-01-03 01:28:47 +00:00
|
|
|
virtual void maintainSpeaker(uint32_t c, uint64_t runtimeInMicros);
|
2017-02-26 16:00:41 +00:00
|
|
|
|
|
|
|
virtual void beginMixing();
|
|
|
|
virtual void mixOutput(uint8_t v);
|
2017-02-20 18:55:16 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t speakerPin;
|
|
|
|
|
2017-02-26 16:00:41 +00:00
|
|
|
bool toggleState;
|
2017-02-20 18:55:16 +00:00
|
|
|
|
2017-02-26 16:00:41 +00:00
|
|
|
uint32_t mixerValue;
|
|
|
|
uint8_t numMixed;
|
2017-02-20 18:55:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|