Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
lidar_lite.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Michal Podhradsky <michal.podhradsky@aggiemail.usu.edu>
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  */
22 
33 #ifndef LIDAR_LITE_I2C_H
34 #define LIDAR_LITE_I2C_H
35 
36 #include "std.h"
37 #include "mcu_periph/i2c.h"
38 
44 };
45 
46 struct LidarLite
47 {
48  struct i2c_transaction trans;
51  float distance; // [m]
53  bool update_agl;
55 };
56 
57 extern struct LidarLite lidar_lite;
58 
59 extern void lidar_lite_init(void);
60 extern void lidar_lite_event(void);
61 extern void lidar_lite_periodic(void);
62 extern void lidar_lite_downlink(void);
63 
64 #endif /* LIDAR_LITE_I2C_H */
65 
I2C transaction structure.
Definition: i2c.h:93
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
uint32_t distance_raw
Definition: lidar_lite.h:50
LidarLiteStatus
Definition: lidar_lite.h:39
@ LIDAR_LITE_REQ_READ
Definition: lidar_lite.h:41
@ LIDAR_LITE_READ_DISTANCE
Definition: lidar_lite.h:42
@ LIDAR_LITE_PARSE
Definition: lidar_lite.h:43
@ LIDAR_LITE_INIT_RANGING
Definition: lidar_lite.h:40
float distance
Definition: lidar_lite.h:51
void lidar_lite_downlink(void)
Downlink message for debug.
Definition: lidar_lite.c:173
uint8_t addr
Definition: lidar_lite.h:49
void lidar_lite_init(void)
Initialization function.
Definition: lidar_lite.c:56
bool compensate_rotation
Definition: lidar_lite.h:54
void lidar_lite_event(void)
Lidar event function Basically just check the progress of the transation to prevent overruns during h...
Definition: lidar_lite.c:76
bool update_agl
Definition: lidar_lite.h:53
void lidar_lite_periodic(void)
Poll lidar for data for altitude hold 50Hz-100Hz should be enough, in theory can go faster (see the d...
Definition: lidar_lite.c:106
struct i2c_transaction trans
Definition: lidar_lite.h:48
enum LidarLiteStatus status
Definition: lidar_lite.h:52
struct LidarLite lidar_lite
Definition: lidar_lite.c:45
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98