28 lines
415 B
C++
28 lines
415 B
C++
#ifndef TCS_BUS_H_
|
|
#define TCS_BUS_H_ 1
|
|
#include <cstdint>
|
|
|
|
class TcsBus {
|
|
public:
|
|
TcsBus(int sendPin, int receivePin);
|
|
void begin();
|
|
void TimeBase();
|
|
|
|
private:
|
|
int sendPin;
|
|
int receivePin;
|
|
|
|
enum class SamplingState
|
|
{
|
|
IDLE = 0,
|
|
RECEIVE = 1,
|
|
TRANSMIT = 2,
|
|
};
|
|
|
|
SamplingState state;
|
|
uint16_t rxBits;
|
|
uint8_t oversamplingStep;
|
|
bool lastSample;
|
|
};
|
|
|
|
#endif //TCS_BUS_H_
|