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_bmp.h
Go to the documentation of this file.
1 #ifndef BARO_BMP_H
2 #define BARO_BMP_H
3 
4 #include "std.h"
5 
6 #define BMP085_EEPROM_AC1 0xAA
7 #define BMP085_EEPROM_AC2 0xAC
8 #define BMP085_EEPROM_AC3 0xAE
9 #define BMP085_EEPROM_AC4 0xB0
10 #define BMP085_EEPROM_AC5 0xB2
11 #define BMP085_EEPROM_AC6 0xB4
12 #define BMP085_EEPROM_B1 0xB6
13 #define BMP085_EEPROM_B2 0xB8
14 #define BMP085_EEPROM_MB 0xBA
15 #define BMP085_EEPROM_MC 0xBC
16 #define BMP085_EEPROM_MD 0xBE
17 
18 #define BMP085_CTRL_REG 0xF4
19 
20 #define BMP085_START_TEMP 0x2E
21 #define BMP085_START_P0 0x34
22 #define BMP085_START_P1 0x74
23 #define BMP085_START_P2 0xB4
24 #define BMP085_START_P3 0xF4
25 
26 #define BMP085_DAT_MSB 0xF6
27 #define BMP085_DAT_LSB 0xF7
28 #define BMP085_DAT_XLSB 0xF8
29 
30 #define BARO_BMP_UNINIT 0
31 #define BARO_BMP_IDLE 1
32 #define BARO_BMP_START_TEMP 2
33 #define BARO_BMP_READ_TEMP 3
34 #define BARO_BMP_START_PRESS 4
35 #define BARO_BMP_READ_PRESS 5
36 
38 #ifndef SITL
39 #define BARO_BMP_DT (BARO_BMP_PERIODIC_PERIOID / 3)
40 #else
41 #define BARO_BMP_DT BARO_BMP_PERIODIC_PERIOID
42 #endif
43 
44 extern bool_t baro_bmp_enabled;
45 extern float baro_bmp_r;
46 extern float baro_bmp_sigma2;
47 
49 extern bool_t baro_bmp_valid;
53 extern int32_t baro_bmp;
55 
56 void baro_bmp_init(void);
57 void baro_bmp_periodic(void);
58 void baro_bmp_event(void);
59 
60 #define BaroBmpUpdate(_b, _h) { if (baro_bmp_valid) { _b = baro_bmp_pressure; _h(); baro_bmp_valid = FALSE; } }
61 
62 #endif
float baro_bmp_r
Definition: baro_bmp.c:69
unsigned short uint16_t
Definition: types.h:16
void baro_bmp_init(void)
Definition: baro_bmp.c:91
bool_t baro_bmp_enabled
Definition: baro_bmp.c:68
uint32_t baro_bmp_pressure
Definition: baro_bmp.c:75
int32_t baro_bmp
Definition: baro_bmp.c:77
void baro_bmp_periodic(void)
Definition: baro_bmp.c:104
unsigned long uint32_t
Definition: types.h:18
void baro_bmp_event(void)
Definition: baro_bmp.c:133
signed long int32_t
Definition: types.h:19
bool_t baro_bmp_valid
Definition: baro_bmp.c:74
unsigned char uint8_t
Definition: types.h:14
int32_t baro_bmp_offset
Definition: baro_bmp.c:77
float baro_bmp_sigma2
Definition: baro_bmp.c:70
int32_t baro_bmp_altitude
Definition: baro_bmp.c:77
uint8_t baro_bmp_status
Definition: baro_bmp.c:73
uint16_t baro_bmp_temperature
Definition: baro_bmp.c:76