mbed compatible API for the VL53L0X Time-of-Flight sensor

Dependents:   VL53L0X_SingleRanging_Example robot_sm VL53L0X_SingleRanging_HighAccuracy_HANSL ENGR6002_P001unk

Embed: (wiki syntax)

« Back to documentation index

VL53L0X Init Functions

VL53L0X Init Functions. More...

Functions

VL53L0X_API VL53L0X_Error VL53L0X_SetDeviceAddress (VL53L0X_DEV Dev, uint8_t DeviceAddress)
 Set new device address.
VL53L0X_API VL53L0X_Error VL53L0X_DataInit (VL53L0X_DEV Dev)
 One time device initialization.
VL53L0X_API VL53L0X_Error VL53L0X_SetTuningSettingBuffer (VL53L0X_DEV Dev, uint8_t *pTuningSettingBuffer, uint8_t UseInternalTuningSettings)
 Set the tuning settings pointer.
VL53L0X_API VL53L0X_Error VL53L0X_GetTuningSettingBuffer (VL53L0X_DEV Dev, uint8_t **ppTuningSettingBuffer, uint8_t *pUseInternalTuningSettings)
 Get the tuning settings pointer and the internal external switch value.
VL53L0X_API VL53L0X_Error VL53L0X_StaticInit (VL53L0X_DEV Dev)
 Do basic device init (and eventually patch loading) This function will change the VL53L0X_State from VL53L0X_STATE_WAIT_STATICINIT to VL53L0X_STATE_IDLE.
VL53L0X_API VL53L0X_Error VL53L0X_WaitDeviceBooted (VL53L0X_DEV Dev)
 Wait for device booted after chip enable (hardware standby) This function can be run only when VL53L0X_State is VL53L0X_STATE_POWERDOWN.
VL53L0X_API VL53L0X_Error VL53L0X_ResetDevice (VL53L0X_DEV Dev)
 Do an hard reset or soft reset (depending on implementation) of the device call of this function, device must be in same state as right after a power-up sequence.This function will change the VL53L0X_State to VL53L0X_STATE_POWERDOWN.

Detailed Description

VL53L0X Init Functions.


Function Documentation

VL53L0X_API VL53L0X_Error VL53L0X_DataInit ( VL53L0X_DEV  Dev )

One time device initialization.

To be called once and only once after device is brought out of reset (Chip enable) and booted see VL53L0X_WaitDeviceBooted()

Function Description
When not used after a fresh device "power up" or reset, it may return VL53L0X_ERROR_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_DataInit multiple time then it must ensure proper offset calibration saving and restore on its own by using VL53L0X_GetOffsetCalibrationData() on first power up and then VL53L0X_SetOffsetCalibrationData() in all subsequent init This function will change the VL53L0X_State from VL53L0X_STATE_POWERDOWN to VL53L0X_STATE_WAIT_STATICINIT.
Note:
This function Access to the device
Parameters:
DevDevice Handle
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 367 of file vl53l0x_api.c.

VL53L0X_API VL53L0X_Error VL53L0X_GetTuningSettingBuffer ( VL53L0X_DEV  Dev,
uint8_t **  ppTuningSettingBuffer,
uint8_t *  pUseInternalTuningSettings 
)

Get the tuning settings pointer and the internal external switch value.

This function is used to get the Tuning settings buffer pointer and the value. of the switch to select either external or internal tuning settings.

Note:
This function Access to the device
Parameters:
DevDevice Handle
ppTuningSettingBufferPointer to tuning settings buffer.
pUseInternalTuningSettingsPointer to store Use internal tuning settings value.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 535 of file vl53l0x_api.c.

VL53L0X_API VL53L0X_Error VL53L0X_ResetDevice ( VL53L0X_DEV  Dev )

Do an hard reset or soft reset (depending on implementation) of the device call of this function, device must be in same state as right after a power-up sequence.This function will change the VL53L0X_State to VL53L0X_STATE_POWERDOWN.

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

Definition at line 740 of file vl53l0x_api.c.

VL53L0X_API VL53L0X_Error VL53L0X_SetDeviceAddress ( VL53L0X_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.

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

Definition at line 355 of file vl53l0x_api.c.

VL53L0X_API VL53L0X_Error VL53L0X_SetTuningSettingBuffer ( VL53L0X_DEV  Dev,
uint8_t *  pTuningSettingBuffer,
uint8_t  UseInternalTuningSettings 
)

Set the tuning settings pointer.

This function is used to specify the Tuning settings buffer to be used for a given device. The buffer contains all the necessary data to permit the API to write tuning settings. This function permit to force the usage of either external or internal tuning settings.

Note:
This function Access to the device
Parameters:
DevDevice Handle
pTuningSettingBufferPointer to tuning settings buffer.
UseInternalTuningSettingsUse internal tuning settings value.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 508 of file vl53l0x_api.c.

VL53L0X_API VL53L0X_Error VL53L0X_StaticInit ( VL53L0X_DEV  Dev )

Do basic device init (and eventually patch loading) This function will change the VL53L0X_State from VL53L0X_STATE_WAIT_STATICINIT to VL53L0X_STATE_IDLE.

In this stage all default setting will be applied.

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

Definition at line 550 of file vl53l0x_api.c.

VL53L0X_API VL53L0X_Error VL53L0X_WaitDeviceBooted ( VL53L0X_DEV  Dev )

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

Note:
This function is not Implemented
Parameters:
DevDevice Handle
Returns:
VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented

Definition at line 729 of file vl53l0x_api.c.