Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
tfmini_i2c.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 OpenUAS <noreply@openuas.org>
3  * Thanks to Michal Podhradsky for SF11 work done
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  *
22  */
23 
31 #ifndef TFMINI_I2C_H
32 #define TFMINI_I2C_H
33 
34 #include "stdbool.h"
35 #include "mcu_periph/i2c.h"
36 
40 };
41 
42 struct TFMiniI2C {
48  float dist;
49  float offset;
50  bool update_agl;
51  bool compensate_rotation; //< Do or not compensate for range value when main body is rotated
52 };
53 
54 extern struct TFMiniI2C tfmini_i2c;
55 
56 extern void tfmini_i2c_init(void);
57 extern void tfmini_i2c_event(void);
58 extern void tfmini_i2c_periodic(void);
59 extern void tfmini_i2c_downlink(void);
60 
61 #endif /* TFMINI_I2C_H */
uint16_t
unsigned short uint16_t
Definition: types.h:16
TFMiniI2C::status
enum TFMiniI2CStatus status
Definition: tfmini_i2c.h:45
TFMiniI2C::addr
uint8_t addr
Definition: tfmini_i2c.h:44
tfmini_i2c_event
void tfmini_i2c_event(void)
Ranger event function Basically just check the progress of the transation to prevent overruns during ...
Definition: tfmini_i2c.c:167
TFMiniI2C::update_agl
bool update_agl
Do or don't update AGL ABI message.
Definition: tfmini_i2c.h:50
TFMiniI2C::raw_dist
uint16_t raw_dist
raw non scaled value from sensor
Definition: tfmini_i2c.h:46
tfmini_i2c_init
void tfmini_i2c_init(void)
Set the default values at initialization.
Definition: tfmini_i2c.c:142
TFMINI_I2C_PARSE
@ TFMINI_I2C_PARSE
Definition: tfmini_i2c.h:39
TFMiniI2C::strength
uint16_t strength
strength of reflect signal, not implemented ATM
Definition: tfmini_i2c.h:47
tfmini_i2c
struct TFMiniI2C tfmini_i2c
Definition: tfmini_i2c.c:125
TFMiniI2C
Definition: tfmini_i2c.h:42
TFMiniI2C::trans
struct i2c_transaction trans
Definition: tfmini_i2c.h:43
uint8_t
unsigned char uint8_t
Definition: types.h:14
TFMINI_I2C_ACQUIRE
@ TFMINI_I2C_ACQUIRE
Definition: tfmini_i2c.h:38
i2c_transaction
I2C transaction structure.
Definition: i2c.h:93
TFMiniI2CStatus
TFMiniI2CStatus
Definition: tfmini_i2c.h:37
tfmini_i2c_downlink
void tfmini_i2c_downlink(void)
Definition: tfmini_i2c.c:247
tfmini_i2c_periodic
void tfmini_i2c_periodic(void)
Get the ranger current distance value.
Definition: tfmini_i2c.c:196
TFMiniI2C::offset
float offset
offset to what one considers a zero distance to sensor in [m]
Definition: tfmini_i2c.h:49
TFMiniI2C::compensate_rotation
bool compensate_rotation
Definition: tfmini_i2c.h:51
i2c.h
TFMiniI2C::dist
float dist
Sacled distance measured in [m].
Definition: tfmini_i2c.h:48