Thanks for your help so far, but now i got another problem.
My setup code looks like following
Code: Select all
i2c_port_t i2c_master_port = I2C_NUM_1;
i2c_config_t conf={0};
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = 21;
conf.sda_pullup_en = GPIO_PULLUP_DISABLE;
conf.scl_io_num = 22;
conf.scl_pullup_en = GPIO_PULLUP_DISABLE;
conf.master.clk_speed = 400000;
ESP_ERROR_CHECK(i2c_param_config(i2c_master_port, &conf));
ESP_ERROR_CHECK(i2c_driver_install(i2c_master_port, conf.mode, 0, 0, 0));
dev.i2c_address = 0x29;
dev.i2c_port_num = I2C_NUM_1;
printf ("Call of VL53L0X_DataInit\n");
error = VL53L0X_DataInit(&dev); // Data initialization
print_pal_error(error);
print_pal_error() gives me the following error:
API Status: -20 : Control Interface Error
I looked the error up and i think it comes from VL53L0X_WriteMulti() function within i2c_master_cmd_begin() is invoked and which returns the esp error ESP_ERR_INVALID_STATE.
Is something wrong with my i2c setup?
Thanks for your help.