MCPcopy Create free account
hub / github.com/SmingHub/Sming / write

Method write

Sming/Libraries/I2Cdev/I2Cdev.cpp:809–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 4

readBytesMethod · 0.45
readWordsMethod · 0.45
writeBytesMethod · 0.45
writeWordsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected