Atmel Software Framework

bmp.h File Reference

Bosch Digital pressure sensor common definitions.

This module defines registers, constants, data structures, and global function prototypes that are common to multiple Bosch sensor drivers, in particular those for BMP085 and BMP180 devices.

Copyright (c) 2012 Atmel Corporation. All rights reserved.

#include <asf.h>

Macros

#define BMP_EEPROM_ADDR   (0xaa) /* BMP085/BMP180 EEPROM base address */
 
#define BMP_EEPROM_SIZE_BYTES   (22) /* BMP085/BMP180 EEPROM size (bytes) */
 
#define BMP_TWI_ADDR   (0x77)
 
#define BMP_CHIP_ID   (0xd0) /* chip ID - always 0x55 */
 BMP Register Addresses. More...
 
#define BMP_CHIP_VERSION   (0xd1) /* chip revision */
 
#define BMP_SOFT_RESET   (0xe0) /* reset device */
 
#define BMP_CONTROL   (0xf4) /* device control register */
 
#define BMP_DATA_MSB   (0xf6) /* temp. or press. data MSB */
 
#define BMP_DATA_LSB   (0xf7) /* temp. or press. data LSB */
 
#define BMP_DATA_XLSB   (0xf8) /* press. data XLSB (19 bit data) */
 
#define BMP085_ID_VAL   (0x55) /* BMP085 chip id value */
 BMP Register Bit Definitions. More...
 
#define BMP085_VER_VAL   (0x01) /* BMP085 chip version value */
 
#define BMP180_ID_VAL   (0x55) /* BMP180 chip id value */
 
#define BMP180_VER_VAL   (0x02) /* BMP180 chip version value */
 
#define BMP_RESET_CMD   (0xb6) /* soft reset command */
 
#define BMP_TEMP_READ   (0x2e) /* read temperature */
 
#define BMP_PRESS_READ   (0x34) /* read pressure (@ osrs = 0) */
 
#define BMP_MIN_hPa   (300) /* +9 000 (m) above sea level */
 
#define BMP_MAX_hPa   (1100) /* -500 (m) above sea level */
 
#define BMP_MIN_COUNTS   (0)
 
#define BMP_MAX_COUNTS   (0xfffful)
 

Functions

bool bmp085_init (sensor_t *, int)
 Bosch BMP085 barometric sensor driver initialization. More...
 
bool bmp180_init (sensor_t *, int)
 Bosch BMP180 barometric sensor driver initialization. More...
 

#define BMP085_ID_VAL   (0x55) /* BMP085 chip id value */

BMP Register Bit Definitions.

Referenced by bmp085_init().

#define BMP085_VER_VAL   (0x01) /* BMP085 chip version value */

Referenced by bmp085_init().

#define BMP180_ID_VAL   (0x55) /* BMP180 chip id value */

Referenced by bmp180_init().

#define BMP180_VER_VAL   (0x02) /* BMP180 chip version value */

Referenced by bmp180_init().

#define BMP_CHIP_ID   (0xd0) /* chip ID - always 0x55 */

BMP Register Addresses.

Referenced by bmp085_init(), bmp180_init(), and bmp_device_id().

#define BMP_CHIP_VERSION   (0xd1) /* chip revision */
#define BMP_CONTROL   (0xf4) /* device control register */

Referenced by bmp_get_up(), and bmp_get_ut().

#define BMP_DATA_LSB   (0xf7) /* temp. or press. data LSB */
#define BMP_DATA_MSB   (0xf6) /* temp. or press. data MSB */

Referenced by bmp_get_up(), and bmp_get_ut().

#define BMP_DATA_XLSB   (0xf8) /* press. data XLSB (19 bit data) */
#define BMP_EEPROM_ADDR   (0xaa) /* BMP085/BMP180 EEPROM base address */

Referenced by bmp_get_cal_param().

#define BMP_EEPROM_SIZE_BYTES   (22) /* BMP085/BMP180 EEPROM size (bytes) */

Referenced by bmp_get_cal_param().

#define BMP_MAX_COUNTS   (0xfffful)
#define BMP_MAX_hPa   (1100) /* -500 (m) above sea level */
#define BMP_MIN_COUNTS   (0)
#define BMP_MIN_hPa   (300) /* +9 000 (m) above sea level */
#define BMP_PRESS_READ   (0x34) /* read pressure (@ osrs = 0) */

Referenced by bmp_get_up().

#define BMP_RESET_CMD   (0xb6) /* soft reset command */

Referenced by bmp_set_state().

#define BMP_SOFT_RESET   (0xe0) /* reset device */

Referenced by bmp_set_state().

#define BMP_TEMP_READ   (0x2e) /* read temperature */

Referenced by bmp_get_ut().

#define BMP_TWI_ADDR   (0x77)

bool bmp085_init ( sensor_t sensor,
int  resvd 
)

Bosch BMP085 barometric sensor driver initialization.

This is the main initialization function for the BMP085 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the sensor is ready for use, else false.
bool bmp180_init ( sensor_t sensor,
int  resvd 
)

Bosch BMP180 barometric sensor driver initialization.

This is the main initialization function for the BMP180 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the sensor is ready for use, else false.