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_sf11.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
26 #ifndef LIDAR_SF11_I2C_H
27 #define LIDAR_SF11_I2C_H
28 
29 #include "std.h"
30 #include "mcu_periph/i2c.h"
31 
35 };
36 
37 struct LidarSF11
38 {
42  float distance; // [m]
44  bool update_agl;
46 };
47 
48 extern struct LidarSF11 lidar_sf11;
49 
50 extern void lidar_sf11_init(void);
51 extern void lidar_sf11_event(void);
52 extern void lidar_sf11_periodic(void);
53 extern void lidar_sf11_downlink(void);
54 
55 #endif /* LIDAR_SF11_I2C_H */
struct i2c_transaction trans
Definition: lidar_sf11.h:39
enum LidarSF11Status status
Definition: lidar_sf11.h:43
struct LidarSF11 lidar_sf11
Definition: lidar_sf11.c:37
void lidar_sf11_event(void)
Lidar event function Check if the transaction succeded before reading the result. ...
Definition: lidar_sf11.c:62
void lidar_sf11_downlink(void)
Downlink message for debug.
Definition: lidar_sf11.c:134
unsigned long uint32_t
Definition: types.h:18
LidarSF11Status
Definition: lidar_sf11.h:32
void lidar_sf11_periodic(void)
Poll lidar for data.
Definition: lidar_sf11.c:92
I2C transaction structure.
Definition: i2c.h:93
uint8_t addr
Definition: lidar_sf11.h:40
bool update_agl
Definition: lidar_sf11.h:44
uint32_t distance_raw
Definition: lidar_sf11.h:41
void lidar_sf11_init(void)
Initialization function.
Definition: lidar_sf11.c:44
unsigned char uint8_t
Definition: types.h:14
bool compensate_rotation
Definition: lidar_sf11.h:45
float distance
Definition: lidar_sf11.h:42
Architecture independent I2C (Inter-Integrated Circuit Bus) API.