diff --git a/docs/i2c.md b/docs/i2c.md index 413087e..2567032 100644 --- a/docs/i2c.md +++ b/docs/i2c.md @@ -138,14 +138,14 @@ The periphery I2C functions return 0 on success or one of the negative error cod The libc errno of the failure in an underlying libc library call can be obtained with the `i2c_errno()` helper function. A human readable error message can be obtained with the `i2c_errmsg()` helper function. -| Error Code | Description | -|---------------------------|---------------------------------------| -| `I2C_ERROR_ARG` | Invalid arguments | -| `I2C_ERROR_OPEN` | Opening I2C device | -| `I2C_ERROR_QUERY_SUPPORT` | Querying I2C support on I2C device | -| `I2C_ERROR_NOT_SUPPORTED` | I2C not supported on this device | -| `I2C_ERROR_TRANSFER` | I2C transfer | -| `I2C_ERROR_CLOSE` | Closing I2C device | +| Error Code | Description | +|---------------------------|-----------------------------------| +| `I2C_ERROR_ARG` | Invalid arguments | +| `I2C_ERROR_OPEN` | Opening I2C device | +| `I2C_ERROR_QUERY` | Querying I2C device attribtues | +| `I2C_ERROR_NOT_SUPPORTED` | I2C not supported on this device | +| `I2C_ERROR_TRANSFER` | I2C transfer | +| `I2C_ERROR_CLOSE` | Closing I2C device | ### EXAMPLE diff --git a/src/i2c.c b/src/i2c.c index dbdff65..89f571f 100644 --- a/src/i2c.c +++ b/src/i2c.c @@ -71,7 +71,7 @@ int i2c_open(i2c_t *i2c, const char *path) { if (ioctl(i2c->fd, I2C_FUNCS, &supported_funcs) < 0) { int errsv = errno; close(i2c->fd); - return _i2c_error(i2c, I2C_ERROR_QUERY_SUPPORT, errsv, "Querying I2C_FUNCS"); + return _i2c_error(i2c, I2C_ERROR_QUERY, errsv, "Querying I2C functions"); } if (!(supported_funcs & I2C_FUNC_I2C)) { diff --git a/src/i2c.h b/src/i2c.h index 7830d4b..7383f5e 100644 --- a/src/i2c.h +++ b/src/i2c.h @@ -21,8 +21,8 @@ extern "C" { enum i2c_error_code { I2C_ERROR_ARG = -1, /* Invalid arguments */ I2C_ERROR_OPEN = -2, /* Opening I2C device */ - I2C_ERROR_QUERY_SUPPORT = -3, /* Querying I2C support on I2C device */ - I2C_ERROR_NOT_SUPPORTED = -4, /* I2C not suppoted on this device */ + I2C_ERROR_QUERY = -3, /* Querying I2C device attributes */ + I2C_ERROR_NOT_SUPPORTED = -4, /* I2C not supported on this device */ I2C_ERROR_TRANSFER = -5, /* I2C transfer */ I2C_ERROR_CLOSE = -6, /* Closing I2C device */ };