Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Non-blocking runtime functions for the VL53L1X. More...
Go to the source code of this file.
Functions | |
static bool | VL53L1_NonBlocking_WriteMulti (VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count) |
static bool | VL53L1_NonBlocking_ReadMulti (VL53L1_DEV dev, uint16_t index, uint8_t *pdata, uint32_t count) |
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... | |
Variables | |
static const uint8_t | status_rtn [24] |
Non-blocking runtime functions for the VL53L1X.
These functions are adapted from vl53l1x_api.c to use the non-blocking version of I2C functions.
Definition in file vl53l1x_nonblocking.c.
|
static |
Definition at line 64 of file vl53l1x_nonblocking.c.
References dev, I2C_BUF_LEN, i2c_transceive(), I2CTransFailed, and I2CTransSuccess.
Referenced by VL53L1X_NonBlocking_CheckForDataReady(), VL53L1X_NonBlocking_GetDistance(), and VL53L1X_NonBlocking_GetRangeStatus().
|
static |
Definition at line 39 of file vl53l1x_nonblocking.c.
References dev, I2C_BUF_LEN, i2c_transmit(), I2CTransFailed, and I2CTransSuccess.
Referenced by VL53L1X_NonBlocking_ClearInterrupt().
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.
isDataReady==0 -> not ready; isDataReady==1 -> ready |
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().
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.
Definition at line 138 of file vl53l1x_nonblocking.c.
References dev, SYSTEM__INTERRUPT_CLEAR, and VL53L1_NonBlocking_WriteMulti().
Referenced by VL53L1X_NonBlocking_ReadDataEvent().
bool VL53L1X_NonBlocking_GetDistance | ( | VL53L1_DEV | dev, |
uint16_t * | distance | ||
) |
This function returns the distance measured by the sensor in mm.
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().
bool VL53L1X_NonBlocking_GetRangeStatus | ( | VL53L1_DEV | dev, |
uint8_t * | rangeStatus | ||
) |
This function returns the range status to discard wrong measurments.
rangeStatus (0:no error, 1:sigma failed, 2:signal failed, ..., 7:wrap-around) |
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().
bool VL53L1X_NonBlocking_IsIdle | ( | VL53L1_DEV | dev | ) |
Test is read status is on 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().
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()
distance measurement in millimeter | |
flag when a new data is available |
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().
bool VL53L1X_NonBlocking_RequestData | ( | VL53L1_DEV | dev | ) |
Request a new reading.
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().
|
static |
Definition at line 34 of file vl53l1x_nonblocking.c.
Referenced by VL53L1X_NonBlocking_GetRangeStatus().