Macros | Functions
SensorBmp280.h File Reference

Detailed Description

Driver for the Bosch BMP280 Pressure Sensor.

Driver include

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...
 

Macro Definition Documentation

§ SENSOR_BMP280_DATASIZE

#define SENSOR_BMP280_DATASIZE   6

Size of the data read from the sensor

Function Documentation

§ SensorBmp280_init()

bool SensorBmp280_init ( void  )

Initialize the sensor.

Reads and stores the calibration data for later use, then resets the sensor.

Returns
true if success

§ SensorBmp280_enable()

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.

Parameters
enable- flag to turn the sensor on/off.

§ SensorBmp280_read()

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.

Parameters
pData- buffer for raw data, temperature and pressure (6 bytes)
Returns
true if read operation succeeds and the data are valid

§ SensorBmp280_convert()

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.

Parameters
pData- buffer for raw data from sensor
pTemp- converted temperature
pPress- converted pressure

§ SensorBmp280_test()

bool SensorBmp280_test ( void  )

Run a sensor self-test.

Returns
true if passed
Copyright 2017, Texas Instruments Incorporated