BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Interface to the Bosch Sensotec BMP180 Barometric Pressure Sensor or its predecessor BMP085. More...
Go to the source code of this file.
Data Structures | |
struct | sBSP430sensorsBMP180calibration |
struct | sBSP430sensorsBMP180sample |
Macros | |
#define | BSP430_SENSORS_BMP180_I2C_ADDRESS 0x77 |
Typedefs | |
typedef struct sBSP430sensorsBMP180calibration | sBSP430sensorsBMP180calibration |
typedef sBSP430sensorsBMP180calibration * | hBSP430sensorsBMP180calibration |
typedef struct sBSP430sensorsBMP180sample | sBSP430sensorsBMP180sample |
typedef sBSP430sensorsBMP180sample * | hBSP430sensorsBMP180sample |
Functions | |
int | iBSP430sensorsBMP180getCalibration (hBSP430halSERIAL i2c, hBSP430sensorsBMP180calibration calh) |
int | iBSP430sensorsBMP180getSample (hBSP430halSERIAL i2c, hBSP430sensorsBMP180sample sample) |
void | vBSP430sensorsBMP180convertSample (const sBSP430sensorsBMP180calibration *calp, hBSP430sensorsBMP180sample sample) |
Interface to the Bosch Sensotec BMP180 Barometric Pressure Sensor or its predecessor BMP085.
This device measures absolute atmospheric pressure and temperature.
To use this with BSP430 you will need an I2C device. See examples/sensors/bmp085
for an example of how to use it.
i2c
resourcei2c
may be in reset mode on entry, in which case it will be put back into reset mode before returning. i2c
must not be in hold mode .i2c
resource will be reconfigured as a side effect of calling the function.#define BSP430_SENSORS_BMP180_I2C_ADDRESS 0x77 |
The 7-bit I2C slave address for the device. This is not configurable.
A handle for BMP180 calibration constants
A handle for a BMP180 sample
typedef struct sBSP430sensorsBMP180calibration sBSP430sensorsBMP180calibration |
Calibration constants retrieved from the device
typedef struct sBSP430sensorsBMP180sample sBSP430sensorsBMP180sample |
Data defining a BMP180 sample
int iBSP430sensorsBMP180getCalibration | ( | hBSP430halSERIAL | i2c, |
hBSP430sensorsBMP180calibration | calh | ||
) |
Read the calibration data from an BMP180 device.
i2c | the I2C bus on which the BMP180 device can be contacted. |
calh | reference to the calibration structure for the device. |
return 0 if the calibration constants could be read; otherwise a negative error code.
int iBSP430sensorsBMP180getSample | ( | hBSP430halSERIAL | i2c, |
hBSP430sensorsBMP180sample | sample | ||
) |
Read a single sample from the device.
i2c | the I2C bus on which the BMP180 device can be contacted |
sample | a pointer to where the sample data should be stored. sBSP430sensorsBMP180sample::oversampling must have been set prior to the call. On a successful call, sBSP430sensorsBMP180sample::temperature_uncomp and sBSP430sensorsBMP180sample::pressure_uncomp will have been updated. |
void vBSP430sensorsBMP180convertSample | ( | const sBSP430sensorsBMP180calibration * | calp, |
hBSP430sensorsBMP180sample | sample | ||
) |
Apply calibration correction to set the final temperature and pressure values for a sample.
calp | reference to calibration constants retrieved by iBSP430sensorsBMP180getCalibration() |
sample | reference to a sample retrieved by iBSP430sensorsBMP180getSample. On return, sBSP430sensorsBMP180sample::temperature_dK and sBSP430sensorsBMP180sample::pressure_Pa will have been updated. |