MRMS
Functions
PAL Register Access Functions

PAL Register Access Functions. More...

Functions

VL53L0X_Error VL53L0X_LockSequenceAccess (VL53L0X_DEV Dev)
 
VL53L0X_Error VL53L0X_UnlockSequenceAccess (VL53L0X_DEV Dev)
 
VL53L0X_Error VL53L0X_WriteMulti (VL53L0X_DEV Dev, uint8_t index, uint8_t *pdata, uint32_t count)
 
VL53L0X_Error VL53L0X_ReadMulti (VL53L0X_DEV Dev, uint8_t index, uint8_t *pdata, uint32_t count)
 
VL53L0X_Error VL53L0X_WrByte (VL53L0X_DEV Dev, uint8_t index, uint8_t data)
 
VL53L0X_Error VL53L0X_WrWord (VL53L0X_DEV Dev, uint8_t index, uint16_t data)
 
VL53L0X_Error VL53L0X_WrDWord (VL53L0X_DEV Dev, uint8_t index, uint32_t data)
 
VL53L0X_Error VL53L0X_RdByte (VL53L0X_DEV Dev, uint8_t index, uint8_t *data)
 
VL53L0X_Error VL53L0X_RdWord (VL53L0X_DEV Dev, uint8_t index, uint16_t *data)
 
VL53L0X_Error VL53L0X_RdDWord (VL53L0X_DEV Dev, uint8_t index, uint32_t *data)
 
VL53L0X_Error VL53L0X_UpdateByte (VL53L0X_DEV Dev, uint8_t index, uint8_t AndData, uint8_t OrData)
 

Detailed Description

PAL Register Access Functions.

Function Documentation

◆ VL53L0X_LockSequenceAccess()

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_RdByte()

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_RdDWord()

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_RdWord()

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_ReadMulti()

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_UnlockSequenceAccess()

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_UpdateByte()

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_WrByte()

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_WrDWord()

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_WriteMulti()

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_WrWord()

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