3uint8_t
i2c_open(i2c_master_bus_handle_t *bus_handle, i2c_master_dev_handle_t *dev_handle,
const uint8_t address) {
4 i2c_master_bus_config_t bus_config = {
8 .clk_source = I2C_CLK_SRC_DEFAULT,
9 .glitch_ignore_cnt = 7,
10 .flags.enable_internal_pullup =
true,
12 ESP_ERROR_CHECK(i2c_new_master_bus(&bus_config, bus_handle));
14 i2c_device_config_t dev_config = {
16 .device_address = address,
19 ESP_ERROR_CHECK(i2c_master_bus_add_device(*bus_handle, &dev_config, dev_handle));
uint8_t i2c_open(i2c_master_bus_handle_t *bus_handle, i2c_master_dev_handle_t *dev_handle, const uint8_t address)
initializes the i2c communications and points the handles to correctly initialized variables on the h...