|
| void | FlxCard::i2c_read (const char *device_str, u_char reg_addr, u_char *value, int nbytes=1) |
| void | FlxCard::i2c_write (const char *device_str, u_char reg_addr, u_char data) |
|
void | FlxCard::i2c_write (const char *device_str, u_char reg_addr, u_char *data, int nbytes) |
| void | FlxCard::i2c_write_byte (u_char dev_addr, u_char byte) |
| void | FlxCard::i2c_write_byte (u_char dev_addr, u_char reg_addr, u_char byte) |
| u_char | FlxCard::i2c_read_byte (u_char dev_addr, u_char reg_addr) |
| bool | FlxCard::i2c_flush (u_int *count=0) |
| void | FlxCard::i2c_write_bytes (uint8_t dev_addr, uint8_t reg_addr, int nbytes, uint8_t *bytes) |
|
void | FlxCard::i2c_read_bytes (uint8_t dev_addr, uint8_t reg_addr, int nbytes, uint8_t *bytes) |
A set of functions that interact with the onboard I2C bus.
| void FlxCard::i2c_read |
( |
const char * | device_str, |
|
|
u_char | reg_addr, |
|
|
u_char * | value, |
|
|
int | nbytes = 1 ) |
These methods read and write 8-bit data words from/to a named I2C device.
Errors In case of an error, an exception is thrown.
- Parameters
-
| *device_str | A string of the form “p1:p2:p3:addr”: see table below for details. Alternatively the string can be the name of the I2C endpoint device You must use the predefined names: find out by running "flx-i2c list" |
| reg_addr | The address of the register within the device |
| data | The data that is to be written to the register |
| value | A pointer to a value that will be filled with the data read from the I2C device |
Description of the sub-parameters in parameter device_str:
| Sub-parameter | Description |
| p1 | The port number on the primary I2C switch to select; run "flx-i2c list" to find out where the I2C device you want to access, is located in the I2C tree |
| p2 | In case of cascaded switches the secondary switch's port number to select |
| p3 | In case of cascaded switches this is the third switch's port number |
| addr | The I2C address of the endpoint device behind the switch(es) |
As an alternative to a string of the format defined above, parameter device_str can a symbolic name of an I2C endpoint device; get a listing of all available I2C devices on all platforms by running "flx-i2c list all".