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