Driver for the Bosch BMP280 Pressure Sensor.
This header file should be included in an application as follows:
#include "stdint.h"
#include "stdbool.h"
Go to the source code of this file.
Macros | |
#define | SENSOR_BMP280_DATASIZE 6 |
Functions | |
bool | SensorBmp280_init (void) |
Initialize the sensor. More... | |
void | SensorBmp280_enable (bool enable) |
Enable/disable measurement cycle. More... | |
bool | SensorBmp280_read (uint8_t *pData) |
Read temperature and pressure data. More... | |
void | SensorBmp280_convert (uint8_t *pData, int32_t *pTemp, uint32_t *pPress) |
Convert raw data to object and ambiance temperature. More... | |
bool | SensorBmp280_test (void) |
Run a sensor self-test. More... | |
#define SENSOR_BMP280_DATASIZE 6 |
Size of the data read from the sensor
bool SensorBmp280_init | ( | void | ) |
Initialize the sensor.
Reads and stores the calibration data for later use, then resets the sensor.
void SensorBmp280_enable | ( | bool | enable | ) |
Enable/disable measurement cycle.
This function enables or disables measurement according to the value of enable. When enabled the sensor uses forced mode, 4x pressure oversampling, and 1x temperature oversampling. When disabled the sensor is put in low power mode.
enable | - flag to turn the sensor on/off. |
bool SensorBmp280_read | ( | uint8_t * | pData | ) |
Read temperature and pressure data.
Reads 6 bytes of data into the provided buffer (3 bytes of temperature followed by 3 bytes of pressure data. The data need to be process further using the calibration data to calculate the atmospheric pressure.
pData | - buffer for raw data, temperature and pressure (6 bytes) |
void SensorBmp280_convert | ( | uint8_t * | pData, |
int32_t * | pTemp, | ||
uint32_t * | pPress | ||
) |
Convert raw data to object and ambiance temperature.
Calculate pressure and temperature using provided raw data and the stored calibration data.
pData | - buffer for raw data from sensor |
pTemp | - converted temperature |
pPress | - converted pressure |
bool SensorBmp280_test | ( | void | ) |
Run a sensor self-test.