VL53L0X World smallest Time-of-Flight (ToF) ranging sensor
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_ST_Sensors mbed-os-mqtt-client Multi_VL53L0X DISCO-IOT01_HomeEnv ... more
Fork of VL53L0X by
Init functions
Wrapper functions. More...
Functions | |
virtual int | init (void *init) |
One time device initialization. | |
int | prepare () |
Prepare device for operation. | |
int | range_start_continuous_mode () |
Start continuous ranging mode. | |
virtual int | get_distance (uint32_t *p_data) |
Get ranging result and only that. |
Detailed Description
Wrapper functions.
API init functions
Function Documentation
virtual int get_distance | ( | uint32_t * | p_data ) | [virtual, inherited] |
Get ranging result and only that.
- Function Description
- Unlike VL53L0X_get_ranging_measurement_data() this function only retrieves the range in millimeter
It does any required up-scale translation
It can be called after success status polling or in interrupt mode
- Warning:
- these function is not doing wrap around filtering
This function doesn't perform any data ready check!
- Parameters:
-
p_data Pointer to range distance
- Returns:
- "0" on success
virtual int init | ( | void * | init ) | [virtual, inherited] |
One time device initialization.
To be called once and only once after device is brought out of reset (Chip enable) and booted.
- Function Description
- When not used after a fresh device "power up" or reset, it may return CALIBRATION_WARNING meaning wrong calibration data may have been fetched from device that can result in ranging offset error
If application cannot execute device reset or need to run VL53L0X_data_init multiple time then it must ensure proper offset calibration saving and restore on its own by using VL53L0X_get_offset_calibration_data_micro_meter() on first power up and then VL53L0X_set_offset_calibration_data_micro_meter() all all subsequent init
- Parameters:
-
void
- Returns:
- "0" on success, CALIBRATION_WARNING if failed
int prepare | ( | ) | [inherited] |
Prepare device for operation.
- Function Description
- Does static initialization and reprogram common default settings
Device is prepared for new measure, ready single shot ranging or ALS typical polling operation
After prepare user can :
- Call other API function to set other settings
- Configure the interrupt pins, etc...
- Then start ranging or ALS operations in single shot or continuous mode
- Call other API function to set other settings
- Parameters:
-
void
- Returns:
- "0" on success
Generated on Tue Jul 12 2022 19:07:41 by 1.7.2