BMP180 temperature and pressure sensor

Device driver interface for the BMP180 sensor. More...

Detailed Description

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_params_t
 Device initialization parameters. More...
 
struct  bmp180_t
 Device descriptor for the BMP180 sensor. More...
 

Enumerations

enum  { BMP180_OK = 0, BMP180_ERR_NOI2C, BMP180_ERR_NODEV, BMP180_ERR_NOCAL }
 Status and error return codes. More...
 

Functions

int bmp180_init (bmp180_t *dev, const bmp180_params_t *params)
 Initialize the given BMP180 device. More...
 
int16_t bmp180_read_temperature (const bmp180_t *dev)
 Read temperature value from the given BMP180 device, returned in d°C. More...
 
uint32_t bmp180_read_pressure (const bmp180_t *dev)
 Read pressure value from the given BMP180 device, returned in Pa. More...
 
int16_t bmp180_altitude (const bmp180_t *dev, uint32_t pressure_0)
 Compute altitude, returned in m. More...
 
uint32_t bmp180_sealevel_pressure (const bmp180_t *dev, int16_t altitude)
 Compute pressure at sea level, returned in Pa. More...
 

Oversampling modes

enum  bmp180_oversampling_mode_t { BMP180_ULTRALOWPOWER = 0, BMP180_STANDARD, BMP180_HIGHRES, BMP180_ULTRAHIGHRES }
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BMP180_OK 

everything was fine

BMP180_ERR_NOI2C 

error initializing the I2C bus

BMP180_ERR_NODEV 

did not detect BMP180

BMP180_ERR_NOCAL 

error when reading calibration values

Definition at line 80 of file bmp180.h.

Function Documentation

◆ bmp180_altitude()

int16_t bmp180_altitude ( const bmp180_t dev,
uint32_t  pressure_0 
)
Parameters
[in]devDevice descriptor of BMP180 device to read from
[in]pressure_0The pressure at sea level in Pa
Returns
Altitude in m

◆ bmp180_init()

int bmp180_init ( bmp180_t dev,
const bmp180_params_t params 
)
Parameters
[out]devInitialized device descriptor of BMP180 device
[in]paramsInitialization parameters
Returns
BMP180_OK on success
-BMP180_ERR_NOI2C if given I2C is not enabled in board config
-BMP180_ERR_NODEV if not a BMP180 at given address
-BMP180_ERR_NOCAL if an error occured when reading calibration values

◆ bmp180_read_pressure()

uint32_t bmp180_read_pressure ( const bmp180_t dev)
Parameters
[in]devDevice descriptor of BMP180 device to read from
Returns
Pressure in Pa

◆ bmp180_read_temperature()

int16_t bmp180_read_temperature ( const bmp180_t dev)
Parameters
[in]devDevice descriptor of BMP180 device to read from
Returns
Temperature in d°C

◆ bmp180_sealevel_pressure()

uint32_t bmp180_sealevel_pressure ( const bmp180_t dev,
int16_t  altitude 
)
Parameters
[in]devDevice descriptor of BMP180 device to read from
[in]altitudeAltitude in m
Returns
Pressure at sea level in Pa