Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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
141
enum
Bmp3Status
{
142
BMP3_STATUS_UNINIT
,
143
BMP3_STATUS_GET_CALIB
,
144
BMP3_STATUS_CONFIGURE
,
145
BMP3_STATUS_READ_DATA
146
};
147
151
struct
bmp3_reg_calib_data
{
152
uint16_t
par_t1
;
153
uint16_t
par_t2
;
154
int8_t
par_t3
;
155
int16_t
par_p1
;
156
int16_t
par_p2
;
157
int8_t
par_p3
;
158
int8_t
par_p4
;
159
uint16_t
par_p5
;
160
uint16_t
par_p6
;
161
int8_t
par_p7
;
162
int8_t
par_p8
;
163
int16_t
par_p9
;
164
int8_t
par_p10
;
165
int8_t
par_p11
;
166
int64_t
t_lin
;
167
};
168
169
#if BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION
170
173
struct
bmp3_quantized_calib_data
{
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
195
struct
bmp3_quantized_calib_data
{
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
BMP3_STATUS_CONFIGURE
Definition:
bmp3_regs.h:144
uint16_t
unsigned short uint16_t
Definition:
types.h:16
bmp3_reg_calib_data::par_p11
int8_t par_p11
Definition:
bmp3_regs.h:165
BMP3_STATUS_UNINIT
Definition:
bmp3_regs.h:142
bmp3_reg_calib_data::par_p9
int16_t par_p9
Definition:
bmp3_regs.h:163
bmp3_quantized_calib_data::par_p1
float par_p1
Definition:
bmp3_regs.h:199
bmp3_reg_calib_data
Register Trim Variables.
Definition:
bmp3_regs.h:151
bmp3_quantized_calib_data::par_p7
float par_p7
Definition:
bmp3_regs.h:205
bmp3_reg_calib_data::par_p2
int16_t par_p2
Definition:
bmp3_regs.h:156
bmp3_quantized_calib_data::par_p2
float par_p2
Definition:
bmp3_regs.h:200
bmp3_quantized_calib_data::par_p4
float par_p4
Definition:
bmp3_regs.h:202
int64_t
signed long long int64_t
Definition:
types.h:21
bmp3_quantized_calib_data::t_lin
float t_lin
Definition:
bmp3_regs.h:210
bmp3_reg_calib_data::par_p5
uint16_t par_p5
Definition:
bmp3_regs.h:159
bmp3_reg_calib_data::t_lin
int64_t t_lin
Definition:
bmp3_regs.h:166
bmp3_reg_calib_data::par_t2
uint16_t par_t2
Definition:
bmp3_regs.h:153
bmp3_reg_calib_data::par_p6
uint16_t par_p6
Definition:
bmp3_regs.h:160
bmp3_quantized_calib_data::par_p3
float par_p3
Definition:
bmp3_regs.h:201
bmp3_reg_calib_data::par_p7
int8_t par_p7
Definition:
bmp3_regs.h:161
bmp3_reg_calib_data::par_t1
uint16_t par_t1
Definition:
bmp3_regs.h:152
bmp3_quantized_calib_data::par_p9
float par_p9
Definition:
bmp3_regs.h:207
int16_t
signed short int16_t
Definition:
types.h:17
bmp3_quantized_calib_data::par_p6
float par_p6
Definition:
bmp3_regs.h:204
bmp3_reg_calib_data::par_p1
int16_t par_p1
Definition:
bmp3_regs.h:155
std.h
bmp3_quantized_calib_data::par_t3
float par_t3
Definition:
bmp3_regs.h:198
bmp3_reg_calib_data::par_p3
int8_t par_p3
Definition:
bmp3_regs.h:157
bmp3_reg_calib_data::par_p10
int8_t par_p10
Definition:
bmp3_regs.h:164
Bmp3Status
Bmp3Status
Status enum.
Definition:
bmp3_regs.h:141
bmp3_quantized_calib_data::par_p10
float par_p10
Definition:
bmp3_regs.h:208
bmp3_reg_calib_data::par_p8
int8_t par_p8
Definition:
bmp3_regs.h:162
BMP3_STATUS_GET_CALIB
Definition:
bmp3_regs.h:143
bmp3_reg_calib_data::par_p4
int8_t par_p4
Definition:
bmp3_regs.h:158
bmp3_quantized_calib_data::par_t1
float par_t1
Definition:
bmp3_regs.h:196
BMP3_STATUS_READ_DATA
Definition:
bmp3_regs.h:145
int8_t
signed char int8_t
Definition:
types.h:15
bmp3_quantized_calib_data::par_p11
float par_p11
Definition:
bmp3_regs.h:209
bmp3_quantized_calib_data::par_p5
float par_p5
Definition:
bmp3_regs.h:203
bmp3_quantized_calib_data::par_p8
float par_p8
Definition:
bmp3_regs.h:206
bmp3_quantized_calib_data::par_t2
float par_t2
Definition:
bmp3_regs.h:197
bmp3_reg_calib_data::par_t3
int8_t par_t3
Definition:
bmp3_regs.h:154
bmp3_quantized_calib_data
Quantized Trim Variables.
Definition:
bmp3_regs.h:195
sw
airborne
peripherals
bmp3_regs.h
Generated on Wed Feb 10 2021 04:34:16 for Paparazzi UAS by
1.8.8