Skip to content

Commit

Permalink
Add some additional I2C error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
multiplemonomials committed Nov 28, 2022
1 parent 63fbaaf commit a850734
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hal/include/hal/i2c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ typedef struct i2c_s i2c_t;

enum {
I2C_ERROR_NO_SLAVE = -1,
I2C_ERROR_BUS_BUSY = -2
I2C_ERROR_BUS_BUSY = -2,
I2C_ERROR_INVALID_USAGE = -3 ///< Invalid usage of the I2C API, e.g. by mixing single-byte and transactional function calls.
};

typedef struct {
Expand Down Expand Up @@ -255,7 +256,7 @@ int i2c_byte_read(i2c_t *obj, int last);
*
* @param obj The I2C object
* @param data Byte to be written
* @return 0 if NAK was received, 1 if ACK was received, 2 for timeout.
* @return 0 if NAK was received, 1 if ACK was received, 2 for timeout, or 3 for other error.
*/
int i2c_byte_write(i2c_t *obj, int data);

Expand Down

0 comments on commit a850734

Please sign in to comment.