Loading...
Searching...
No Matches
BMP180 temperature and pressure sensor

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

Detailed Description

Device driver interface for the BMP180 sensor.

This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.

Files

file  bmp180_internals.h
 Internal addresses, registers, constants for the BMP180 sensor.
 
file  bmp180_params.h
 Default configuration for BMP180.
 
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_oversampling_mode_t { BMP180_ULTRALOWPOWER = 0 , BMP180_STANDARD , BMP180_HIGHRES , BMP180_ULTRAHIGHRES }
 Oversampling modes. More...
 
enum  { BMP180_OK = 0 , 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.
 
int16_t bmp180_read_temperature (const bmp180_t *dev)
 Read temperature value from the given BMP180 device, returned in d°C.
 
uint32_t bmp180_read_pressure (const bmp180_t *dev)
 Read pressure value from the given BMP180 device, returned in Pa.
 
int16_t bmp180_altitude (const bmp180_t *dev, uint32_t pressure_0)
 Compute altitude, returned in m.
 
uint32_t bmp180_sealevel_pressure (const bmp180_t *dev, int16_t altitude)
 Compute pressure at sea level, returned in Pa.
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Status and error return codes.

Enumerator
BMP180_OK 

everything was fine

BMP180_ERR_NODEV 

did not detect BMP180

BMP180_ERR_NOCAL 

error when reading calibration values

Definition at line 81 of file bmp180.h.

◆ bmp180_oversampling_mode_t

Oversampling modes.

Definition at line 37 of file bmp180.h.

Function Documentation

◆ bmp180_altitude()

int16_t bmp180_altitude ( const bmp180_t dev,
uint32_t  pressure_0 
)

Compute altitude, returned in m.

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 
)

Initialize the given BMP180 device.

Parameters
[out]devInitialized device descriptor of BMP180 device
[in]paramsInitialization parameters
Returns
BMP180_OK on success
-BMP180_ERR_NODEV if not a BMP180 at given address
-BMP180_ERR_NOCAL if an error occurred when reading calibration values

◆ bmp180_read_pressure()

uint32_t bmp180_read_pressure ( const bmp180_t dev)

Read pressure value from the given BMP180 device, returned in Pa.

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)

Read temperature value from the given BMP180 device, returned in d°C.

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 
)

Compute pressure at sea level, returned in Pa.

Parameters
[in]devDevice descriptor of BMP180 device to read from
[in]altitudeAltitude in m
Returns
Pressure at sea level in Pa