| 807 | } |
| 808 | |
| 809 | byte Fastwire::write(byte value) { |
| 810 | byte twst; |
| 811 | //Serial.println(value, HEX); |
| 812 | TWDR = value; // send data |
| 813 | TWCR = (1 << TWINT) | (1 << TWEN); |
| 814 | if (!waitInt()) return 1; |
| 815 | twst = TWSR & 0xF8; |
| 816 | if (twst != TW_MT_DATA_ACK) return 2; |
| 817 | return 0; |
| 818 | } |
| 819 | |
| 820 | byte Fastwire::readBuf(byte device, byte address, byte *data, byte num) { |
| 821 | byte twst, retry; |
no outgoing calls
no test coverage detected