25 #ifndef ACE_WIRE_SIMPLE_WIRE_INTERFACE_H
26 #define ACE_WIRE_SIMPLE_WIRE_INTERFACE_H
59 uint8_t dataPin, uint8_t clockPin, uint8_t delayMicros
63 mDelayMicros(delayMicros)
75 digitalWrite(mClockPin, LOW);
76 digitalWrite(mDataPin, LOW);
101 uint8_t effectiveAddr = (addr << 1) | 0x00;
102 write(effectiveAddr);
124 for (uint8_t i = 0; i < 8; ++i) {
143 uint8_t readAck()
const {
146 uint8_t ack = digitalRead(mDataPin);
154 void bitDelay()
const { delayMicroseconds(mDelayMicros); }
156 void clockHigh()
const { pinMode(mClockPin, INPUT); bitDelay(); }
158 void clockLow()
const { pinMode(mClockPin, OUTPUT); bitDelay(); }
160 void dataHigh()
const { pinMode(mDataPin, INPUT); bitDelay(); }
162 void dataLow()
const { pinMode(mDataPin, OUTPUT); bitDelay(); }
165 uint8_t
const mDataPin;
166 uint8_t
const mClockPin;
167 uint8_t
const mDelayMicros;