|
iPXE
|
I2C interface. More...
Go to the source code of this file.
Data Structures | |
| struct | i2c_device |
| An I2C device. More... | |
| struct | i2c_interface |
| An I2C interface. More... | |
| struct | i2c_bit_basher |
| A bit-bashing I2C interface. More... | |
Macros | |
| #define | I2C_TENBIT_ADDRESS 0x7800 |
| Ten-bit address marker. | |
| #define | I2C_WRITE 0 |
| An I2C write command. | |
| #define | I2C_READ 1 |
| An I2C read command. | |
| #define | I2C_UDELAY 5 |
| Delay required for bit-bashing operation. | |
| #define | I2C_RESET_MAX_CYCLES 32 |
| Maximum number of cycles to use when attempting a bus reset. | |
Enumerations | |
| enum | { I2C_BIT_SCL = 0 , I2C_BIT_SDA } |
| Bit indices used for I2C bit-bashing interface. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static int | i2c_check_presence (struct i2c_interface *i2c, struct i2c_device *i2cdev) |
| Check presence of I2C device. | |
| int | init_i2c_bit_basher (struct i2c_bit_basher *i2cbit, struct bit_basher_operations *bash_op) |
| Initialise I2C bit-bashing interface. | |
| static __always_inline void | init_i2c_eeprom (struct i2c_device *i2cdev, unsigned int dev_addr) |
| Initialise generic I2C EEPROM device. | |
| static __always_inline void | init_at24c11 (struct i2c_device *i2cdev) |
| Initialise Atmel AT24C11. | |
I2C interface.
Definition in file i2c.h.
| #define I2C_TENBIT_ADDRESS 0x7800 |
| #define I2C_WRITE 0 |
An I2C write command.
Definition at line 106 of file i2c.h.
Referenced by i2c_bit_read(), and i2c_bit_write().
| #define I2C_READ 1 |
| #define I2C_UDELAY 5 |
Delay required for bit-bashing operation.
Definition at line 120 of file i2c.h.
Referenced by i2c_delay().
| #define I2C_RESET_MAX_CYCLES 32 |
Maximum number of cycles to use when attempting a bus reset.
Definition at line 123 of file i2c.h.
Referenced by i2c_reset().
| anonymous enum |
Bit indices used for I2C bit-bashing interface.
| Enumerator | |
|---|---|
| I2C_BIT_SCL | Serial clock. |
| I2C_BIT_SDA | Serial data. |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Check presence of I2C device.
| i2c | I2C interface |
| i2cdev | I2C device |
| rc | Return status code |
Checks for the presence of the device on the I2C bus by attempting a zero-length write.
Definition at line 135 of file i2c.h.
References NULL, and i2c_interface::write.
Referenced by exanic_try_init_eeprom(), linda_init_i2c(), and qib7322_init_i2c().
|
extern |
Initialise I2C bit-bashing interface.
| i2cbit | I2C bit-bashing interface |
| bash_op | Bit-basher operations |
Definition at line 387 of file i2c_bit.c.
References assert, i2c_bit_basher::basher, DBGC, i2c_bit_basher::i2c, i2c_bit_read(), i2c_bit_write(), i2c_reset(), NULL, bit_basher::op, rc, bit_basher_operations::read, i2c_interface::read, strerror(), bit_basher_operations::write, and i2c_interface::write.
Referenced by exanic_try_init_eeprom(), falcon_probe_spi(), linda_init_i2c(), and qib7322_init_i2c().
|
inlinestatic |
Initialise generic I2C EEPROM device.
| i2cdev | I2C device |
Definition at line 149 of file i2c.h.
References i2c_device::dev_addr, i2c_device::dev_addr_len, and i2c_device::word_addr_len.
Referenced by exanic_try_init_eeprom(), linda_init_i2c(), and qib7322_init_i2c().
|
inlinestatic |
Initialise Atmel AT24C11.
| i2cdev | I2C device |
Definition at line 161 of file i2c.h.
References i2c_device::dev_addr, i2c_device::dev_addr_len, and i2c_device::word_addr_len.