diff --git a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts index 424f1dac6b3..52a3eed3269 100644 --- a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts @@ -101,7 +101,7 @@ compatible = "st,vl53l0x"; reg = <0x29>; label = "VL53L0X"; - xshut-gpios = <&gpioc 6 0>; + xshut-gpios = <&gpioc 6 GPIO_ACTIVE_HIGH>; }; }; diff --git a/drivers/sensor/vl53l0x/vl53l0x.c b/drivers/sensor/vl53l0x/vl53l0x.c index 5cf12304631..80d99f1ea36 100644 --- a/drivers/sensor/vl53l0x/vl53l0x.c +++ b/drivers/sensor/vl53l0x/vl53l0x.c @@ -215,14 +215,14 @@ static int vl53l0x_init(struct device *dev) if (gpio_pin_configure(gpio, DT_INST_0_ST_VL53L0X_XSHUT_GPIOS_PIN, - GPIO_DIR_OUT | GPIO_PUD_PULL_UP) < 0) { + GPIO_OUTPUT | GPIO_PULL_UP) < 0) { LOG_ERR("Could not configure GPIO %s %d).", DT_INST_0_ST_VL53L0X_XSHUT_GPIOS_CONTROLLER, DT_INST_0_ST_VL53L0X_XSHUT_GPIOS_PIN); return -EINVAL; } - gpio_pin_write(gpio, DT_INST_0_ST_VL53L0X_XSHUT_GPIOS_PIN, 1); + gpio_pin_set(gpio, DT_INST_0_ST_VL53L0X_XSHUT_GPIOS_PIN, 1); k_sleep(K_MSEC(100)); #endif