mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
drivers/vl53l5cx: Add shutdown function.
This commit is contained in:
parent
2fec88070f
commit
c743cab6a3
@ -48,6 +48,7 @@ typedef struct {
|
|||||||
} VL53L5CX_Platform;
|
} VL53L5CX_Platform;
|
||||||
|
|
||||||
void vl53l5cx_reset(VL53L5CX_Platform *platform);
|
void vl53l5cx_reset(VL53L5CX_Platform *platform);
|
||||||
|
void vl53l5cx_shutdown(VL53L5CX_Platform *platform);
|
||||||
void vl53l5cx_swap(uint8_t *buf, uint16_t size);
|
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_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);
|
uint8_t vl53l5cx_write(VL53L5CX_Platform *platform, uint16_t addr, uint8_t *buf, uint32_t size);
|
||||||
|
|||||||
@ -47,6 +47,13 @@ void vl53l5cx_reset(VL53L5CX_Platform *platform) {
|
|||||||
#endif
|
#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) {
|
void vl53l5cx_swap(uint8_t *buf, uint16_t size) {
|
||||||
for (size_t i=0; i<size; i++) {
|
for (size_t i=0; i<size; i++) {
|
||||||
((uint32_t *) buf)[i] = __REV(((uint32_t *) buf)[i]);
|
((uint32_t *) buf)[i] = __REV(((uint32_t *) buf)[i]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user