Contiki-Inga 3.x
bmp085.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, TU Braunschweig.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  */
29 
30 /**
31  * \file
32  * Bosch BMP085 Digital Pressure Sensor driver definition
33  * \author
34  * Ulf Kulau <kulau@ibr.cs.tu-bs.de>
35  */
36 
37 /**
38  * \addtogroup inga_sensors_driver
39  * @{
40  */
41 
42 /**
43  * \defgroup bmp085_interface BMP085 Digital Pressure Sensor
44  *
45  * With a pressure sensor it is possible to measure the activity of
46  * a person. Especially the Bosch BMP085 allows the registration of small
47  * height fluctuations by sensing the air pressure. In some related papers,
48  * a concrete application was implemented, to show how a fall analysis could
49  * be done.
50  * @{
51  */
52 
53 #ifndef PRESSUREBMP085_H_
54 #define PRESSUREBMP085_H_
55 
56 #include "../dev/i2c.h"
57 #include <util/delay.h>
58 
59 /**
60  * Tests if BMP085 is available
61  * \retval 1 is avaiable
62  * \retval 0 is not available
63  */
64 int8_t bmp085_available(void);
65 
66 /**
67  * \brief Initializes the BMP085 Pressure Sensor
68  *
69  * \retval 0 bmp085 available
70  * \retval 1 bmp085 not available
71  */
72 int8_t bmp085_init(void);
73 
74 /**
75  * \brief Deinitializes the sensor.
76  * @todo: Dummy function that does nothing
77  */
78 int8_t bmp085_deinit(void);
79 
80 /**
81  * \brief This function reads and returns the calibration compensated temerature
82  *
83  * \return Temerature in 0.1 Degree
84  */
85 int16_t bmp085_read_temperature(void);
86 
87 /**
88  * \name Operation modes
89  * @{
90  */
91 /// Ultra low power mode
92 #define BMP085_ULTRA_LOW_POWER 0
93 /// Standard mode
94 #define BMP085_STANDARD 1
95 /// High resolution mode
96 #define BMP085_HIGH_RESOLUTION 2
97 /// Ultra high resolution mode
98 #define BMP085_ULTRA_HIGH_RES 3
99 /** @}*/
100 
101 /**
102  * \brief This functions reads the temperature compensated
103  * value of one pressure conversion
104  *
105  * \param mode one of
106  * \ref BMP085_ULTRA_LOW_POWER,
107  * \ref BMP085_STANDARD,
108  * \ref BMP085_HIGH_RESOLUTION and
109  * \ref BMP085_ULTRA_HIGH_RES
110  *
111  * \return Pressure in Pa
112  */
113 int32_t bmp085_read_pressure(uint8_t mode);
114 
115 #endif /* PRESSUREBMP085_H_ */
116 
117 /** @} */
118 /** @} */