Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
vl53l5cx_platform.c File Reference
#include "lidar/vl53l5cx_platform.h"
#include "hal.h"
+ Include dependency graph for vl53l5cx_platform.c:

Go to the source code of this file.

Macros

#define VL53L5_I2C_TIMEOUT   chTimeMS2I(100)
 

Functions

uint8_t RdByte (VL53L5CX_Platform *dev, uint16_t index, uint8_t *p_data)
 
uint8_t WrByte (VL53L5CX_Platform *dev, uint16_t index, uint8_t data)
 Mandatory function used to write one single byte. More...
 
uint8_t WrMulti (VL53L5CX_Platform *dev, uint16_t index, uint8_t *pdata, uint32_t count)
 Mandatory function used to write multiples bytes. More...
 
uint8_t RdMulti (VL53L5CX_Platform *dev, uint16_t index, uint8_t *pdata, uint32_t count)
 Mandatory function used to read multiples bytes. More...
 
void SwapBuffer (uint8_t *buffer, uint16_t size)
 Optional function, only used to perform an hardware reset of the sensor. More...
 
uint8_t WaitMs (VL53L5CX_Platform *p_platform, uint32_t TimeMs)
 Mandatory function, used to wait during an amount of time. More...
 

Macro Definition Documentation

◆ VL53L5_I2C_TIMEOUT

#define VL53L5_I2C_TIMEOUT   chTimeMS2I(100)

Definition at line 17 of file vl53l5cx_platform.c.

Function Documentation

◆ RdByte()

uint8_t RdByte ( VL53L5CX_Platform p_platform,
uint16_t  RegisterAdress,
uint8_t p_value 
)
Parameters
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of value to read.
(uint8_t)*p_values : Pointer of value to read.
Returns
(uint8_t) status : 0 if OK

Definition at line 20 of file vl53l5cx_platform.c.

References dev, and RdMulti().

Referenced by _vl53l5cx_poll_for_mcu_boot(), vl53l5cx_get_power_mode(), vl53l5cx_init(), vl53l5cx_is_alive(), and vl53l5cx_stop_ranging().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RdMulti()

uint8_t RdMulti ( VL53L5CX_Platform p_platform,
uint16_t  RegisterAdress,
uint8_t p_values,
uint32_t  size 
)

Mandatory function used to read multiples bytes.

Parameters
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of values to read.
(uint8_t)*p_values : Buffer of bytes to read.
(uint32_t)size : Size of *p_values buffer.
Returns
(uint8_t) status : 0 if OK

Definition at line 64 of file vl53l5cx_platform.c.

References dev, Min, offset, VL53L5_I2C_TIMEOUT, and VL53L5CX_I2C_BUF_SIZE.

Referenced by _vl53l5cx_poll_for_answer(), RdByte(), vl53l5cx_check_data_ready(), vl53l5cx_dci_read_data(), vl53l5cx_get_ranging_data(), vl53l5cx_init(), and vl53l5cx_stop_ranging().

+ Here is the caller graph for this function:

◆ SwapBuffer()

void SwapBuffer ( uint8_t buffer,
uint16_t  size 
)

Optional function, only used to perform an hardware reset of the sensor.

This function is not used in the API, but it can be used by the host. This function is not mandatory to fill if user don't want to reset the sensor.

Parameters
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
Returns
(uint8_t) status : 0 if OK

Mandatory function, used to swap a buffer. The buffer size is always a multiple of 4 (4, 8, 12, 16, ...).

Parameters
(uint8_t*)buffer : Buffer to swap, generally uint32_t
(uint16_t)size : Buffer size to swap

Definition at line 92 of file vl53l5cx_platform.c.

Referenced by _vl53l5cx_send_offset_data(), _vl53l5cx_send_xtalk_data(), vl53l5cx_dci_read_data(), vl53l5cx_dci_write_data(), and vl53l5cx_get_ranging_data().

+ Here is the caller graph for this function:

◆ WaitMs()

uint8_t WaitMs ( VL53L5CX_Platform p_platform,
uint32_t  TimeMs 
)

Mandatory function, used to wait during an amount of time.

It must be filled as it's used into the API.

Parameters
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint32_t)TimeMs : Time to wait in ms.
Returns
(uint8_t) status : 0 if wait is finished.

Definition at line 111 of file vl53l5cx_platform.c.

Referenced by _vl53l5cx_poll_for_answer(), _vl53l5cx_poll_for_mcu_boot(), vl53l5cx_init(), and vl53l5cx_stop_ranging().

+ Here is the caller graph for this function:

◆ WrByte()

uint8_t WrByte ( VL53L5CX_Platform p_platform,
uint16_t  RegisterAdress,
uint8_t  value 
)

Mandatory function used to write one single byte.

Parameters
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of value to read.
(uint8_t)value : Pointer of value to write.
Returns
(uint8_t) status : 0 if OK

Definition at line 28 of file vl53l5cx_platform.c.

References dev, and WrMulti().

Referenced by vl53l5cx_get_power_mode(), vl53l5cx_init(), vl53l5cx_is_alive(), vl53l5cx_set_i2c_address(), vl53l5cx_set_power_mode(), vl53l5cx_start_ranging(), and vl53l5cx_stop_ranging().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WrMulti()

uint8_t WrMulti ( VL53L5CX_Platform p_platform,
uint16_t  RegisterAdress,
uint8_t p_values,
uint32_t  size 
)

Mandatory function used to write multiples bytes.

Parameters
(VL53L5CX_Platform*)p_platform : Pointer of VL53L5CX platform structure.
(uint16_t)Address : I2C location of values to write.
(uint8_t)*p_values : Buffer of bytes to write.
(uint32_t)size : Size of *p_values buffer.
Returns
(uint8_t) status : 0 if OK

Definition at line 36 of file vl53l5cx_platform.c.

References dev, Min, offset, VL53L5_I2C_TIMEOUT, and VL53L5CX_I2C_BUF_SIZE.

Referenced by _vl53l5cx_send_offset_data(), _vl53l5cx_send_xtalk_data(), vl53l5cx_dci_read_data(), vl53l5cx_dci_write_data(), vl53l5cx_init(), vl53l5cx_start_ranging(), and WrByte().

+ Here is the caller graph for this function: