Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
vl53l1x_nonblocking.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Tom van Dijk <tomvand@users.noreply.github.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
26 #ifndef VL53L1X_NONBLOCKING_H
27 #define VL53L1X_NONBLOCKING_H
28 
29 
30 #include "vl53l1x_api.h"
31 
32 #include <stdbool.h>
33 
34 
41 
48 
54 
61 
68 bool VL53L1X_NonBlocking_ReadDataEvent(VL53L1_DEV dev, uint16_t *distance_mm, bool *new_data);
69 
74 
79 
80 #endif // VL53L1X_NONBLOCKING_H
uint16_t
unsigned short uint16_t
Definition: types.h:16
VL53L1X_NonBlocking_RequestData
bool VL53L1X_NonBlocking_RequestData(VL53L1_DEV dev)
Request a new reading.
Definition: vl53l1x_nonblocking.c:195
VL53L1X_NonBlocking_GetRangeStatus
bool VL53L1X_NonBlocking_GetRangeStatus(VL53L1_DEV dev, uint8_t *rangeStatus)
This function returns the range status to discard wrong measurments.
Definition: vl53l1x_nonblocking.c:115
VL53L1X_NonBlocking_GetDistance
bool VL53L1X_NonBlocking_GetDistance(VL53L1_DEV dev, uint16_t *distance)
This function returns the distance measured by the sensor in mm.
Definition: vl53l1x_nonblocking.c:128
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 V...
Definition: vl53l1x_nonblocking.c:144
vl53l1x_api.h
Functions definition.
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 fo...
Definition: vl53l1x_nonblocking.c:138
dev
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
uint8_t
unsigned char uint8_t
Definition: types.h:14
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.
Definition: vl53l1x_nonblocking.c:89
VL53L1X_NonBlocking_IsIdle
bool VL53L1X_NonBlocking_IsIdle(VL53L1_DEV dev)
Test is read status is on idle.
Definition: vl53l1x_nonblocking.c:190
VL53L1_Dev_t
Definition: vl53l1_platform.h:50