ESP8266_RTOS_SDK v3.2例程移植I2C驱动OLED
#自己的学习笔记
记录ESP8266使用I2C驱动oled
根据ESP8266_RTOS_SDK v3.2的i2c例程移植
s_tatic int32_t i2c_init()
{
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = I2C_SDA_IO;
conf.sda_pullup_en = 1;
conf.scl_io_num = I2C_SCL_IO;
conf.scl_pullup_en = 1;
conf.clk_stretch_tick = 300; // 300 ticks,时钟长度约210us,可根据实际情况进行调整.
ESP_ERROR_CHECK(i2c_driver_install(I2C_NUM_0, conf.mode)