Paparazzi UAS
v5.18.0_stable
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
32
enum
LidarSF11Status
{
33
LIDAR_SF11_REQ_READ
,
34
LIDAR_SF11_READ_OK
35
};
36
37
struct
LidarSF11
38
{
39
struct
i2c_transaction
trans
;
40
uint8_t
addr
;
41
uint32_t
distance_raw
;
// [cm]
42
float
distance
;
// [m]
43
enum
LidarSF11Status
status
;
44
bool
update_agl
;
45
bool
compensate_rotation
;
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 */
LIDAR_SF11_REQ_READ
@ LIDAR_SF11_REQ_READ
Definition:
lidar_sf11.h:33
LIDAR_SF11_READ_OK
@ LIDAR_SF11_READ_OK
Definition:
lidar_sf11.h:34
LidarSF11::addr
uint8_t addr
Definition:
lidar_sf11.h:40
LidarSF11::update_agl
bool update_agl
Definition:
lidar_sf11.h:44
lidar_sf11_event
void lidar_sf11_event(void)
Lidar event function Check if the transaction succeded before reading the result.
Definition:
lidar_sf11.c:62
uint32_t
unsigned long uint32_t
Definition:
types.h:18
LidarSF11::distance
float distance
Definition:
lidar_sf11.h:42
LidarSF11::status
enum LidarSF11Status status
Definition:
lidar_sf11.h:43
lidar_sf11_periodic
void lidar_sf11_periodic(void)
Poll lidar for data.
Definition:
lidar_sf11.c:92
std.h
LidarSF11::compensate_rotation
bool compensate_rotation
Definition:
lidar_sf11.h:45
LidarSF11::distance_raw
uint32_t distance_raw
Definition:
lidar_sf11.h:41
uint8_t
unsigned char uint8_t
Definition:
types.h:14
i2c_transaction
I2C transaction structure.
Definition:
i2c.h:93
LidarSF11Status
LidarSF11Status
Definition:
lidar_sf11.h:32
lidar_sf11_downlink
void lidar_sf11_downlink(void)
Downlink message for debug.
Definition:
lidar_sf11.c:134
LidarSF11::trans
struct i2c_transaction trans
Definition:
lidar_sf11.h:39
i2c.h
lidar_sf11
struct LidarSF11 lidar_sf11
Definition:
lidar_sf11.c:37
lidar_sf11_init
void lidar_sf11_init(void)
Initialization function.
Definition:
lidar_sf11.c:44
LidarSF11
Definition:
lidar_sf11.h:37
sw
airborne
modules
lidar
lidar_sf11.h
Generated on Tue Feb 1 2022 13:51:16 for Paparazzi UAS by
1.8.17