The friendly Operating System for the Internet of Things

Internal addresses, registers, constants for the BMP180 sensor. More...

Detailed Description

Device driver interface for the BMP180 sensor.

Files

file  bmp180_internals.h
 Internal addresses, registers, constants for the BMP180 sensor.
 
file  bmp180.h
 Device driver interface for the BMP180 sensor.
 

Data Structures

struct  bmp180_calibration_t
 Calibration struct for the BMP180 sensor. More...
 
struct  bmp180_t
 Device descriptor for the BMP180 sensor. More...
 
struct  bmp180_params_t
 Device initialization parameters. More...
 

Functions

int bmp180_init (bmp180_t *dev, i2c_t i2c, uint8_t mode)
 Initialize the given BMP180 device. More...
 
int bmp180_read_temperature (bmp180_t *dev, int32_t *temperature)
 Read temperature value from the given BMP180 device, returned in d°C. More...
 
int bmp180_read_pressure (bmp180_t *dev, int32_t *pressure)
 Read pressure value from the given BMP180 device, returned in Pa. More...
 
int bmp180_altitude (bmp180_t *dev, int32_t pressure_0, int32_t *altitude)
 Compute altitude, returned in m. More...
 
int bmp180_sealevel_pressure (bmp180_t *dev, int32_t altitude, int32_t *pressure_0)
 Compute pressure at sea level, returned in Pa. More...
 

BMP180 I2C address

#define BMP180_ADDR   (0x77) /* 7 bit address */
 

BMP180 registers

#define BMP180_REGISTER_ID   (0xD0)
 
#define BMP180_REGISTER_CONTROL   (0xF4)
 
#define BMP180_REGISTER_DATA   (0xF6)
 
#define BMP180_TEMPERATURE_COMMAND   (0x2E)
 
#define BMP180_PRESSURE_COMMAND   (0x34)
 
#define BMP180_CALIBRATION_AC1   (0xAA)
 

Oversampling modes delays (micros)

#define BMP180_ULTRALOWPOWER_DELAY   (5000UL)
 
#define BMP180_STANDARD_DELAY   (8000UL)
 
#define BMP180_HIGHRES_DELAY   (14000UL)
 
#define BMP180_ULTRAHIGHRES_DELAY   (26000UL)
 

Oversampling modes

#define BMP180_ULTRALOWPOWER   (0)
 
#define BMP180_STANDARD   (1)
 
#define BMP180_HIGHRES   (2)
 
#define BMP180_ULTRAHIGHRES   (3)
 
const saul_driver_t bmp180_temperature_saul_driver
 export SAUL endpoints
 
const saul_driver_t bmp180_pressure_saul_driver
 

Function Documentation

int bmp180_altitude ( bmp180_t dev,
int32_t  pressure_0,
int32_t *  altitude 
)
Parameters
[in]devDevice descriptor of BMP180 device to read from
[in]pressure_0The pressure at sea level in Pa
[out]altitudeAltitude in m
Returns
0 on success
-1 if device's I2C is not enabled in board config
int bmp180_init ( bmp180_t dev,
i2c_t  i2c,
uint8_t  mode 
)
Parameters
[out]devInitialized device descriptor of BMP180 device
[in]i2cI2C bus the sensor is connected to
[in]modeBMP180 oversampling mode
Returns
0 on success
-1 if given I2C is not enabled in board config
int bmp180_read_pressure ( bmp180_t dev,
int32_t *  pressure 
)
Parameters
[in]devDevice descriptor of BMP180 device to read from
[out]pressurePressure in Pa
Returns
0 on success
-1 if device's I2C is not enabled in board config
int bmp180_read_temperature ( bmp180_t dev,
int32_t *  temperature 
)
Parameters
[in]devDevice descriptor of BMP180 device to read from
[out]temperatureTemperature in d°C
Returns
0 on success
-1 if device's I2C is not enabled in board config
int bmp180_sealevel_pressure ( bmp180_t dev,
int32_t  altitude,
int32_t *  pressure_0 
)
Parameters
[in]devDevice descriptor of BMP180 device to read from
[in]altitudeAltitude in m
[out]pressure_0Pressure at sea level in Pa
Returns
0 on success
-1 if device's I2C is not enabled in board config