Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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 {
39  struct i2c_transaction trans;
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 */
I2C transaction structure.
Definition: i2c.h:93
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
uint32_t distance_raw
Definition: lidar_sf11.h:41
void lidar_sf11_init(void)
Initialization function.
Definition: lidar_sf11.c:44
enum LidarSF11Status status
Definition: lidar_sf11.h:43
LidarSF11Status
Definition: lidar_sf11.h:32
@ LIDAR_SF11_REQ_READ
Definition: lidar_sf11.h:33
@ LIDAR_SF11_READ_OK
Definition: lidar_sf11.h:34
struct LidarSF11 lidar_sf11
Definition: lidar_sf11.c:37
void lidar_sf11_periodic(void)
Poll lidar for data.
Definition: lidar_sf11.c:92
void lidar_sf11_downlink(void)
Downlink message for debug.
Definition: lidar_sf11.c:134
uint8_t addr
Definition: lidar_sf11.h:40
void lidar_sf11_event(void)
Lidar event function Check if the transaction succeded before reading the result.
Definition: lidar_sf11.c:62
bool update_agl
Definition: lidar_sf11.h:44
float distance
Definition: lidar_sf11.h:42
bool compensate_rotation
Definition: lidar_sf11.h:45
struct i2c_transaction trans
Definition: lidar_sf11.h:39
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