Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
vl53l1x_nonblocking.h File Reference

Non-blocking runtime functions for the VL53L1X. More...

#include "vl53l1x_api.h"
#include <stdbool.h>
+ Include dependency graph for vl53l1x_nonblocking.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool VL53L1X_NonBlocking_CheckForDataReady (VL53L1_DEV dev, uint8_t *isDataReady)
 This function checks if the new ranging data is available by polling the dedicated register. More...
 
bool VL53L1X_NonBlocking_GetRangeStatus (VL53L1_DEV dev, uint8_t *rangeStatus)
 This function returns the range status to discard wrong measurments. More...
 
bool VL53L1X_NonBlocking_GetDistance (VL53L1_DEV dev, uint16_t *distance)
 This function returns the distance measured by the sensor in mm. More...
 
bool VL53L1X_NonBlocking_ClearInterrupt (VL53L1_DEV dev)
 This function clears the interrupt, to be called after a ranging data reading to arm the interrupt for the next data ready event. More...
 
bool VL53L1X_NonBlocking_ReadDataEvent (VL53L1_DEV dev, uint16_t *distance_mm, bool *new_data)
 Implement non-blocking read sequence The data reading actually starts when the read_state is set to VL53L1_READ_DATA_READY using VL53L1X_NonBlocking_RequestData() More...
 
bool VL53L1X_NonBlocking_IsIdle (VL53L1_DEV dev)
 Test is read status is on idle. More...
 
bool VL53L1X_NonBlocking_RequestData (VL53L1_DEV dev)
 Request a new reading. More...
 

Detailed Description

Non-blocking runtime functions for the VL53L1X.

Definition in file vl53l1x_nonblocking.h.

Function Documentation

◆ VL53L1X_NonBlocking_CheckForDataReady()

bool VL53L1X_NonBlocking_CheckForDataReady ( VL53L1_DEV  dev,
uint8_t isDataReady 
)

This function checks if the new ranging data is available by polling the dedicated register.

Parameters
isDataReady==0 -> not ready; isDataReady==1 -> ready
Returns
: TRUE upon completion

Definition at line 89 of file vl53l1x_nonblocking.c.

References dev, GPIO__TIO_HV_STATUS, GPIO_HV_MUX__CTRL, and VL53L1_NonBlocking_ReadMulti().

Referenced by VL53L1X_NonBlocking_ReadDataEvent().

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

◆ VL53L1X_NonBlocking_ClearInterrupt()

bool VL53L1X_NonBlocking_ClearInterrupt ( VL53L1_DEV  dev)

This function clears the interrupt, to be called after a ranging data reading to arm the interrupt for the next data ready event.

Returns
: TRUE upon completion

Definition at line 138 of file vl53l1x_nonblocking.c.

References dev, SYSTEM__INTERRUPT_CLEAR, and VL53L1_NonBlocking_WriteMulti().

Referenced by VL53L1X_NonBlocking_ReadDataEvent().

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

◆ VL53L1X_NonBlocking_GetDistance()

bool VL53L1X_NonBlocking_GetDistance ( VL53L1_DEV  dev,
uint16_t distance 
)

This function returns the distance measured by the sensor in mm.

Returns
: TRUE upon completion

Definition at line 128 of file vl53l1x_nonblocking.c.

References dev, VL53L1_NonBlocking_ReadMulti(), and VL53L1_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0.

Referenced by VL53L1X_NonBlocking_ReadDataEvent().

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

◆ VL53L1X_NonBlocking_GetRangeStatus()

bool VL53L1X_NonBlocking_GetRangeStatus ( VL53L1_DEV  dev,
uint8_t rangeStatus 
)

This function returns the range status to discard wrong measurments.

Parameters
rangeStatus (0:no error, 1:sigma failed, 2:signal failed, ..., 7:wrap-around)
Returns
: TRUE upon completion

Definition at line 115 of file vl53l1x_nonblocking.c.

References dev, status_rtn, VL53L1_NonBlocking_ReadMulti(), and VL53L1_RESULT__RANGE_STATUS.

Referenced by VL53L1X_NonBlocking_ReadDataEvent().

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

◆ VL53L1X_NonBlocking_IsIdle()

bool VL53L1X_NonBlocking_IsIdle ( VL53L1_DEV  dev)

Test is read status is on idle.

Returns
: TRUE if idle

Definition at line 190 of file vl53l1x_nonblocking.c.

References dev, and VL53L1_READ_IDLE.

Referenced by multi_ranger_periodic(), and sonar_vl53l1x_read().

+ Here is the caller graph for this function:

◆ VL53L1X_NonBlocking_ReadDataEvent()

bool VL53L1X_NonBlocking_ReadDataEvent ( VL53L1_DEV  dev,
uint16_t distance_mm,
bool *  new_data 
)

Implement non-blocking read sequence The data reading actually starts when the read_state is set to VL53L1_READ_DATA_READY using VL53L1X_NonBlocking_RequestData()

Parameters
distance measurement in millimeter
flag when a new data is available
Returns
: TRUE when a complete read sequence is finished

Definition at line 144 of file vl53l1x_nonblocking.c.

References dev, VL53L1_CLEAR_INT, VL53L1_READ_DATA_READY, VL53L1_READ_DISTANCE, VL53L1_READ_IDLE, VL53L1_READ_STATUS, VL53L1X_NonBlocking_CheckForDataReady(), VL53L1X_NonBlocking_ClearInterrupt(), VL53L1X_NonBlocking_GetDistance(), and VL53L1X_NonBlocking_GetRangeStatus().

Referenced by multi_ranger_read(), and sonar_vl53l1x_event().

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

◆ VL53L1X_NonBlocking_RequestData()

bool VL53L1X_NonBlocking_RequestData ( VL53L1_DEV  dev)

Request a new reading.

Returns
: TRUE if request successful

Definition at line 195 of file vl53l1x_nonblocking.c.

References dev, and VL53L1_READ_DATA_READY.

Referenced by multi_ranger_periodic(), and sonar_vl53l1x_read().

+ Here is the caller graph for this function: