Paparazzi UAS  v5.18.0_stable
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 {
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 
LIDAR_LITE_READ_DISTANCE
@ LIDAR_LITE_READ_DISTANCE
Definition: lidar_lite.h:42
LidarLite::distance
float distance
Definition: lidar_lite.h:51
lidar_lite_init
void lidar_lite_init(void)
Initialization function.
Definition: lidar_lite.c:56
LidarLite::distance_raw
uint32_t distance_raw
Definition: lidar_lite.h:50
LidarLite::addr
uint8_t addr
Definition: lidar_lite.h:49
uint32_t
unsigned long uint32_t
Definition: types.h:18
lidar_lite_periodic
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
LIDAR_LITE_INIT_RANGING
@ LIDAR_LITE_INIT_RANGING
Definition: lidar_lite.h:40
lidar_lite
struct LidarLite lidar_lite
Definition: lidar_lite.c:45
LidarLite::compensate_rotation
bool compensate_rotation
Definition: lidar_lite.h:54
LidarLiteStatus
LidarLiteStatus
Definition: lidar_lite.h:39
std.h
LidarLite::update_agl
bool update_agl
Definition: lidar_lite.h:53
uint8_t
unsigned char uint8_t
Definition: types.h:14
i2c_transaction
I2C transaction structure.
Definition: i2c.h:93
LIDAR_LITE_PARSE
@ LIDAR_LITE_PARSE
Definition: lidar_lite.h:43
LIDAR_LITE_REQ_READ
@ LIDAR_LITE_REQ_READ
Definition: lidar_lite.h:41
LidarLite::status
enum LidarLiteStatus status
Definition: lidar_lite.h:52
LidarLite::trans
struct i2c_transaction trans
Definition: lidar_lite.h:48
lidar_lite_event
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
lidar_lite_downlink
void lidar_lite_downlink(void)
Downlink message for debug.
Definition: lidar_lite.c:173
LidarLite
Definition: lidar_lite.h:46
i2c.h