|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
I2C bus master driver. More...
Data Structures | |
| struct | ove_i2c_cfg |
| I2C bus configuration descriptor. More... | |
Enumerations | |
| enum | ove_i2c_speed_t { OVE_I2C_SPEED_STANDARD = 0 , OVE_I2C_SPEED_FAST = 1 , OVE_I2C_SPEED_FAST_PLUS = 2 } |
| I2C bus speed grade. More... | |
Functions | |
| static int | ove_i2c_create (ove_i2c_t *i, const struct ove_i2c_cfg *c) |
| static void | ove_i2c_destroy (ove_i2c_t i) |
| static int | ove_i2c_write (ove_i2c_t i, uint16_t a, const void *d, size_t l, uint32_t t) |
| static int | ove_i2c_read (ove_i2c_t i, uint16_t a, void *b, size_t l, uint32_t t) |
| static int | ove_i2c_write_read (ove_i2c_t i, uint16_t a, const void *tx, size_t tl, void *rx, size_t rl, uint32_t t) |
| static int | ove_i2c_reg_write (ove_i2c_t i, uint16_t a, uint8_t r, const void *d, size_t l, uint32_t t) |
| static int | ove_i2c_reg_read (ove_i2c_t i, uint16_t a, uint8_t r, void *b, size_t l, uint32_t t) |
| static int | ove_i2c_probe (ove_i2c_t i, uint16_t a, uint32_t t) |
I2C bus master driver.
Provides a portable I2C master API with configurable bus speed, thread-safe bus locking, register-level convenience functions, and device probing.
Two allocation strategies are supported:
_create() / _destroy() — unified API that works in both heap and zero-heap mode. In zero-heap mode these are macros that generate per-call-site static storage._init() / _deinit() — explicit storage control with caller-supplied buffers. Use when creating objects in loops, arrays, or structs.All addresses are 7-bit (e.g. 0x50 for a typical EEPROM). The HAL shifts left and adds the R/W bit internally.
CONFIG_OVE_I2C. When the option is disabled every function is replaced by a no-op stub that returns OVE_ERR_NOT_SUPPORTED. | enum ove_i2c_speed_t |