This library contains functions for communicating to I2C devices via user specified port pins.
|
Defines |
| #define | TINI_I2C_VERSION 1 |
| #define | I2C_SDA P3_4 |
| #define | I2C_SCL P3_5 |
| #define | I2C_ENABLE_SCL_WAIT_FOR_SLOW_SLAVES 0 |
| #define | I2C_MAXIMUM_SCL_WAITCOUNT 10000 |
| #define | I2C_DELAY_LOOP_COUNT 0 |
Functions |
|
int | i2c_version () |
| | Return the library version.
|
|
void | i2c_delay (void) |
| | Delay function.
|
|
void | i2c_start (void) |
| | Performs an I2C start condition.
|
| void | i2c_bit (unsigned char singlebit) |
| | Performs an I2C bit write.
|
| unsigned char | i2c_readbit (void) |
| | Performs an I2C bit read.
|
|
void | i2c_stop (void) |
| | Performs an I2C stop condition.
|
| unsigned char | i2c_readbyte (unsigned char doACK) |
| | Performs an I2C byte read.
|
| unsigned char | i2c_writebyte (unsigned char singlebyte) |
| | Performs an I2C byte write.
|
| unsigned char | i2c_select (unsigned char address) |
| | Perform I2C start, address selection.
|
| unsigned char | i2c_writeblock (unsigned char address, unsigned char *barr, int length) |
| | Perform I2C start, address selection, write specified bytes and I2C stop.
|
| unsigned char | i2c_readblock (unsigned char address, unsigned char *barr, int length) |
| | Perform I2C start, address selection, read specified number of bytes and I2C stop.
|
| unsigned char | i2c_writereadblock (unsigned char address, unsigned char *barr1, int length1, unsigned char *barr2, int length2) |
| | Perform I2C start, address selection, write specified bytes, I2C start, address slection, read bytes and I2C stop.
|