Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bmp3_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Gautier Hattenberger <gautier.hattenberger@enac.fr>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
31 #ifndef BMP3_REGS_H
32 #define BMP3_REGS_H
33 
34 #include "std.h"
35 
37 #define BMP3_I2C_ADDR 0xEC
38 #define BMP3_I2C_ADDR_ALT 0xEE
39 
41 #define BMP3_CHIP_ID 0x50
42 
44 #define BMP3_CHIP_ID_ADDR 0x00
45 #define BMP3_ERR_REG_ADDR 0x02
46 #define BMP3_SENS_STATUS_REG_ADDR 0x03
47 #define BMP3_DATA_ADDR 0x04
48 #define BMP3_EVENT_ADDR 0x10
49 #define BMP3_INT_STATUS_REG_ADDR 0x11
50 #define BMP3_FIFO_LENGTH_ADDR 0x12
51 #define BMP3_FIFO_DATA_ADDR 0x14
52 #define BMP3_FIFO_WM_ADDR 0x15
53 #define BMP3_FIFO_CONFIG_1_ADDR 0x17
54 #define BMP3_FIFO_CONFIG_2_ADDR 0x18
55 #define BMP3_INT_CTRL_ADDR 0x19
56 #define BMP3_IF_CONF_ADDR 0x1A
57 #define BMP3_PWR_CTRL_ADDR 0x1B
58 #define BMP3_OSR_ADDR 0X1C
59 #define BMP3_ODR_ADDR 0X1D
60 #define BMP3_CONFIG_ADDR 0X1F
61 #define BMP3_CALIB_DATA_ADDR 0x31
62 #define BMP3_CMD_ADDR 0x7E
63 
65 #define BMP3_SLEEP_MODE 0x00
66 #define BMP3_FORCED_MODE 0x01
67 #define BMP3_NORMAL_MODE 0x03
68 
70 #define BMP3_NO_OVERSAMPLING 0x00
71 #define BMP3_OVERSAMPLING_2X 0x01
72 #define BMP3_OVERSAMPLING_4X 0x02
73 #define BMP3_OVERSAMPLING_8X 0x03
74 #define BMP3_OVERSAMPLING_16X 0x04
75 #define BMP3_OVERSAMPLING_32X 0x05
76 
78 #define BMP3_IIR_FILTER_DISABLE 0x00
79 #define BMP3_IIR_FILTER_COEFF_1 0x01
80 #define BMP3_IIR_FILTER_COEFF_3 0x02
81 #define BMP3_IIR_FILTER_COEFF_7 0x03
82 #define BMP3_IIR_FILTER_COEFF_15 0x04
83 #define BMP3_IIR_FILTER_COEFF_31 0x05
84 #define BMP3_IIR_FILTER_COEFF_63 0x06
85 #define BMP3_IIR_FILTER_COEFF_127 0x07
86 
88 #define BMP3_ODR_200_HZ 0x00
89 #define BMP3_ODR_100_HZ 0x01
90 #define BMP3_ODR_50_HZ 0x02
91 #define BMP3_ODR_25_HZ 0x03
92 #define BMP3_ODR_12_5_HZ 0x04
93 #define BMP3_ODR_6_25_HZ 0x05
94 #define BMP3_ODR_3_1_HZ 0x06
95 #define BMP3_ODR_1_5_HZ 0x07
96 #define BMP3_ODR_0_78_HZ 0x08
97 #define BMP3_ODR_0_39_HZ 0x09
98 #define BMP3_ODR_0_2_HZ 0x0A
99 #define BMP3_ODR_0_1_HZ 0x0B
100 #define BMP3_ODR_0_05_HZ 0x0C
101 #define BMP3_ODR_0_02_HZ 0x0D
102 #define BMP3_ODR_0_01_HZ 0x0E
103 #define BMP3_ODR_0_006_HZ 0x0F
104 #define BMP3_ODR_0_003_HZ 0x10
105 #define BMP3_ODR_0_001_HZ 0x11
106 
108 #define BMP3_PRESS 0x01
109 #define BMP3_TEMP 0x02
110 #define BMP3_ALL 0x03
111 
113 #define BMP3_CONCAT_BYTES(msb, lsb) (((uint16_t)msb << 8) | (uint16_t)lsb)
114 
116 #define BMP3_CALIB_DATA_LEN 21
117 #define BMP3_P_AND_T_HEADER_DATA_LEN 7
118 #define BMP3_P_OR_T_HEADER_DATA_LEN 4
119 #define BMP3_P_T_DATA_LEN 6
120 #define BMP3_P_DATA_LEN 3
121 #define BMP3_T_DATA_LEN 3
122 #define BMP3_SENSOR_TIME_LEN 3
123 
127 #define BMP3_DOUBLE_PRECISION_COMPENSATION 1
128 #define BMP3_SINGLE_PRECISION_COMPENSATION 2
129 #define BMP3_INTEGER_COMPENSATION 3
130 
134 #ifndef BMP3_COMPENSATION
135 #define BMP3_COMPENSATION BMP3_SINGLE_PRECISION_COMPENSATION
136 #endif
137 
146 };
147 
167 };
168 
169 #if BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION
170 
174  double par_t1;
175  double par_t2;
176  double par_t3;
177  double par_p1;
178  double par_p2;
179  double par_p3;
180  double par_p4;
181  double par_p5;
182  double par_p6;
183  double par_p7;
184  double par_p8;
185  double par_p9;
186  double par_p10;
187  double par_p11;
188  double t_lin;
189 };
190 
191 #elif BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION
192 
196  float par_t1;
197  float par_t2;
198  float par_t3;
199  float par_p1;
200  float par_p2;
201  float par_p3;
202  float par_p4;
203  float par_p5;
204  float par_p6;
205  float par_p7;
206  float par_p8;
207  float par_p9;
208  float par_p10;
209  float par_p11;
210  float t_lin;
211 };
212 
213 #endif
214 
215 #endif /* BMP3_REGS_H */
216 
unsigned short uint16_t
Definition: types.h:16
Register Trim Variables.
Definition: bmp3_regs.h:151
signed long long int64_t
Definition: types.h:21
signed short int16_t
Definition: types.h:17
Bmp3Status
Status enum.
Definition: bmp3_regs.h:141
signed char int8_t
Definition: types.h:15
Quantized Trim Variables.
Definition: bmp3_regs.h:195