25 #ifndef ACE_TMI_SIMPLE_TMI_1637_INTERFACE_H
26 #define ACE_TMI_SIMPLE_TMI_1637_INTERFACE_H
84 mDelayMicros(delayMicros)
97 digitalWrite(mClkPin, LOW);
98 digitalWrite(mDioPin, LOW);
142 for (uint8_t i = 0; i < 8; ++i) {
161 uint8_t ack = readAck();
182 for (uint8_t i = 0; i < 8; ++i) {
185 uint8_t bit = dataRead();
188 data |= (bit & 0x1) ? 0x80 : 0x00;
192 uint8_t ack = readAck();
209 uint8_t readAck()
const {
216 uint8_t ack = digitalRead(mDioPin);
223 void bitDelay()
const { delayMicroseconds(mDelayMicros); }
225 void clockHigh()
const { pinMode(mClkPin, INPUT); bitDelay(); }
227 void clockLow()
const { pinMode(mClkPin, OUTPUT); bitDelay(); }
229 void dataHigh()
const { pinMode(mDioPin, INPUT); bitDelay(); }
231 void dataLow()
const { pinMode(mDioPin, OUTPUT); bitDelay(); }
233 uint8_t dataRead()
const {
234 uint8_t data = digitalRead(mDioPin);
240 uint8_t
const mDioPin;
241 uint8_t
const mClkPin;
242 uint8_t
const mDelayMicros;