Device driver interface for the BMP280 and BME280 sensors. More...

Detailed Description

Device driver interface for the BMP280 and BME280 sensors.

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 bmx280_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
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file bmx280.h.

#include <stdint.h>
#include "saul.h"
#include "periph/i2c.h"
+ Include dependency graph for bmx280.h:
+ This graph shows which files directly or indirectly include this file:

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

Macros

#define BMX280_RAW_LEN   (6U)
 Select the number or raw data bytes depending on the device type.
 

Enumerations

enum  bmx280_t_sb_t {
  BMX280_SB_0_5 = 0x00, BMX280_SB_62_5 = 0x20, BMX280_SB_125 = 0x40, BMX280_SB_250 = 0x60,
  BMX280_SB_500 = 0x80, BMX280_SB_1000 = 0xa0, BMX280_SB_10 = 0xc0, BMX280_SB_20 = 0xe0
}
 Values for t_sb field of the BMX280 config register.
 
enum  bmx280_filter_t {
  BMX280_FILTER_OFF = 0x00, BMX280_FILTER_2 = 0x04, BMX280_FILTER_4 = 0x08, BMX280_FILTER_8 = 0x0c,
  BMX280_FILTER_16 = 0x10
}
 Values for filter field of the BMX280 config register.
 
enum  bmx280_mode_t { BMX280_MODE_SLEEP = 0x00, BMX280_MODE_FORCED = 0x01, BMX280_MODE_NORMAL = 0x03 }
 Values for mode field of the BMX280 ctrl_meas register.
 
enum  bmx280_osrs_t {
  BMX280_OSRS_SKIPPED = 0x00, BMX280_OSRS_X1 = 0x01, BMX280_OSRS_X2 = 0x02, BMX280_OSRS_X4 = 0x03,
  BMX280_OSRS_X8 = 0x04, BMX280_OSRS_X16 = 0x05
}
 Values for oversampling settings. More...
 
enum  { BMX280_OK = 0, BMX280_ERR_BUS = -1, BMX280_ERR_NODEV = -2 }
 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 (bmx280_t *dev)
 Read temperature value from the given BMX280 device. More...
 
uint32_t bmx280_read_pressure (bmx280_t *dev)
 Read air pressure value from the given BMX280 device. More...
 
uint16_t bme280_read_humidity (bmx280_t *dev)
 Read humidity value from the given BME280 device. More...
 

Variables

const saul_driver_t bmx280_temperature_saul_driver
 Export of SAUL interface for temperature sensor.
 
const saul_driver_t bmx280_pressure_saul_driver
 Export of SAUL interface for pressure sensor.