Paparazzi UAS
v5.18.0_stable
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
33
enum
TFMiniParseStatus
{
34
TFMINI_INITIALIZE
,
35
TFMINI_PARSE_HEAD
,
36
TFMINI_PARSE_HEAD2
,
37
TFMINI_PARSE_DIST_L
,
38
TFMINI_PARSE_DIST_H
,
39
TFMINI_PARSE_STRENGTH_L
,
40
TFMINI_PARSE_STRENGTH_H
,
41
TFMINI_PARSE_MODE
,
42
TFMINI_PARSE_BYTE7
,
43
TFMINI_PARSE_CHECKSUM
44
};
45
46
struct
TFMini
{
47
struct
link_device *
device
;
48
enum
TFMiniParseStatus
parse_status
;
49
uint8_t
parse_crc
;
50
uint16_t
raw_dist
;
51
uint16_t
raw_strength
;
52
uint8_t
raw_mode
;
53
54
uint16_t
strength
;
55
float
distance
;
// [m]
56
uint8_t
mode
;
57
bool
update_agl
;
58
bool
compensate_rotation
;
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
uint16_t
unsigned short uint16_t
Definition:
types.h:16
TFMiniParseStatus
TFMiniParseStatus
Definition:
tfmini.h:33
TFMini::raw_strength
uint16_t raw_strength
Definition:
tfmini.h:51
TFMini::raw_mode
uint8_t raw_mode
Definition:
tfmini.h:52
TFMINI_PARSE_BYTE7
@ TFMINI_PARSE_BYTE7
Definition:
tfmini.h:42
TFMINI_PARSE_HEAD2
@ TFMINI_PARSE_HEAD2
Definition:
tfmini.h:36
TFMini::strength
uint16_t strength
Definition:
tfmini.h:54
TFMINI_PARSE_CHECKSUM
@ TFMINI_PARSE_CHECKSUM
Definition:
tfmini.h:43
tfmini_downlink
void tfmini_downlink(void)
TFMini::mode
uint8_t mode
Definition:
tfmini.h:56
TFMINI_PARSE_STRENGTH_L
@ TFMINI_PARSE_STRENGTH_L
Definition:
tfmini.h:39
TFMini
Definition:
tfmini.h:46
TFMINI_PARSE_DIST_H
@ TFMINI_PARSE_DIST_H
Definition:
tfmini.h:38
TFMini::raw_dist
uint16_t raw_dist
Definition:
tfmini.h:50
TFMINI_PARSE_HEAD
@ TFMINI_PARSE_HEAD
Definition:
tfmini.h:35
TFMini::update_agl
bool update_agl
Definition:
tfmini.h:57
std.h
tfmini_event
void tfmini_event(void)
Lidar event function Receive bytes from the UART port and parse them.
Definition:
tfmini.c:84
TFMINI_PARSE_DIST_L
@ TFMINI_PARSE_DIST_L
Definition:
tfmini.h:37
uint8_t
unsigned char uint8_t
Definition:
types.h:14
TFMini::parse_crc
uint8_t parse_crc
Definition:
tfmini.h:49
TFMINI_PARSE_STRENGTH_H
@ TFMINI_PARSE_STRENGTH_H
Definition:
tfmini.h:40
tfmini
struct TFMini tfmini
Definition:
tfmini.c:38
TFMini::compensate_rotation
bool compensate_rotation
Definition:
tfmini.h:58
TFMINI_PARSE_MODE
@ TFMINI_PARSE_MODE
Definition:
tfmini.h:41
TFMini::distance
float distance
Definition:
tfmini.h:55
TFMini::device
struct link_device * device
Definition:
tfmini.h:47
TFMINI_INITIALIZE
@ TFMINI_INITIALIZE
Definition:
tfmini.h:34
i2c.h
TFMini::parse_status
enum TFMiniParseStatus parse_status
Definition:
tfmini.h:48
tfmini_init
void tfmini_init(void)
Initialization function.
Definition:
tfmini.c:64
sw
airborne
modules
lidar
tfmini.h
Generated on Tue Feb 1 2022 13:51:16 for Paparazzi UAS by
1.8.17