Paparazzi UAS  v5.15_devel-112-g521f3cf
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_amsys.h
Go to the documentation of this file.
1 /*
2  * Driver for a Amsys Barometric Sensor I2C
3  * AMS 5812-0150-A
4  *
5  * Copyright (C) 2010 The Paparazzi Team
6  *
7  * This file is part of paparazzi.
8  *
9  * paparazzi is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2, or (at your option)
12  * any later version.
13  *
14  * paparazzi is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with paparazzi; see the file COPYING. If not, write to
21  * the Free Software Foundation, 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24 
25 #ifndef BARO_AMSYS_H
26 #define BARO_AMSYS_H
27 
28 #include "std.h"
29 #include "mcu_periph/i2c.h"
30 
32 #define BARO_AMSYS_DT BARO_AMSYS_READ_PERIODIC_PERIOD
33 
35 // extern float baro_amsys_offset;
36 extern bool baro_amsys_valid;
37 extern bool baro_amsys_enabled;
38 extern float baro_amsys_altitude;
39 extern float baro_amsys_r;
40 extern float baro_amsys_sigma2;
41 extern float baro_filter;
42 
44 
45 extern void baro_amsys_init(void);
46 extern void baro_amsys_read_periodic(void);
47 extern void baro_amsys_read_event(void);
48 
49 #define BaroAmsysEvent() { if (baro_amsys_i2c_trans.status == I2CTransSuccess) baro_amsys_read_event(); }
50 
51 #endif // BARO_AMSYS_H
unsigned short uint16_t
Definition: types.h:16
void baro_amsys_init(void)
Definition: baro_amsys.c:97
float baro_amsys_altitude
Definition: baro_amsys.c:76
float baro_amsys_sigma2
Definition: baro_amsys.c:79
uint16_t baro_amsys_adc
Definition: baro_amsys.c:73
float baro_filter
Definition: baro_amsys.c:86
bool baro_amsys_enabled
Definition: baro_amsys.c:77
void baro_amsys_read_event(void)
Definition: baro_amsys.c:138
I2C transaction structure.
Definition: i2c.h:93
bool baro_amsys_valid
Definition: baro_amsys.c:75
float baro_amsys_r
Definition: baro_amsys.c:78
struct i2c_transaction baro_amsys_i2c_trans
Definition: baro_amsys.c:90
void baro_amsys_read_periodic(void)
Definition: baro_amsys.c:118
Architecture independent I2C (Inter-Integrated Circuit Bus) API.