aiie/teensy/teensy-speaker.h

35 lines
662 B
C
Raw Normal View History

2017-02-20 18:55:16 +00:00
#ifndef __TEENSY_SPEAKER_H
#define __TEENSY_SPEAKER_H
#include <AudioStream.h>
2017-02-20 18:55:16 +00:00
#include "physicalspeaker.h"
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();
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);
virtual void beginMixing();
virtual void mixOutput(uint8_t v);
2017-02-20 18:55:16 +00:00
private:
uint8_t mixerValue;
bool toggleState;
2017-02-20 18:55:16 +00:00
};
#endif