TB2026-YDS Firmware
Loading...
Searching...
No Matches

Shared I2C master bus (expander, DAC control, fuel gauge). More...

Collaboration diagram for I2C bus:

Macros

#define I2C_BUS_FREQ_HZ   (400 * 1000)

Functions

esp_err_t i2c_bus_init (i2c_master_bus_handle_t *out_handle)
 Initialize the shared I2C master bus on the board's SDA/SCL pins.
i2c_master_bus_handle_t i2c_bus_handle (void)
 The shared bus handle cached by i2c_bus_init().
void i2c_bus_scan (i2c_master_bus_handle_t bus)
 Probe 0x08..0x77 and log every ACKing address. Bring-up helper.

Detailed Description

Shared I2C master bus (expander, DAC control, fuel gauge).

Macro Definition Documentation

◆ I2C_BUS_FREQ_HZ

#define I2C_BUS_FREQ_HZ   (400 * 1000)

Per-device SCL speed, set when drivers add themselves to the bus.

Function Documentation

◆ i2c_bus_handle()

i2c_master_bus_handle_t i2c_bus_handle ( void )

The shared bus handle cached by i2c_bus_init().

Lets a consumer that didn't run init (e.g. the stats diagnostics page probing device presence) reach the bus without threading the handle through every layer.

Returns
The master bus handle, or NULL if i2c_bus_init() has not succeeded yet.

◆ i2c_bus_init()

esp_err_t i2c_bus_init ( i2c_master_bus_handle_t * out_handle)

Initialize the shared I2C master bus on the board's SDA/SCL pins.

Parameters
[out]out_handleReceives the master bus handle.
Returns
ESP_OK on success, or the underlying driver error.

◆ i2c_bus_scan()

void i2c_bus_scan ( i2c_master_bus_handle_t bus)

Probe 0x08..0x77 and log every ACKing address. Bring-up helper.

Parameters
busMaster bus handle from i2c_bus_init().