Fork of X-NUCLEO-53L0A1 Library and deleted the board related files. Just use a VL53L0X chip as a ToF sensor.

Dependents:   Check_VL53L0X_simple_with_three_ToF Check_VL53L0X_simple_ToF_Sensor lidarproj Check_VL53L0X_simple_with_three_ToF ... more

Fork of VL53L0X by ST

Embed: (wiki syntax)

« Back to documentation index

PAL Register Access Functions

PAL Register Access Functions
[VL53L0 Platform Functions]

PAL Register Access Functions. More...

Functions

VL53L0X_Error VL53L0X_lock_sequence_access (VL53L0X_DEV dev)
 Lock comms interface to serialize all commands to a shared I2C interface for a specific device.
VL53L0X_Error VL53L0X_unlock_sequence_access (VL53L0X_DEV dev)
 Unlock comms interface to serialize all commands to a shared I2C interface for a specific device.
VL53L0X_Error vl53L0x_set_device_parameters (VL53L0X_DEV Dev, const VL53L0X_DeviceParameters_t *pDeviceParameters)
 Prepare device for operation.
VL53L0X_Error VL53L0X_set_group_param_hold (VL53L0X_DEV dev, uint8_t group_param_hold)
 Set Group parameter Hold state.
VL53L0X_Error VL53L0X_wait_device_ready_for_new_measurement (VL53L0X_DEV dev, uint32_t max_loop)
 Wait for device ready for a new measurement command.
VL53L0X_Error VL53L0X_LockSequenceAccess (VL53L0X_DEV Dev)
 Lock comms interface to serialize all commands to a shared I2C interface for a specific device.
VL53L0X_Error VL53L0X_UnlockSequenceAccess (VL53L0X_DEV Dev)
 Unlock comms interface to serialize all commands to a shared I2C interface for a specific device.
VL53L0X_Error VL53L0X_WriteMulti (VL53L0X_DEV Dev, uint8_t index, uint8_t *pdata, uint32_t count)
 Writes the supplied byte buffer to the device.
VL53L0X_Error VL53L0X_ReadMulti (VL53L0X_DEV Dev, uint8_t index, uint8_t *pdata, uint32_t count)
 Reads the requested number of bytes from the device.
VL53L0X_Error VL53L0X_WrByte (VL53L0X_DEV Dev, uint8_t index, uint8_t data)
 Write single byte register.
VL53L0X_Error VL53L0X_WrWord (VL53L0X_DEV Dev, uint8_t index, uint16_t data)
 Write word register.
VL53L0X_Error VL53L0X_WrDWord (VL53L0X_DEV Dev, uint8_t index, uint32_t data)
 Write double word (4 byte) register.
VL53L0X_Error VL53L0X_RdByte (VL53L0X_DEV Dev, uint8_t index, uint8_t *data)
 Read single byte register.
VL53L0X_Error VL53L0X_RdWord (VL53L0X_DEV Dev, uint8_t index, uint16_t *data)
 Read word (2byte) register.
VL53L0X_Error VL53L0X_RdDWord (VL53L0X_DEV Dev, uint8_t index, uint32_t *data)
 Read dword (4byte) register.
VL53L0X_Error VL53L0X_UpdateByte (VL53L0X_DEV Dev, uint8_t index, uint8_t AndData, uint8_t OrData)
 Threat safe Update (read/modify/write) single byte register.

Detailed Description

PAL Register Access Functions.


Function Documentation

VL53L0X_Error VL53L0X_lock_sequence_access ( VL53L0X_DEV  dev )

Lock comms interface to serialize all commands to a shared I2C interface for a specific device.

Parameters:
devDevice Handle
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_LockSequenceAccess ( VL53L0X_DEV  Dev )

Lock comms interface to serialize all commands to a shared I2C interface for a specific device.

Parameters:
DevDevice Handle
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_RdByte ( VL53L0X_DEV  Dev,
uint8_t  index,
uint8_t *  data 
)

Read single byte register.

Parameters:
DevDevice Handle
indexThe register index
datapointer to 8 bit data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_RdDWord ( VL53L0X_DEV  Dev,
uint8_t  index,
uint32_t *  data 
)

Read dword (4byte) register.

Parameters:
DevDevice Handle
indexThe register index
datapointer to 32 bit data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_RdWord ( VL53L0X_DEV  Dev,
uint8_t  index,
uint16_t *  data 
)

Read word (2byte) register.

Parameters:
DevDevice Handle
indexThe register index
datapointer to 16 bit data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_ReadMulti ( VL53L0X_DEV  Dev,
uint8_t  index,
uint8_t *  pdata,
uint32_t  count 
)

Reads the requested number of bytes from the device.

Parameters:
DevDevice Handle
indexThe register index
pdataPointer to the uint8_t buffer to store read data
countNumber of uint8_t's to read
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error vl53L0x_set_device_parameters ( VL53L0X_DEV  Dev,
const VL53L0X_DeviceParameters_t pDeviceParameters 
)

Prepare device for operation.

Function Description
Update device with provided parameters
  • Then start ranging operation.
Note:
This function Access to the device
Parameters:
DevDevice Handle
pDeviceParametersPointer to store current device parameters.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_set_group_param_hold ( VL53L0X_DEV  dev,
uint8_t  group_param_hold 
)

Set Group parameter Hold state.

Function Description
Set or remove device internal group parameter hold
Note:
This function is not Implemented
Parameters:
devDevice Handle
group_param_holdGroup parameter Hold state to be set (on/off)
Returns:
VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented
VL53L0X_Error VL53L0X_unlock_sequence_access ( VL53L0X_DEV  dev )

Unlock comms interface to serialize all commands to a shared I2C interface for a specific device.

Parameters:
devDevice Handle
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_UnlockSequenceAccess ( VL53L0X_DEV  Dev )

Unlock comms interface to serialize all commands to a shared I2C interface for a specific device.

Parameters:
DevDevice Handle
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_UpdateByte ( VL53L0X_DEV  Dev,
uint8_t  index,
uint8_t  AndData,
uint8_t  OrData 
)

Threat safe Update (read/modify/write) single byte register.

Final_reg = (Initial_reg & and_data) |or_data

Parameters:
DevDevice Handle
indexThe register index
AndData8 bit and data
OrData8 bit or data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_wait_device_ready_for_new_measurement ( VL53L0X_DEV  dev,
uint32_t  max_loop 
)

Wait for device ready for a new measurement command.

Blocking function.

Note:
This function is not Implemented
Parameters:
devDevice Handle
max_loopMax Number of polling loop (timeout).
Returns:
VL53L0X_ERROR_NOT_IMPLEMENTED Not implemented
VL53L0X_Error VL53L0X_WrByte ( VL53L0X_DEV  Dev,
uint8_t  index,
uint8_t  data 
)

Write single byte register.

Parameters:
DevDevice Handle
indexThe register index
data8 bit register data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_WrDWord ( VL53L0X_DEV  Dev,
uint8_t  index,
uint32_t  data 
)

Write double word (4 byte) register.

Parameters:
DevDevice Handle
indexThe register index
data32 bit register data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_WriteMulti ( VL53L0X_DEV  Dev,
uint8_t  index,
uint8_t *  pdata,
uint32_t  count 
)

Writes the supplied byte buffer to the device.

Parameters:
DevDevice Handle
indexThe register index
pdataPointer to uint8_t buffer containing the data to be written
countNumber of bytes in the supplied byte buffer
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_WrWord ( VL53L0X_DEV  Dev,
uint8_t  index,
uint16_t  data 
)

Write word register.

Parameters:
DevDevice Handle
indexThe register index
data16 bit register data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error