Data Structures | |
struct | i2c_address |
Defines | |
#define | I2C_ARBITRATION_LOST 7 |
#define | I2C_BUSY 1 |
#define | I2C_CONT_NACK_ON_ADDR 1 |
#define | I2C_CONT_NACK_ON_DATA 2 |
#define | I2C_DEVICE_NOT_PRESENT 6 |
#define | I2C_ERR 2 |
#define | I2C_INIT_ERROR 10 |
#define | I2C_MAX_RETRY 11 |
#define | I2C_NACK_ON_ADDRESS 5 |
#define | I2C_NACK_ON_DATA 4 |
#define | I2C_NO_DATA 3 |
#define | I2C_NOBUS 12 |
#define | I2C_SLAVE_ERROR 9 |
#define | I2C_TIME_OUT 8 |
Typedefs | |
typedef i2c_address | i2c_addr_t |
Functions | |
int32_t | i2c_init (u_int16_t mode) |
int32_t | i2c_init_clock (u_int16_t mode, u_int8_t frequency) |
initialse and reset the i2c controller and set i2c clock | |
void | i2c_perror (int rc, char *msg) |
print and i2c error message | |
int32_t | i2c_read_rbt (u_int32_t addr, u_int8_t *buf, u_int32_t count, u_int32_t *bytecount, u_int32_t *flag) |
int32_t | i2c_scan (u_int32_t addr, u_int8_t dir) |
scan for an i2c device | |
int32_t | i2c_write_rbt (u_int32_t addr, u_int8_t *buf, u_int32_t count, u_int32_t *bytecount, u_int32_t *flag) |
int32_t | i2c_writeread_rbt (u_int32_t addr, u_int8_t *wbuf, u_int32_t wcount, u_int8_t *rbuf, u_int32_t rcount, u_int32_t *flag) |
write to i2c device issued a repeated start condition then read |
|
err: Device not present |
|
transfer ended No Errors |
|
ignore NACK from slave on address byte |
|
ignore NACK from slave on data byte |
|
err: No ack on address |
|
transfer busy |
|
err: Slave mode error |
|
err: Initialization (not done) |
|
err: No ack on data |
|
err: No data in block |
|
err: general error |
|
exceeded maximal number of retries |
|
err: Time out occurred |
|
err: Arbitration lost |
|
full i2c address with channel and bus address |
|
initialise and reset the i2c controller
|
|
initialse and reset the i2c controller and set i2c clock
|
|
print and i2c error message This is an emulation of the standard perror function. Since there is no global i2c error variable (this is maybe a design flaw), the status value must be passed.
|
|
read bytes from i2c
|
|
scan for an i2c device
|
|
write bytes to i2c
|
|
write to i2c device issued a repeated start condition then read
|