summaryrefslogtreecommitdiff
path: root/sensorlib/hw_bmp180.h
blob: 7f8e3fed257f5e3cbcb64bdfcd85fa3a01e43320 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
//*****************************************************************************
//
// hw_bmp180.h - Macros used when accessing the Bosch BMP180 barometric
//               pressure sensor.
//
// Copyright (c) 2013-2014 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 2.1.0.12573 of the Tiva Firmware Development Package.
//
//*****************************************************************************

#ifndef __SENSORLIB_HW_BMP180_H__
#define __SENSORLIB_HW_BMP180_H__

//*****************************************************************************
//
// The following are defines for the BMP180 register addresses.
//
//*****************************************************************************
#define BMP180_O_AC1_MSB        0xAA        // AC1 MSB register
#define BMP180_O_AC1_LSB        0xAB        // AC1 LSB register
#define BMP180_O_AC2_MSB        0xAC        // AC2 MSB register
#define BMP180_O_AC2_LSB        0xAD        // AC2 LSB register
#define BMP180_O_AC3_MSB        0xAE        // AC3 MSB register
#define BMP180_O_AC3_LSB        0xAF        // AC3 LSB register
#define BMP180_O_AC4_MSB        0xB0        // AC4 MSB register
#define BMP180_O_AC4_LSB        0xB1        // AC4 LSB register
#define BMP180_O_AC5_MSB        0xB2        // AC5 MSB register
#define BMP180_O_AC5_LSB        0xB3        // AC5 LSB register
#define BMP180_O_AC6_MSB        0xB4        // AC6 MSB register
#define BMP180_O_AC6_LSB        0xB5        // AC6 LSB register
#define BMP180_O_B1_MSB         0xB6        // B1 MSB register
#define BMP180_O_B1_LSB         0xB7        // B1 LSB register
#define BMP180_O_B2_MSB         0xB8        // B2 MSB register
#define BMP180_O_B2_LSB         0xB9        // B2 LSB register
#define BMP180_O_MB_MSB         0xBA        // MB MSB register
#define BMP180_O_MB_LSB         0xBB        // MB LSB register
#define BMP180_O_MC_MSB         0xBC        // MC MSB register
#define BMP180_O_MC_LSB         0xBD        // MC LSB register
#define BMP180_O_MD_MSB         0xBE        // MD MSB register
#define BMP180_O_MD_LSB         0xBF        // MD LSB register
#define BMP180_O_ID             0xD0        // Device ID register
#define BMP180_O_SOFT_RESET     0xE0        // Soft reset register
#define BMP180_O_CTRL_MEAS      0xF4        // Measurement control register
#define BMP180_O_OUT_MSB        0xF6        // ADC data MSB register
#define BMP180_O_OUT_LSB        0xF7        // ADC data LSB register
#define BMP180_O_OUT_XLSB       0xF8        // ADC data XLSB register

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC1_MSB
// register.
//
//*****************************************************************************
#define BMP180_AC1_MSB_M        0xFF        // MSB of AC1 calibration
                                            // coefficient
#define BMP180_AC1_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC1_LSB
// register.
//
//*****************************************************************************
#define BMP180_AC1_LSB_M        0xFF        // LSB of AC1 calibration
                                            // coefficient
#define BMP180_AC1_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC2_MSB
// register.
//
//*****************************************************************************
#define BMP180_AC2_MSB_M        0xFF        // MSB of AC2 calibration
                                            // coefficient
#define BMP180_AC2_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC2_LSB
// register.
//
//*****************************************************************************
#define BMP180_AC2_LSB_M        0xFF        // LSB of AC2 calibration
                                            // coefficient
#define BMP180_AC2_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC3_MSB
// register.
//
//*****************************************************************************
#define BMP180_AC3_MSB_M        0xFF        // MSB of AC3 calibration
                                            // coefficient
#define BMP180_AC3_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC3_LSB
// register.
//
//*****************************************************************************
#define BMP180_AC3_LSB_M        0xFF        // LSB of AC3 calibration
                                            // coefficient
#define BMP180_AC3_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC4_MSB
// register.
//
//*****************************************************************************
#define BMP180_AC4_MSB_M        0xFF        // MSB of AC4 calibration
                                            // coefficient
#define BMP180_AC4_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC4_LSB
// register.
//
//*****************************************************************************
#define BMP180_AC4_LSB_M        0xFF        // LSB of AC4 calibration
                                            // coefficient
#define BMP180_AC4_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC5_MSB
// register.
//
//*****************************************************************************
#define BMP180_AC5_MSB_M        0xFF        // MSB of AC5 calibration
                                            // coefficient
#define BMP180_AC5_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC5_LSB
// register.
//
//*****************************************************************************
#define BMP180_AC5_LSB_M        0xFF        // LSB of AC5 calibration
                                            // coefficient
#define BMP180_AC5_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC6_MSB
// register.
//
//*****************************************************************************
#define BMP180_AC6_MSB_M        0xFF        // MSB of AC6 calibration
                                            // coefficient
#define BMP180_AC6_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_AC6_LSB
// register.
//
//*****************************************************************************
#define BMP180_AC6_LSB_M        0xFF        // LSB of AC6 calibration
                                            // coefficient
#define BMP180_AC6_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_B1_MSB
// register.
//
//*****************************************************************************
#define BMP180_B1_MSB_M         0xFF        // MSB of B1 calibration
                                            // coefficient
#define BMP180_B1_MSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_B1_LSB
// register.
//
//*****************************************************************************
#define BMP180_B1_LSB_M         0xFF        // LSB of B1 calibration
                                            // coefficient
#define BMP180_B1_LSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_B2_MSB
// register.
//
//*****************************************************************************
#define BMP180_B2_MSB_M         0xFF        // MSB of B2 calibration
                                            // coefficient
#define BMP180_B2_MSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_B2_LSB
// register.
//
//*****************************************************************************
#define BMP180_B2_LSB_M         0xFF        // LSB of B2 calibration
                                            // coefficient
#define BMP180_B2_LSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_MB_MSB
// register.
//
//*****************************************************************************
#define BMP180_MB_MSB_M         0xFF        // MSB of MB calibration
                                            // coefficient
#define BMP180_MB_MSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_MB_LSB
// register.
//
//*****************************************************************************
#define BMP180_MB_LSB_M         0xFF        // LSB of MB calibration
                                            // coefficient
#define BMP180_MB_LSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_MC_MSB
// register.
//
//*****************************************************************************
#define BMP180_MC_MSB_M         0xFF        // MSB of MC calibration
                                            // coefficient
#define BMP180_MC_MSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_MC_LSB
// register.
//
//*****************************************************************************
#define BMP180_MC_LSB_M         0xFF        // LSB of MC calibration
                                            // coefficient
#define BMP180_MC_LSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_MD_MSB
// register.
//
//*****************************************************************************
#define BMP180_MD_MSB_M         0xFF        // MSB of MD calibration
                                            // coefficient
#define BMP180_MD_MSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_MD_LSB
// register.
//
//*****************************************************************************
#define BMP180_MD_LSB_M         0xFF        // LSB of MD calibration
                                            // coefficient
#define BMP180_MD_LSB_S         0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_ID register.
//
//*****************************************************************************
#define BMP180_ID_M             0xFF        // Device ID
#define BMP180_ID_BMP180        0x55        // BMP180
#define BMP180_ID_S             0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_SOFT_RESET
// register.
//
//*****************************************************************************
#define BMP180_SOFT_RESET_M     0xFF        // Soft reset value
#define BMP180_SOFT_RESET_VALUE 0xB6        // Request a soft reset
#define BMP180_SOFT_RESET_S     0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_CTRL_MEAS
// register.
//
//*****************************************************************************
#define BMP180_CTRL_MEAS_OSS_M  0xC0        // Oversampling ratio
#define BMP180_CTRL_MEAS_OSS_1  0x00        // Single sampling
#define BMP180_CTRL_MEAS_OSS_2  0x40        // 2x oversampling
#define BMP180_CTRL_MEAS_OSS_4  0x80        // 4x oversampling
#define BMP180_CTRL_MEAS_OSS_8  0xC0        // 8x oversampling
#define BMP180_CTRL_MEAS_SCO    0x20        // Start of conversion
#define BMP180_CTRL_MEAS_M      0x1F        // Measurement control
#define BMP180_CTRL_MEAS_TEMPERATURE                                          \
                                0x0E        // Temperature measurement
#define BMP180_CTRL_MEAS_PRESSURE                                             \
                                0x14        // Pressure measurement
#define BMP180_CTRL_MEAS_OSS_S  6
#define BMP180_CTRL_MEAS_S      0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_OUT_MSB
// register.
//
//*****************************************************************************
#define BMP180_OUT_MSB_M        0xFF        // Bits [20:13] of the ADC data
#define BMP180_OUT_MSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_OUT_LSB
// register.
//
//*****************************************************************************
#define BMP180_OUT_LSB_M        0xFF        // Bits [12:5] of the ADC data
#define BMP180_OUT_LSB_S        0

//*****************************************************************************
//
// The following are defines for the bit fields in the BMP180_O_OUT_XLSB
// register.
//
//*****************************************************************************
#define BMP180_OUT_XLSB_M       0xF8        // Bits [4:0] of the ADC data
#define BMP180_OUT_XLSB_S       3

#endif // __SENSORLIB_HW_BMP180_H__