diff --git a/src/drivers/vl53l5cx/include/platform.h b/src/drivers/vl53l5cx/include/platform.h index d09197068..a52321ac3 100644 --- a/src/drivers/vl53l5cx/include/platform.h +++ b/src/drivers/vl53l5cx/include/platform.h @@ -48,6 +48,7 @@ typedef struct { } VL53L5CX_Platform; void vl53l5cx_reset(VL53L5CX_Platform *platform); +void vl53l5cx_shutdown(VL53L5CX_Platform *platform); void vl53l5cx_swap(uint8_t *buf, uint16_t size); uint8_t vl53l5cx_read(VL53L5CX_Platform *platform, uint16_t addr, uint8_t *buf, uint32_t size); uint8_t vl53l5cx_write(VL53L5CX_Platform *platform, uint16_t addr, uint8_t *buf, uint32_t size); diff --git a/src/drivers/vl53l5cx/src/platform.c b/src/drivers/vl53l5cx/src/platform.c index bb2a388e4..ee1399e1a 100644 --- a/src/drivers/vl53l5cx/src/platform.c +++ b/src/drivers/vl53l5cx/src/platform.c @@ -47,6 +47,13 @@ void vl53l5cx_reset(VL53L5CX_Platform *platform) { #endif } +void vl53l5cx_shutdown(VL53L5CX_Platform *platform) { + #if defined(OMV_TOF_POWER_PIN) + omv_gpio_config(OMV_TOF_POWER_PIN, OMV_GPIO_MODE_OUTPUT, OMV_GPIO_PULL_NONE, OMV_GPIO_SPEED_LOW, -1); + omv_gpio_write(OMV_TOF_POWER_PIN, 0); + #endif +} + void vl53l5cx_swap(uint8_t *buf, uint16_t size) { for (size_t i=0; i