eLab Team / Mbed 2 deprecated myRobot

Dependencies:   mbed WS2812

Embed: (wiki syntax)

« Back to documentation index

PAL Register Access Functions

PAL Register Access Functions

PAL Register Access Functions. More...

Functions

VL53L0X_Error vl53L0x_set_device_parameters (const VL53L0X_DeviceParameters_t *pDeviceParameters)
 Prepare device for operation.
VL53L0X_Error VL53L0X_write_byte (uint8_t index, uint8_t data)
 Write single byte register.
VL53L0X_Error VL53L0X_write_word (uint8_t index, uint16_t data)
 Write word register.
VL53L0X_Error VL53L0X_write_dword (uint8_t index, uint32_t data)
 Write double word (4 byte) register.
VL53L0X_Error VL53L0X_read_byte (uint8_t index, uint8_t *p_data)
 Read single byte register.
VL53L0X_Error VL53L0X_read_word (uint8_t index, uint16_t *p_data)
 Read word (2byte) register.
VL53L0X_Error VL53L0X_read_dword (uint8_t index, uint32_t *p_data)
 Read dword (4byte) register.
VL53L0X_Error VL53L0X_update_byte (uint8_t index, uint8_t and_data, uint8_t or_data)
 Thread safe Update (read/modify/write) single byte register.
VL53L0X_Error VL53L0X_read_multi (uint8_t index, uint8_t *p_data, uint32_t count)
 Reads the requested number of bytes from the device.
VL53L0X_Error VL53L0X_i2c_write (uint8_t index, uint8_t *p_data, uint16_t number_of_bytes)
 Writes a buffer towards the I2C peripheral device.
VL53L0X_Error VL53L0X_i2c_read (uint8_t index, uint8_t *p_data, uint16_t number_of_bytes)
 Reads a buffer from the I2C peripheral device.

Variables

VL53L0X_DeviceParameters_t CurrentParameters
VL53L0X_RangingMeasurementData_t LastRangeMeasure
uint8_t I2cDevAddr
uint8_t comms_type
uint16_t comms_speed_khz

Detailed Description

PAL Register Access Functions.


Function Documentation

VL53L0X_Error VL53L0X_i2c_read ( uint8_t  index,
uint8_t *  p_data,
uint16_t  number_of_bytes 
) [inherited]

Reads a buffer from the I2C peripheral device.

Parameters:
p_datapointer to the byte-array to read data in to
number_of_bytesnumber of bytes to be read.
Return values:
0if ok,
-1if an I2C error has occured
Note:
On some devices if NumByteToWrite is greater than one, the RegisterAddr must be masked correctly!

Reads a buffer from the I2C peripheral device.

Definition at line 4520 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_i2c_write ( uint8_t  index,
uint8_t *  p_data,
uint16_t  number_of_bytes 
) [inherited]

Writes a buffer towards the I2C peripheral device.

Parameters:
p_datapointer to the byte-array data to send
number_of_bytesnumber of bytes to be written.
Return values:
0if ok,
-1if an I2C error has occured
Note:
On some devices if NumByteToWrite is greater than one, the RegisterAddr must be masked correctly!

Writes a buffer towards the I2C peripheral device.

Definition at line 4504 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_read_byte ( uint8_t  index,
uint8_t *  p_data 
) [inherited]

Read single byte register.

Parameters:
indexThe register index
datapointer to 8 bit data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 4470 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_read_dword ( uint8_t  index,
uint32_t *  p_data 
) [inherited]

Read dword (4byte) register.

Parameters:
indexThe register index
datapointer to 32 bit data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 4482 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_read_multi ( uint8_t  index,
uint8_t *  p_data,
uint32_t  count 
) [inherited]

Reads the requested number of bytes from the device.

Parameters:
indexThe register index
p_dataPointer 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

Definition at line 4438 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_read_word ( uint8_t  index,
uint16_t *  p_data 
) [inherited]

Read word (2byte) register.

Parameters:
indexThe register index
datapointer to 16 bit data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 4473 of file VL53L0X.cpp.

VL53L0X_Error vl53L0x_set_device_parameters ( const VL53L0X_DeviceParameters_t pDeviceParameters ) [inherited]

Prepare device for operation.

Function Description
Update device with provided parameters
  • Then start ranging operation.
Note:
This function Access to the device
Parameters:
pDeviceParametersPointer to store current device parameters.
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error
VL53L0X_Error VL53L0X_update_byte ( uint8_t  index,
uint8_t  and_data,
uint8_t  or_data 
) [inherited]

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

Final_reg = (Initial_reg & and_data) |or_data

Parameters:
indexThe register index
and_data8 bit and data
or_data8 bit or data
Returns:
VL53L0X_ERROR_NONE Success
"Other error code" See VL53L0X_Error

Definition at line 4491 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_write_byte ( uint8_t  index,
uint8_t  data 
) [inherited]

Write single byte register.

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

Definition at line 4444 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_write_dword ( uint8_t  index,
uint32_t  data 
) [inherited]

Write double word (4 byte) register.

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

Definition at line 4458 of file VL53L0X.cpp.

VL53L0X_Error VL53L0X_write_word ( uint8_t  index,
uint16_t  data 
) [inherited]

Write word register.

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

Definition at line 4448 of file VL53L0X.cpp.


Variable Documentation

uint16_t comms_speed_khz [inherited]

Comms speed [kHz] : typically 400kHz for I2C

Definition at line 1729 of file VL53L0X.h.

uint8_t comms_type [inherited]

Type of comms : VL53L0X_COMMS_I2C or VL53L0X_COMMS_SPI

Definition at line 1728 of file VL53L0X.h.

VL53L0X_DeviceParameters_t CurrentParameters [inherited]

Current Device Parameter

Definition at line 1721 of file VL53L0X.h.

uint8_t I2cDevAddr [inherited]

i2c device address user specific field

Definition at line 1727 of file VL53L0X.h.

VL53L0X_RangingMeasurementData_t LastRangeMeasure [inherited]

Last Performed Ranging Data

Definition at line 1722 of file VL53L0X.h.