21#ifndef PROTOCORE_VL53L0X_H
22#define PROTOCORE_VL53L0X_H
26#define VL53L0X_REG_SYSRANGE_START 0x00
27#define VL53L0X_REG_SYSTEM_INTERRUPT_CLEAR 0x0B
28#define VL53L0X_REG_RESULT_INTERRUPT_STATUS 0x13
29#define VL53L0X_REG_RESULT_RANGE_STATUS 0x14
30#define VL53L0X_REG_IDENTIFICATION_MODEL_ID 0xC0
32#define VL53L0X_MODEL_ID 0xEE
33#define VL53L0X_RANGE_VALID 11
bool pc_vl53l0x_data_ready(uint8_t interrupt_status)
True if a new measurement is ready (any of the low 3 interrupt-status bits set).
uint16_t pc_vl53l0x_range_mm(uint8_t hi, uint8_t lo)
Combine the range high/low bytes (RESULT_RANGE_STATUS+10 / +11) into millimeters.
bool pc_vl53l0x_range_valid(uint8_t range_status_reg)
True if the range-status field reports a valid measurement (== VL53L0X_RANGE_VALID).
bool pc_vl53l0x_read_mm(uint16_t *mm)
If a measurement is ready, read the distance into mm and clear the interrupt.
uint8_t pc_vl53l0x_range_status(uint8_t range_status_reg)
The DeviceRangeStatus field (bits 6:3) of the RESULT_RANGE_STATUS register.
bool pc_vl53l0x_begin(uint8_t addr)
Verify the model id and start continuous back-to-back ranging at addr.