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

Function twi_read00

Sming/Libraries/I2Cdev/I2Cdev.cpp:1106–1117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1104 }
1105
1106 void twi_read00() {
1107 if (TWI_READY != twi_state) return; // blocking test
1108 if (TWI_BUFFER_LENGTH < ptwv -> length) twi_Finish(0); // error return
1109 twi_Done = 0x00; // show as working
1110 twii_SetState(TWI_MRX); // reading
1111 twii_SetError(0xFF); // reset error
1112 twii_InitBuffer(0, ptwv -> length - 1); // init to one less than length
1113 twii_SetSlaRW((ptwv -> address << 1) | TW_READ); // read command
1114 twii_SetStart(); // start cycle
1115 fNextInterruptFunction = twi_read01;
1116 return twi_read01();
1117 }
1118
1119 void twi_readFrom(uint8_t address, uint8_t* data, uint8_t length) {
1120 uint8_t i;

Callers 1

twi_readFromFunction · 0.85

Calls 7

twi_FinishFunction · 0.85
twii_SetStateFunction · 0.85
twii_SetErrorFunction · 0.85
twii_InitBufferFunction · 0.85
twii_SetSlaRWFunction · 0.85
twii_SetStartFunction · 0.85
twi_read01Function · 0.85

Tested by

no test coverage detected