2017-02-20 18:55:16 +00:00
|
|
|
#ifndef __TEENSY_SPEAKER_H
|
|
|
|
#define __TEENSY_SPEAKER_H
|
|
|
|
|
2020-07-13 02:13:33 +00:00
|
|
|
#include <AudioStream.h>
|
2017-02-20 18:55:16 +00:00
|
|
|
#include "physicalspeaker.h"
|
|
|
|
|
2020-07-13 02:13:33 +00:00
|
|
|
class TeensyAudio : public AudioStream {
|
|
|
|
public:
|
|
|
|
TeensyAudio(void) : AudioStream(0, NULL) {}
|
|
|
|
|
|
|
|
virtual void update(void);
|
|
|
|
};
|
|
|
|
|
2017-02-20 18:55:16 +00:00
|
|
|
class TeensySpeaker : public PhysicalSpeaker {
|
|
|
|
public:
|
2020-07-10 00:31:51 +00:00
|
|
|
TeensySpeaker(uint8_t sda, uint8_t scl);
|
2017-02-20 18:55:16 +00:00
|
|
|
virtual ~TeensySpeaker();
|
|
|
|
|
2020-07-10 00:31:51 +00:00
|
|
|
virtual void begin();
|
2019-02-21 03:06:55 +00:00
|
|
|
|
2020-08-02 13:06:15 +00:00
|
|
|
virtual void toggle(int64_t c);
|
2020-07-10 00:31:51 +00:00
|
|
|
virtual void maintainSpeaker();
|
2020-08-02 13:06:15 +00:00
|
|
|
virtual void maintainSpeaker(int64_t c, uint64_t microseconds);
|
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:
|
|
|
|
|
2020-08-02 14:02:35 +00:00
|
|
|
uint8_t mixerValue;
|
|
|
|
bool toggleState;
|
2017-02-20 18:55:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|