1 /* BOSCH Pressure Sensor Driver
3 * This software is licensed under the terms of the GNU General Public
4 * License version 2, as published by the Free Software Foundation, and
5 * may be copied, distributed, and modified under those terms.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
17 #include <linux/ioctl.h>
18 /*****************************************************
19 | sensor | chip id | 7-bit i2c address |
20 -----------------------------------------------------|
21 | bmp180 | 0x55 | 0x77 |
22 *****************************************************/
24 /* apply low pass filter on output */
25 /*#define CONFIG_BMP_LOWPASS*/
26 /*#define CONFIG_ID_TEMPERATURE*/
27 /*#define CONFIG_I2C_BASIC_FUNCTION*/
29 #define BMP_DRIVER_VERSION "V1.2"
31 #define BMP_DEV_NAME "bmp180"
33 #define C_MAX_FIR_LENGTH (32)
34 #define MAX_SENSOR_NAME (32)
35 #define BMP_DATA_NUM 1
36 #define BMP_PRESSURE 0
37 #define BMP_BUFSIZE 128
39 /* common definition */
40 #define BMP_GET_BITSLICE(regvar, bitname)\
41 ((regvar & bitname##__MSK) >> bitname##__POS)
43 #define BMP_SET_BITSLICE(regvar, bitname, val)\
44 ((regvar & ~bitname##__MSK) | ((val<<bitname##__POS)&bitname##__MSK))
47 #define BMP_CHIP_ID_REG 0xD0
49 /*********************************[BMP180]*************************************/
51 #define BMP180_CHIP_ID 0x55
54 #define BMP180_I2C_ADDRESS 0x77
56 /* calibration data */
57 #define BMP180_CALIBRATION_DATA_START 0xAA
58 #define BMP180_CALIBRATION_DATA_LENGTH 11 /* 16 bit values */
61 #define BMP180_OVERSAMPLING_1X 0x00
62 #define BMP180_OVERSAMPLING_2X 0x01
63 #define BMP180_OVERSAMPLING_4X 0x02
64 #define BMP180_OVERSAMPLING_8X 0x03
66 #define BMP180_CTRLMEAS_REG 0xF4 /* Ctrl Measure Register */
68 #define BMP180_CTRLMEAS_REG_OSRSP__POS 6
69 #define BMP180_CTRLMEAS_REG_OSRSP__MSK 0xC0
70 #define BMP180_CTRLMEAS_REG_OSRSP__LEN 2
71 #define BMP180_CTRLMEAS_REG_OSRSP__REG BMP180_CTRLMEAS_REG
74 #define BMP180_TEMP_MEASUREMENT 0x2E
75 #define BMP180_PRESSURE_MEASUREMENT 0x34
76 #define BMP180_TEMP_CONVERSION_TIME (5 + 5)
77 #define BMP180_CONVERSION_REGISTER_MSB 0xF6
79 #define BMP180_CTRLMEAS_REG_MC__POS 0
80 #define BMP180_CTRLMEAS_REG_MC__MSK 0x3F
81 #define BMP180_CTRLMEAS_REG_MC__LEN 6
82 #define BMP180_CTRLMEAS_REG_MC__REG BMP180_CTRLMEAS_REG
84 #endif/* BOSCH_BARO_H */