Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 {
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 
void lidar_lite_init(void)
Initialization function.
Definition: lidar_lite.c:56
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
LidarLiteStatus
Definition: lidar_lite.h:39
bool compensate_rotation
Definition: lidar_lite.h:54
float distance
Definition: lidar_lite.h:51
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
unsigned long uint32_t
Definition: types.h:18
uint32_t distance_raw
Definition: lidar_lite.h:50
I2C transaction structure.
Definition: i2c.h:93
uint8_t addr
Definition: lidar_lite.h:49
void lidar_lite_downlink(void)
Downlink message for debug.
Definition: lidar_lite.c:173
unsigned char uint8_t
Definition: types.h:14
enum LidarLiteStatus status
Definition: lidar_lite.h:52
struct LidarLite lidar_lite
Definition: lidar_lite.c:45
Architecture independent I2C (Inter-Integrated Circuit Bus) API.