Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
airspeed_ets.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2009 Vassilis Varveropoulos
3
* Modified by Mark Griffin on 8 September 2010 to work with new i2c transaction routines.
4
* Converted by Gautier Hattenberger to modules (10/2010)
5
*
6
* This file is part of paparazzi.
7
*
8
* paparazzi is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2, or (at your option)
11
* any later version.
12
*
13
* paparazzi is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with paparazzi; see the file COPYING. If not, write to
20
* the Free Software Foundation, 59 Temple Place - Suite 330,
21
* Boston, MA 02111-1307, USA.
22
*/
23
41
#ifndef AIRSPEED_ETS_H
42
#define AIRSPEED_ETS_H
43
44
#include "
std.h
"
45
#include "
mcu_periph/i2c.h
"
46
47
extern
uint16_t
airspeed_ets_raw
;
48
extern
uint16_t
airspeed_ets_offset
;
49
extern
bool
airspeed_ets_valid
;
50
extern
float
airspeed_ets
;
51
52
extern
struct
i2c_transaction
airspeed_ets_i2c_trans
;
53
54
extern
void
airspeed_ets_init
(
void
);
55
extern
void
airspeed_ets_read_periodic
(
void
);
56
extern
void
airspeed_ets_read_event
(
void
);
57
58
static
inline
void
AirspeedEtsEvent
(
void
)
59
{
60
if
(
airspeed_ets_i2c_trans
.
status
==
I2CTransSuccess
) {
61
airspeed_ets_read_event
();
62
}
else
if
(
airspeed_ets_i2c_trans
.
status
==
I2CTransFailed
) {
63
// if transaction failed, mark as done so can be retried
64
airspeed_ets_i2c_trans
.
status
=
I2CTransDone
;
65
}
66
}
67
68
#endif // AIRSPEED_ETS_H
uint16_t
unsigned short uint16_t
Definition:
types.h:16
airspeed_ets_offset
uint16_t airspeed_ets_offset
Definition:
airspeed_ets.c:97
airspeed_ets_init
void airspeed_ets_init(void)
Definition:
airspeed_ets.c:113
I2CTransFailed
@ I2CTransFailed
transaction failed
Definition:
i2c.h:58
airspeed_ets_i2c_trans
struct i2c_transaction airspeed_ets_i2c_trans
Definition:
airspeed_ets.c:103
I2CTransSuccess
@ I2CTransSuccess
transaction successfully finished by I2C driver
Definition:
i2c.h:57
std.h
airspeed_ets
float airspeed_ets
Definition:
airspeed_ets.c:99
airspeed_ets_read_periodic
void airspeed_ets_read_periodic(void)
Definition:
airspeed_ets.c:142
i2c_transaction::status
enum I2CTransactionStatus status
Transaction status.
Definition:
i2c.h:126
airspeed_ets_raw
uint16_t airspeed_ets_raw
Definition:
airspeed_ets.c:96
i2c_transaction
I2C transaction structure.
Definition:
i2c.h:93
airspeed_ets_valid
bool airspeed_ets_valid
Definition:
airspeed_ets.c:98
I2CTransDone
@ I2CTransDone
transaction set to done by user level
Definition:
i2c.h:59
airspeed_ets_read_event
void airspeed_ets_read_event(void)
Definition:
airspeed_ets.c:158
i2c.h
AirspeedEtsEvent
static void AirspeedEtsEvent(void)
Definition:
airspeed_ets.h:58
sw
airborne
modules
sensors
airspeed_ets.h
Generated on Tue Feb 1 2022 13:51:16 for Paparazzi UAS by
1.8.17