M5Unit-TOF 0.1.0 git rev:d9853ac
|
ToF4M unit. More...
#include <unit_VL53L1X.hpp>
Classes | |
struct | config_t |
Settings for begin. More... | |
Public Member Functions | |
UnitVL53L1X (const uint8_t addr=DEFAULT_ADDRESS) | |
virtual bool | begin () override |
virtual void | update (const bool force=false) override |
bool | readDistanceMode (vl53l1x::Distance &d) |
Read the distance mode. | |
bool | writeDistanceMode (const vl53l1x::Distance d) |
Write the distance mode. | |
bool | softReset () |
Software reset. | |
Settings for begin | |
config_t | config () const |
Gets the configration. | |
void | config (const config_t &cfg) |
Set the configration. | |
Measurement data by periodic | |
int16_t | range () const |
Oldest measured range(mm) | |
bool | valid () const |
Is valid oldest data? | |
vl53l1x::RangeStatus | range_status () const |
Oldest measured range status. | |
Properties | |
vl53l1x::Distance | distanceMode () const |
Gets the inner distance mode. | |
vl53l1x::Timing | timingBudget () const |
Gets the inner timing budget. | |
Periodic measurement | |
bool | startPeriodicMeasurement () |
Start periodic measurement in the current settings. | |
bool | startPeriodicMeasurement (const vl53l1x::Distance dist, const vl53l1x::Timing tb=vl53l1x::Timing::Budget50ms) |
Start periodic measurement. | |
bool | stopPeriodicMeasurement () |
Stop periodic measurement. | |
Single shot measurement | |
bool | measureSingleshot (vl53l1x::Data &d) |
Measurement single shot in the current settings. | |
Offset | |
bool | calibrateOffset (int16_t &offset, const uint16_t targetmm=100) |
Calculate and write calibration offsets for a given target value. | |
bool | readOffset (int16_t &offset) |
Read the offset. | |
bool | writeOffset (const int16_t offset) |
Write the offset. | |
Crosstalk | |
bool | calibrateXtalk (uint16_t &xtalk, const uint16_t targetmm=100) |
Calculate and write calibration crosstalk for a given target value. | |
bool | readXtalk (uint16_t &xtalk) |
Read the crosstalk. | |
bool | writeXtalk (const uint16_t xtalk) |
Write the crosstalk. | |
Timing considerations | |
bool | readTimingBudget (vl53l1x::Timing &tb) |
Read the timing budget. | |
bool | writeTimingBudget (const vl53l1x::Timing tb) |
Write the timing budget. | |
bool | readInterMeasurementPeriod (uint16_t &ms) |
Read the inter-measurement period(IMP) | |
bool | writeInterMeasurementPeriod (const uint16_t ms) |
Write the inter-measurement period(IMP) | |
Window | |
bool | readDistanceThresholdWindow (vl53l1x::Window &window) |
Read the window detection mode. | |
bool | readDistanceThresholdLow (uint16_t &mm) |
Read the lower distance threshould. | |
bool | readDistanceThresholdHigh (uint16_t &mm) |
Read the higher distance threshould. | |
bool | writeDistanceThreshold (const vl53l1x::Window window, const uint16_t low, const uint16_t high) |
Write the threshold and window detection mode. | |
bool | clearDistanceThreshold () |
Go back to the regular ranging mode. | |
ROI(Region Of Interest) | |
ROI coodinate 128,136,144,152,160,168,176,184, 192,200,208,216,224,232,240,248 129,137,145,153,161,169,177,185, 193,201,209,217,225,233,241,249 130,138,146,154,162,170,178,186, 194,202,210,218,226,234,242,250 131,139,147,155,163,171,179,187, 195,203,211,219,227,235,243,251 132,140,148,156,164,172,180,188, 196,204,212,220,228,236,244,252 133,141,149,157,165,173,181,189, 197,205,213,221,229,237,245,253 134,142,150,158,166,174,182,190, 198,206,214,222,230,238,246,254 135,143,151,159,167,175,183,191, 199,207,215,223,231,239,247,255 127,119,111,103, 95, 87, 79, 71, 63, 55, 47, 39, 31, 23, 15, 7 126,118,110,102, 94, 86, 78, 70, 62, 54, 46, 38, 30, 22, 14, 6 125,117,109,101, 93, 85, 77, 69, 61, 53, 45, 37, 29, 21, 13, 5 124,116,108,100, 92, 84, 76, 68, 60, 52, 44, 36, 28, 20, 12, 4 123,115,107, 99, 91, 83, 75, 67, 59, 51, 43, 35, 27, 19, 11, 3 122,114,106, 98, 90, 82, 74, 66, 58, 50, 42, 34, 26, 18, 10, 2 121,113,105, 97, 89, 81, 73, 65, 57, 49, 41, 33, 25, 17, 9, 1 120,112,104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 | |
bool | readROI (uint8_t &wid, uint8_t &hgt) |
Read the ROI width and height. | |
bool | readROICenter (uint8_t ¢er) |
Read the center of the ROI. | |
bool | writeROI (const uint8_t wid, const uint8_t hgt) |
Write the ROI width and height. | |
bool | writeROICenter (const uint8_t center) |
Write the center of the ROI. | |
I2C Address | |
| |
bool | readI2CAddress (uint8_t &i2c_address) |
Read the I2C address. | |
bool | changeI2CAddress (const uint8_t i2c_address) |
Change unit I2C address. | |
Protected Member Functions | |
bool | start_periodic_measurement () |
bool | start_periodic_measurement (const vl53l1x::Distance dist, const vl53l1x::Timing tb) |
bool | stop_periodic_measurement () |
bool | write_operating_condition (const vl53l1x::Operating oc) |
bool | write_timing_budget (const vl53l1x::Timing tb, const vl53l1x::Distance distance) |
bool | read_data_ready_status () |
bool | read_measurement (vl53l1x::Data &d) |
bool | soft_reset () |
bool | write_default_values () |
bool | wait_booted () |
M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitVL53L1X, vl53l1x::Data) | |
Protected Attributes | |
vl53l1x::Distance | _distance {vl53l1x::Distance::Unknown} |
vl53l1x::Timing | _tb {vl53l1x::Timing::BudgetUnknown} |
std::unique_ptr< m5::container::CircularBuffer< vl53l1x::Data > > | _data {} |
config_t | _cfg {} |
ToF4M unit.
bool m5::unit::UnitVL53L1X::calibrateOffset | ( | int16_t & | offset, |
const uint16_t | targetmm = 100 ) |
Calculate and write calibration offsets for a given target value.
[out] | offset | Calculated offset value |
targetmm | Target distance (mm) |
bool m5::unit::UnitVL53L1X::calibrateXtalk | ( | uint16_t & | xtalk, |
const uint16_t | targetmm = 100 ) |
Calculate and write calibration crosstalk for a given target value.
[out] | xtalk | Calculated crosstalk value |
targetmm | Target distance (mm) |
bool m5::unit::UnitVL53L1X::changeI2CAddress | ( | const uint8_t | i2c_address | ) |
Change unit I2C address.
i2c_address | I2C address |
|
inline |
Go back to the regular ranging mode.
|
inline |
Gets the inner distance mode.
bool m5::unit::UnitVL53L1X::measureSingleshot | ( | vl53l1x::Data & | d | ) |
Measurement single shot in the current settings.
[out] | data | Measuerd data |
|
inline |
Oldest measured range(mm)
bool m5::unit::UnitVL53L1X::readDistanceMode | ( | vl53l1x::Distance & | d | ) |
Read the distance mode.
[out] | d | distance |
bool m5::unit::UnitVL53L1X::readDistanceThresholdHigh | ( | uint16_t & | mm | ) |
Read the higher distance threshould.
[out] | mm | distance (mm) |
bool m5::unit::UnitVL53L1X::readDistanceThresholdLow | ( | uint16_t & | mm | ) |
Read the lower distance threshould.
[out] | mm | distance (mm) |
bool m5::unit::UnitVL53L1X::readDistanceThresholdWindow | ( | vl53l1x::Window & | window | ) |
Read the window detection mode.
[out] | window | Window mode |
bool m5::unit::UnitVL53L1X::readI2CAddress | ( | uint8_t & | i2c_address | ) |
Read the I2C address.
i2c_address[out] | I2C address |
bool m5::unit::UnitVL53L1X::readInterMeasurementPeriod | ( | uint16_t & | ms | ) |
Read the inter-measurement period(IMP)
[out] | ms | period (ms) |
bool m5::unit::UnitVL53L1X::readOffset | ( | int16_t & | offset | ) |
Read the offset.
[out] | offset | Offset value |
bool m5::unit::UnitVL53L1X::readROI | ( | uint8_t & | wid, |
uint8_t & | hgt ) |
Read the ROI width and height.
[out] | wid | width |
[out] | hgt | height |
bool m5::unit::UnitVL53L1X::readROICenter | ( | uint8_t & | center | ) |
Read the center of the ROI.
[out] | center | ROI coordinates |
bool m5::unit::UnitVL53L1X::readTimingBudget | ( | vl53l1x::Timing & | tb | ) |
Read the timing budget.
[out] | tb | timing budget |
bool m5::unit::UnitVL53L1X::readXtalk | ( | uint16_t & | xtalk | ) |
Read the crosstalk.
[out] | xtalk | Crosstalk value |
|
inline |
Start periodic measurement in the current settings.
|
inline |
Start periodic measurement.
dist | Distance mode |
tb | Timing budget |
|
inline |
Stop periodic measurement.
|
inline |
Gets the inner timing budget.
bool m5::unit::UnitVL53L1X::writeDistanceMode | ( | const vl53l1x::Distance | d | ) |
Write the distance mode.
d | distance |
bool m5::unit::UnitVL53L1X::writeDistanceThreshold | ( | const vl53l1x::Window | window, |
const uint16_t | low, | ||
const uint16_t | high ) |
Write the threshold and window detection mode.
window | window mode |
low | lower distance threshold (mm) |
high | lower distance threshold (mm) |
bool m5::unit::UnitVL53L1X::writeInterMeasurementPeriod | ( | const uint16_t | ms | ) |
Write the inter-measurement period(IMP)
ms | period (ms) |
bool m5::unit::UnitVL53L1X::writeOffset | ( | const int16_t | offset | ) |
Write the offset.
offset | Offset value |
bool m5::unit::UnitVL53L1X::writeROI | ( | const uint8_t | wid, |
const uint8_t | hgt ) |
Write the ROI width and height.
wid | width |
hgt | height |
bool m5::unit::UnitVL53L1X::writeROICenter | ( | const uint8_t | center | ) |
Write the center of the ROI.
center | ROI coordinates |
|
inline |
Write the timing budget.
tb | Timing budget |
bool m5::unit::UnitVL53L1X::writeXtalk | ( | const uint16_t | xtalk | ) |
Write the crosstalk.
xtalk | Crosstalk value |