Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_ets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Vassilis Varveropoulos
3  * Copyright (C) 2010 The Paparazzi Team
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 
42 #ifndef BARO_ETS_H
43 #define BARO_ETS_H
44 
45 #include "std.h"
46 #include "mcu_periph/i2c.h"
47 
49 #define BARO_ETS_DT BARO_ETS_READ_PERIODIC_PERIOD
50 
51 extern uint16_t baro_ets_adc;
53 extern bool_t baro_ets_valid;
54 extern bool_t baro_ets_updated;
55 extern bool_t baro_ets_enabled;
56 extern float baro_ets_altitude;
57 extern float baro_ets_r;
58 extern float baro_ets_sigma2;
59 
61 
62 extern void baro_ets_init( void );
63 extern void baro_ets_read_periodic( void );
64 extern void baro_ets_read_event( void );
65 
66 #define BaroEtsEvent() { if (baro_ets_i2c_trans.status == I2CTransSuccess) baro_ets_read_event(); }
67 
68 #define BaroEtsUpdate(_b, _h) { if (baro_ets_valid) { _b = baro_ets_adc; _h(); baro_ets_valid = FALSE; } }
69 
70 #endif // BARO_ETS_H
unsigned short uint16_t
Definition: types.h:16
bool_t baro_ets_enabled
Definition: baro_ets.c:84
float baro_ets_sigma2
Definition: baro_ets.c:86
void baro_ets_init(void)
Definition: baro_ets.c:95
void baro_ets_read_event(void)
Definition: baro_ets.c:131
bool_t baro_ets_valid
Definition: baro_ets.c:82
float baro_ets_altitude
Definition: baro_ets.c:83
void baro_ets_read_periodic(void)
Definition: baro_ets.c:110
uint16_t baro_ets_adc
Definition: baro_ets.c:80
bool_t baro_ets_updated
struct i2c_transaction baro_ets_i2c_trans
Definition: baro_ets.c:88
float baro_ets_r
Definition: baro_ets.c:85
uint16_t baro_ets_offset
Definition: baro_ets.c:81
Architecture independent I2C (Inter-Integrated Circuit Bus) API.