| 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; |
no test coverage detected