Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
tfmini.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Freek van Tienen <freek.v.tienen@gmail.com>
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 
27 #ifndef LIDAR_TFMINI_H
28 #define LIDAR_TFMINI_H
29 
30 #include "std.h"
31 #include "mcu_periph/i2c.h"
32 
44 };
45 
46 struct TFMini {
47  struct link_device *device;
53 
55  float distance; // [m]
57  bool update_agl;
59 };
60 
61 extern struct TFMini tfmini;
62 
63 extern void tfmini_init(void);
64 extern void tfmini_event(void);
65 extern void tfmini_downlink(void);
66 
67 #endif /* LIDAR_TFMINI_H */
68 
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
void tfmini_event(void)
Lidar event function Receive bytes from the UART port and parse them.
Definition: tfmini.c:84
uint8_t mode
Definition: tfmini.h:56
float distance
Definition: tfmini.h:55
bool compensate_rotation
Definition: tfmini.h:58
bool update_agl
Definition: tfmini.h:57
uint8_t raw_mode
Definition: tfmini.h:52
uint16_t raw_dist
Definition: tfmini.h:50
uint8_t parse_crc
Definition: tfmini.h:49
struct link_device * device
Definition: tfmini.h:47
uint16_t raw_strength
Definition: tfmini.h:51
void tfmini_downlink(void)
struct TFMini tfmini
Definition: tfmini.c:38
enum TFMiniParseStatus parse_status
Definition: tfmini.h:48
void tfmini_init(void)
Initialization function.
Definition: tfmini.c:64
uint16_t strength
Definition: tfmini.h:54
TFMiniParseStatus
Definition: tfmini.h:33
@ TFMINI_INITIALIZE
Definition: tfmini.h:34
@ TFMINI_PARSE_STRENGTH_L
Definition: tfmini.h:39
@ TFMINI_PARSE_HEAD
Definition: tfmini.h:35
@ TFMINI_PARSE_DIST_L
Definition: tfmini.h:37
@ TFMINI_PARSE_BYTE7
Definition: tfmini.h:42
@ TFMINI_PARSE_HEAD2
Definition: tfmini.h:36
@ TFMINI_PARSE_STRENGTH_H
Definition: tfmini.h:40
@ TFMINI_PARSE_MODE
Definition: tfmini.h:41
@ TFMINI_PARSE_CHECKSUM
Definition: tfmini.h:43
@ TFMINI_PARSE_DIST_H
Definition: tfmini.h:38
Definition: tfmini.h:46
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98