This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup i2c master | |
static esp_err_t i2c_master_init() | |
{ | |
i2c_config_t conf; | |
conf.mode = I2C_MODE_MASTER; | |
conf.sda_io_num = I2C_SDA_PIN; | |
conf.scl_io_num = I2C_SCL_PIN; | |
conf.sda_pullup_en = GPIO_PULLUP_ENABLE; | |
conf.scl_pullup_en = GPIO_PULLUP_ENABLE; | |
conf.master.clk_speed = I2C_MASTER_FREQ_HZ; |