Initial release. Mbed library for VL53L1CB
VL53L1X Class Reference
Class representing a VL53L1 sensor component. More...
#include <vl53l1x.h>
Inherits RangeSensor.
Public Member Functions | |
VL53L1X (ToF_DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr=VL53L1X_DEFAULT_DEVICE_ADDRESS) | |
Constructor. | |
VL53L1X (ToF_DevI2C *i2c, Stmpe1600DigiOut *pin, PinName pin_gpio1, uint8_t dev_addr=VL53L1X_DEFAULT_DEVICE_ADDRESS) | |
Constructor 2 (STMPE1600DigiOut) | |
virtual | ~VL53L1X () |
Destructor. | |
virtual void | VL53L1_On (void) |
PowerOn the sensor. | |
virtual void | VL53L1_Off (void) |
PowerOff the sensor. | |
VL53L1X_ERROR | InitSensor (uint8_t address) |
Initialize the sensor with default values. | |
virtual int | init (void *init) |
One time device initialization. | |
int | init_sensor (uint8_t new_addr) |
Initialize the sensor with default values. | |
virtual int | read_id (uint8_t *id) |
Getting the ID of the component. | |
virtual int | get_distance (uint32_t *piData) |
Get ranging result and only that. | |
VL53L1X_ERROR | VL53L1X_GetSWVersion (VL53L1X_Version_t *pVersion) |
This function returns the SW driver version. | |
VL53L1X_ERROR | vl53L1X_SetI2CAddress (uint8_t new_address) |
This function sets the sensor I2C address used in case multiple devices application, default address 0x52. | |
VL53L1X_ERROR | VL53L1X_SensorInit () |
This function loads the 135 bytes default values to initialize the sensor. | |
VL53L1X_ERROR | VL53L1X_ClearInterrupt () |
This function clears the interrupt, to be called after a ranging data reading to arm the interrupt for the next data ready event. | |
VL53L1X_ERROR | VL53L1X_GetInterruptPolarity (uint8_t *pIntPol) |
This function returns the current interrupt polarity 1=active high (default), 0=active low. | |
VL53L1X_ERROR | VL53L1X_StartRanging () |
This function starts the ranging distance operation The ranging operation is continuous. | |
VL53L1X_ERROR | VL53L1X_StopRanging () |
This function stops the ranging. | |
VL53L1X_ERROR | vl53L1X_BootState (uint8_t *state) |
This function returns the boot state of the device (1:booted, 0:not booted) | |
VL53L1X_ERROR | VL53L1X_GetDistance (uint16_t *distance) |
This function returns the sensor id, sensor Id must be 0xEEAC. | |
Protected Attributes | |
VL53L1_Dev_t | MyDevice |
* Digital out pin */ |
Detailed Description
Class representing a VL53L1 sensor component.
Definition at line 135 of file vl53l1x.h.
Constructor & Destructor Documentation
VL53L1X | ( | ToF_DevI2C * | i2c, |
DigitalOut * | pin, | ||
PinName | pin_gpio1, | ||
uint8_t | dev_addr = VL53L1X_DEFAULT_DEVICE_ADDRESS |
||
) |
VL53L1X | ( | ToF_DevI2C * | i2c, |
Stmpe1600DigiOut * | pin, | ||
PinName | pin_gpio1, | ||
uint8_t | dev_addr = VL53L1X_DEFAULT_DEVICE_ADDRESS |
||
) |
Constructor 2 (STMPE1600DigiOut)
- Parameters:
-
[in] i2c device I2C to be used for communication [in] &pin Gpio Expander STMPE1600DigiOut pin to be used as component GPIO_0 CE [in] pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT [in] device address, 0x29 by default
Member Function Documentation
virtual int get_distance | ( | uint32_t * | piData ) | [virtual] |
Get ranging result and only that.
- Parameters:
-
pRange_mm Pointer to range distance
- Returns:
- 0 on success
Implements RangeSensor.
virtual int init | ( | void * | init ) | [virtual] |
int init_sensor | ( | uint8_t | new_addr ) |
Initialize the sensor with default values.
- Returns:
- "0" on success
Definition at line 96 of file vl53l1x.cpp.
VL53L1X_ERROR InitSensor | ( | uint8_t | address ) |
virtual int read_id | ( | uint8_t * | id ) | [virtual] |
virtual void VL53L1_Off | ( | void | ) | [virtual] |
virtual void VL53L1_On | ( | void | ) | [virtual] |
VL53L1X_ERROR vl53L1X_BootState | ( | uint8_t * | state ) |
This function returns the boot state of the device (1:booted, 0:not booted)
Definition at line 189 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_ClearInterrupt | ( | ) |
This function clears the interrupt, to be called after a ranging data reading to arm the interrupt for the next data ready event.
Definition at line 143 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_GetDistance | ( | uint16_t * | distance ) |
This function returns the sensor id, sensor Id must be 0xEEAC.
This function returns the distance measured by the sensor in mm
Definition at line 200 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_GetInterruptPolarity | ( | uint8_t * | pIntPol ) |
This function returns the current interrupt polarity
1=active high (default), 0=active low.
Definition at line 156 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_GetSWVersion | ( | VL53L1X_Version_t * | pVersion ) |
This function returns the SW driver version.
Definition at line 68 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_SensorInit | ( | ) |
This function loads the 135 bytes default values to initialize the sensor.
- Parameters:
-
dev Device address
- Returns:
- 0:success, != 0:failed
Definition at line 112 of file vl53l1x.cpp.
VL53L1X_ERROR vl53L1X_SetI2CAddress | ( | uint8_t | new_address ) |
This function sets the sensor I2C address used in case multiple devices application, default address 0x52.
Definition at line 79 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_StartRanging | ( | ) |
This function starts the ranging distance operation
The ranging operation is continuous.
The clear interrupt has to be done after each get data to allow the interrupt to raise when the next data is ready
1=active high (default), 0=active low, use SetInterruptPolarity() to change the interrupt polarity if required.
Definition at line 169 of file vl53l1x.cpp.
VL53L1X_ERROR VL53L1X_StopRanging | ( | ) |
This function stops the ranging.
Definition at line 178 of file vl53l1x.cpp.
Field Documentation
Generated on Tue Jul 12 2022 20:07:15 by 1.7.2