ST Expansion SW Team / VL53L1

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   X_NUCLEO_53L1CB

Embed: (wiki syntax)

« Back to documentation index

VL53L1 Init Functions

VL53L1 Init Functions. More...

Functions

VL53L1_Error VL53L1_SetDeviceAddress (VL53L1_DEV Dev, uint8_t DeviceAddress)
 Set new device address.
VL53L1_Error VL53L1_DataInit (VL53L1_DEV Dev)
 One time device initialization.
VL53L1_Error VL53L1_StaticInit (VL53L1_DEV Dev)
 Do basic device init (and eventually patch loading) This function will change the VL53L1_State from VL53L1_STATE_WAIT_STATICINIT to VL53L1_STATE_IDLE.
VL53L1_Error VL53L1_WaitDeviceBooted (VL53L1_DEV Dev)
 Wait for device booted after chip enable (hardware standby) This function can be run only when VL53L1_State is VL53L1_STATE_POWERDOWN.

Detailed Description

VL53L1 Init Functions.


Function Documentation

VL53L1_Error VL53L1_DataInit ( VL53L1_DEV  Dev )

One time device initialization.

To be called after device has been powered on and booted see VL53L1_WaitDeviceBooted()

Function Description
When not used after a fresh device "power up", it may return VL53L1_ERROR_CALIBRATION_WARNING meaning wrong calibration data may have been fetched from device that can result in ranging offset error
If VL53L1_DataInit is called several times then the application must restore calibration calling VL53L1_SetOffsetCalibrationData() It implies application has gathered calibration data thanks to VL53L1_GetOffsetCalibrationData() after an initial calibration stage. This function will change the VL53L1_State from VL53L1_STATE_POWERDOWN to VL53L1_STATE_WAIT_STATICINIT.
Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53L1_ERROR_NONE Success
"Other error code" See VL53L1_Error

Definition at line 459 of file vl53l1_api.c.

VL53L1_Error VL53L1_SetDeviceAddress ( VL53L1_DEV  Dev,
uint8_t  DeviceAddress 
)

Set new device address.

After completion the device will answer to the new address programmed. This function should be called when several devices are used in parallel before start programming the sensor. When a single device us used, there is no need to call this function.

When it is requested for multi devices system this function MUST be called prior to VL53L1_DataInit()

Note:
This function Access to the device
Parameters:
DevDevice Handle
DeviceAddressThe new Device address
Returns:
VL53L1_ERROR_NONE Success
"Other error code" See VL53L1_Error

Definition at line 442 of file vl53l1_api.c.

VL53L1_Error VL53L1_StaticInit ( VL53L1_DEV  Dev )

Do basic device init (and eventually patch loading) This function will change the VL53L1_State from VL53L1_STATE_WAIT_STATICINIT to VL53L1_STATE_IDLE.

In this stage all default setting will be applied.

Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53L1_ERROR_NONE Success
"Other error code" See VL53L1_Error

Definition at line 510 of file vl53l1_api.c.

VL53L1_Error VL53L1_WaitDeviceBooted ( VL53L1_DEV  Dev )

Wait for device booted after chip enable (hardware standby) This function can be run only when VL53L1_State is VL53L1_STATE_POWERDOWN.

Parameters:
DevDevice Handle
Returns:
VL53L1_ERROR_NONE Success
"Other error code" See VL53L1_Error

Definition at line 535 of file vl53l1_api.c.