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

Function twi_write00

Sming/Libraries/I2Cdev/I2Cdev.cpp:1069–1084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067
1068
1069 void twi_write00() {
1070 if (TWI_READY != twi_state) return; // blocking test
1071 if (TWI_BUFFER_LENGTH < ptwv -> length) {
1072 twi_Finish(1); // end write with error 1
1073 return;
1074 }
1075 twi_Done = 0x00; // show as working
1076 twii_SetState(TWI_MTX); // to transmitting
1077 twii_SetError(0xFF); // to No Error
1078 twii_InitBuffer(0, ptwv -> length); // pointer and length
1079 twii_CopyToBuf(ptwv -> data, ptwv -> length); // get the data
1080 twii_SetSlaRW((ptwv -> address << 1) | TW_WRITE); // write command
1081 twii_SetStart(); // start the cycle
1082 fNextInterruptFunction = twi_write01; // next routine
1083 return twi_write01();
1084 }
1085
1086 void twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait) {
1087 uint8_t i;

Callers 1

twi_writeToFunction · 0.85

Calls 8

twi_FinishFunction · 0.85
twii_SetStateFunction · 0.85
twii_SetErrorFunction · 0.85
twii_InitBufferFunction · 0.85
twii_CopyToBufFunction · 0.85
twii_SetSlaRWFunction · 0.85
twii_SetStartFunction · 0.85
twi_write01Function · 0.85

Tested by

no test coverage detected