| 1084 | |
| 1085 | |
| 1086 | void twi_write00() { |
| 1087 | if (TWI_READY != twi_state) return; // blocking test |
| 1088 | if (TWI_BUFFER_LENGTH < ptwv -> length) { |
| 1089 | twi_Finish(1); // end write with error 1 |
| 1090 | return; |
| 1091 | } |
| 1092 | twi_Done = 0x00; // show as working |
| 1093 | twii_SetState(TWI_MTX); // to transmitting |
| 1094 | twii_SetError(0xFF); // to No Error |
| 1095 | twii_InitBuffer(0, ptwv -> length); // pointer and length |
| 1096 | twii_CopyToBuf(ptwv -> data, ptwv -> length); // get the data |
| 1097 | twii_SetSlaRW((ptwv -> address << 1) | TW_WRITE); // write command |
| 1098 | twii_SetStart(); // start the cycle |
| 1099 | fNextInterruptFunction = twi_write01; // next routine |
| 1100 | return twi_write01(); |
| 1101 | } |
| 1102 | |
| 1103 | void twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait) { |
| 1104 | uint8_t i; |
no test coverage detected