oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
I2C

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)
 

Detailed Description

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:

All addresses are 7-bit (e.g. 0x50 for a typical EEPROM). The HAL shifts left and adds the R/W bit internally.

Note
Requires CONFIG_OVE_I2C. When the option is disabled every function is replaced by a no-op stub that returns OVE_ERR_NOT_SUPPORTED.

Enumeration Type Documentation

◆ ove_i2c_speed_t

I2C bus speed grade.

Enumerator
OVE_I2C_SPEED_STANDARD 

100 kHz.

OVE_I2C_SPEED_FAST 

400 kHz.

OVE_I2C_SPEED_FAST_PLUS 

1 MHz.