Class that stores state and functions for interacting with VL53L0X time-of-flight sensor chips.
More...
|
|
| Adafruit_VL53L0X (TwoWire &, uint8_t i2cAddr=VL53L0X_I2C_ADDR) |
| | Bind the I2C bus and initial 7-bit address. Call begin() before ranging.
|
| boolean | begin (VL53L0X_Sense_config_t vl_config=VL53L0X_SENSE_DEFAULT, boolean debug=false) |
| | Initialize the bus and sensor with a ranging preset.
|
|
boolean | setAddress (uint8_t newAddr) |
| | Change the sensor I2C address; return true on success.
|
| VL53L0X_Error | rangingTest (VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, boolean debug=false) |
| | get a ranging measurement from the device
|
| VL53L0X_Error | getSingleRangingMeasurement (VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, boolean debug=false) |
| | Perform a blocking single measurement into pRangingMeasurementData.
|
|
void | printRangeStatus (VL53L0X_RangingMeasurementData_t *pRangingMeasurementData) |
| | Print a human-readable interpretation of the supplied measurement RangeStatus.
|
|
VL53L0X_Error | getRangingMeasurement (VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, boolean debug=false) |
| | Read a measurement into caller storage; return ST API status.
|
|
VL53L0X_Error | startMeasurement (boolean debug=false) |
| | Start measurement using the configured device mode; return ST status.
|
|
VL53L0X_Error | stopMeasurement (boolean debug=false) |
| | Stop measurement using the ST API; return ST status.
|
|
VL53L0X_Error | getLimitCheckCurrent (uint8_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent, boolean debug=false) |
| | Read the selected limit-check result into a 16.16 fixed-point output; return ST status.
|
|
VL53L0X_Error | getDeviceMode (VL53L0X_DeviceModes *pDeviceMode, boolean debug=false) |
| | Read the device mode into pDeviceMode; return ST status.
|
|
VL53L0X_Error | setDeviceMode (VL53L0X_DeviceModes DeviceMode, boolean debug=false) |
| | Set the ST device mode; return ST status.
|
|
VL53L0X_Error | setInterruptThresholds (FixPoint1616_t ThresholdLow, FixPoint1616_t ThresholdHigh, boolean debug=false) |
| | Set low/high interrupt thresholds in ST 16.16 distance format; return ST status.
|
|
VL53L0X_Error | getInterruptThresholds (FixPoint1616_t *pThresholdLow, FixPoint1616_t *pThresholdHigh, boolean debug=false) |
| | Read low/high ST 16.16 interrupt thresholds into caller storage; return ST status.
|
|
VL53L0X_Error | clearInterruptMask (boolean debug=false) |
| | Clear the sensor interrupt mask; return ST status.
|
|
VL53L0X_Error | getGpioConfig (VL53L0X_DeviceModes *pDeviceMode, VL53L0X_GpioFunctionality *pFunctionality, VL53L0X_InterruptPolarity *pPolarity, boolean debug=false) |
| | Read device mode, GPIO function, and polarity into caller storage; return ST status.
|
|
VL53L0X_Error | setGpioConfig (VL53L0X_DeviceModes DeviceMode, VL53L0X_GpioFunctionality Functionality, VL53L0X_InterruptPolarity Polarity, boolean debug=false) |
| | Configure the interrupt GPIO function/polarity for DeviceMode; return ST status.
|
|
uint16_t | readRange (void) |
| | Perform a single-shot measurement; return millimeters or 0xFFFF on API error. Check readRangeStatus() before using the distance.
|
|
uint8_t | readRangeStatus (void) |
| | Return the last cached measurement RangeStatus (zero indicates a valid range).
|
|
boolean | startRange (void) |
| | Start a nonblocking single range; return true on API success.
|
|
boolean | isRangeComplete (void) |
| | Return true when data is ready or an API error occurred; inspect Status.
|
|
boolean | waitRangeComplete (void) |
| | Wait for measurement readiness; return false on API error.
|
|
uint16_t | readRangeResult (void) |
| | Read completed range in millimeters, or 0xFFFF on API error; check readRangeStatus().
|
|
boolean | startRangeContinuous (uint16_t period_ms=50) |
| | Start continuous ranging with period_ms between measurements; return true on success.
|
|
void | stopRangeContinuous (void) |
| | Stop continuous ranging and update Status.
|
| boolean | timeoutOccurred (void) |
| | timeout status
|
|
boolean | configSensor (VL53L0X_Sense_config_t vl_config) |
| | Apply a ranging preset; return true on API success.
|
|
boolean | setMeasurementTimingBudgetMicroSeconds (uint32_t budget_us) |
| | Set the measurement timing budget in microseconds; return true on success.
|
|
uint32_t | getMeasurementTimingBudgetMicroSeconds (void) |
| | Return the measurement timing budget in microseconds; inspect Status for API errors.
|
|
boolean | setVcselPulsePeriod (VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriod) |
| | Set the selected VCSEL pulse period in PCLK units; return true on success.
|
|
uint8_t | getVcselPulsePeriod (VL53L0X_VcselPeriod VcselPeriodType) |
| | Return the selected VCSEL pulse period in PCLK units; inspect Status for errors.
|
|
boolean | setLimitCheckEnable (uint16_t LimitCheckId, uint8_t LimitCheckEnable) |
| | Enable/disable the specified ST limit check; return true on success.
|
|
uint8_t | getLimitCheckEnable (uint16_t LimitCheckId) |
| | Return the selected limit-check enable value; inspect Status for API errors.
|
|
boolean | setLimitCheckValue (uint16_t LimitCheckId, FixPoint1616_t LimitCheckValue) |
| | Set the selected ST limit threshold in 16.16 fixed-point format; return true on success.
|
|
FixPoint1616_t | getLimitCheckValue (uint16_t LimitCheckId) |
| | Return the selected ST limit threshold in 16.16 format; inspect Status for errors.
|
Class that stores state and functions for interacting with VL53L0X time-of-flight sensor chips.