-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Description
/** Write to an I2C slave
*
* Performs a complete write transaction. The bottom bit of
* the address is forced to 0 to indicate a write.
*
* @param address 8-bit I2C slave address [ addr | 0 ]
* @param data Pointer to the byte-array data to send
* @param length Number of bytes to send
* @param repeated Repeated start, true - do not send stop at end
* default value is false.
*
* @returns
* 0 on success (ack),
* nonzero on failure (nack)
*/
int write(int address, const char *data, int length, bool repeated = false);
int I2C::write(int data) {
lock();
int ret = i2c_byte_write(&_i2c, data);
unlock();
return ret;
}
Then in i2c_byte_write it always returns 1;
ACK should be checked and the result should be returned
Issue request type
[ ] Question
[ ] Enhancement
[x] Bug