Device driver interface for the BMX280 sensors (BMP280 and BME280). More...

Detailed Description

Device driver interface for the BMX280 sensors (BMP280 and BME280).

There are three sensor values that can be read: temperature, pressure and humidity. The BME280 device usually measures them all at once. It is possible to skip measuring either of the values by changing the oversampling settings. The driver is written in such a way that a measurement is only started from the function that reads the temperature. In other words, you always have to call bme280_read_temperature, and then optionally you can call the other two.

Author
Kees Bakker kees@.nosp@m.soda.nosp@m.q.com
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr

Definition in file bmx280.h.

#include <inttypes.h>
#include "saul.h"
#include "periph/i2c.h"
+ Include dependency graph for bmx280.h:

Go to the source code of this file.

Data Structures

struct  bmx280_calibration_t
 Calibration struct for the BMX280 sensor. More...
 
struct  bmx280_params_t
 Parameters for the BMX280 sensor. More...
 
struct  bmx280_t
 Device descriptor for the BMX280 sensor. More...
 

Enumerations

enum  bmx280_t_sb_t {
  BMX280_SB_0_5 = 0, BMX280_SB_62_5 = 1, BMX280_SB_125 = 2, BMX280_SB_250 = 3,
  BMX280_SB_500 = 4, BMX280_SB_1000 = 5, BMX280_SB_10 = 6, BMX280_SB_20 = 7
}
 Values for t_sb field of the BMX280 config register.
 
enum  bmx280_filter_t {
  BMX280_FILTER_OFF = 0, BMX280_FILTER_2 = 1, BMX280_FILTER_4 = 2, BMX280_FILTER_8 = 3,
  BMX280_FILTER_16 = 4
}
 Values for filter field of the BMX280 config register.
 
enum  bmx280_mode_t { BMX280_MODE_SLEEP = 0, BMX280_MODE_FORCED = 1, BMX280_MODE_FORCED2 = 2, BMX280_MODE_NORMAL = 3 }
 Values for mode field of the BMX280 ctrl_meas register.
 
enum  bmx280_osrs_t {
  BMX280_OSRS_SKIPPED = 0, BMX280_OSRS_X1 = 1, BMX280_OSRS_X2 = 2, BMX280_OSRS_X4 = 3,
  BMX280_OSRS_X8 = 4, BMX280_OSRS_X16 = 5
}
 Values for oversampling settings. More...
 
enum  { BMX280_OK = 0, BMX280_ERR_I2C = -1, BMX280_ERR_NODEV = -2, BMX280_ERR_NOCAL = -3 }
 Status and error return codes. More...
 

Functions

int bmx280_init (bmx280_t *dev, const bmx280_params_t *params)
 Initialize the given BMX280 device. More...
 
int16_t bmx280_read_temperature (const bmx280_t *dev)
 Read temperature value from the given BMX280 device, returned in centi °C. More...
 
uint32_t bmx280_read_pressure (const bmx280_t *dev)
 Read air pressure value from the given BMX280 device, returned in PA. More...