2 ******************************************************************************
3 * @addtogroup PIOS PIOS Core hardware abstraction layer
5 * @addtogroup PIOS_BMP085 BMP085 Functions
6 * @brief Hardware functions to deal with the altitude pressure sensor
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
11 * @brief BMP085 functions header.
12 * @see The GNU Public License (GPL) Version 3
14 *****************************************************************************/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 /* BMP085 Addresses */
35 #define BMP085_I2C_ADDR 0x77
36 #define BMP085_CALIB_ADDR 0xAA
37 #define BMP085_CALIB_LEN 22
38 #define BMP085_CTRL_ADDR 0xF4
39 #define BMP085_OVERSAMPLING PIOS_BMP085_OVERSAMPLING
40 #define BMP085_PRES_ADDR (0x34 + (BMP085_OVERSAMPLING << 6))
41 #define BMP085_TEMP_ADDR 0x2E
42 #define BMP085_ADC_MSB 0xF6
43 #define BMP085_P0 101325
58 } BMP085CalibDataTypeDef
;
63 } ConversionTypeTypeDef
;
65 /* Global Variables */
66 #if defined(PIOS_INCLUDE_FREERTOS)
67 extern xSemaphoreHandle PIOS_BMP085_EOC
;
69 extern int32_t PIOS_BMP085_EOC
;
72 /* Public Functions */
73 extern void PIOS_BMP085_Init(void);
74 extern void PIOS_BMP085_StartADC(ConversionTypeTypeDef Type
);
75 extern void PIOS_BMP085_ReadADC(void);
76 extern int16_t PIOS_BMP085_GetTemperature(void);
77 extern int32_t PIOS_BMP085_GetPressure(void);
78 extern bool PIOS_BMP085_Read(uint8_t address
, uint8_t *buffer
, uint8_t len
);
79 extern bool PIOS_BMP085_Write(uint8_t address
, uint8_t buffer
);
80 extern int32_t PIOS_BMP085_Test();
82 #endif /* PIOS_BMP085_H */