BME280 More...

Files

file  bme280.h
 BME280 Temperature, Humidty and Pressure Sensor.
 

Data Structures

struct  bme280_calib_data
 calibration data structure to hold coefficients More...
 

Enumerations

enum  {
  BME280_REGISTER_DIG_T1 = 0x88, BME280_REGISTER_DIG_T2 = 0x8A, BME280_REGISTER_DIG_T3 = 0x8C, BME280_REGISTER_DIG_P1 = 0x8E,
  BME280_REGISTER_DIG_P2 = 0x90, BME280_REGISTER_DIG_P3 = 0x92, BME280_REGISTER_DIG_P4 = 0x94, BME280_REGISTER_DIG_P5 = 0x96,
  BME280_REGISTER_DIG_P6 = 0x98, BME280_REGISTER_DIG_P7 = 0x9A, BME280_REGISTER_DIG_P8 = 0x9C, BME280_REGISTER_DIG_P9 = 0x9E,
  BME280_REGISTER_DIG_H1 = 0xA1, BME280_REGISTER_DIG_H2 = 0xE1, BME280_REGISTER_DIG_H3 = 0xE3, BME280_REGISTER_DIG_H4 = 0xE4,
  BME280_REGISTER_DIG_H5 = 0xE5, BME280_REGISTER_DIG_H6 = 0xE7, BME280_REGISTER_CHIPID = 0xD0, BME280_REGISTER_VERSION = 0xD1,
  BME280_REGISTER_SOFTRESET = 0xE0, BME280_REGISTER_CAL26 = 0xE1, BME280_REGISTER_CONTROLHUMID = 0xF2, BME280_REGISTER_CONTROL = 0xF4,
  BME280_REGISTER_CONFIG = 0xF5, BME280_REGISTER_PRESSUREDATA = 0xF7, BME280_REGISTER_TEMPDATA = 0xFA, BME280_REGISTER_HUMIDDATA = 0xFD
}
 register map for BME280 sensor More...
 

Functions

KSensorStatus bme280_setup (void)
 Setup the SPI interface for talking with the BME280 and init sensor. More...
 
KSensorStatus bme280_soft_reset (void)
 Reset the bme280 to default conditions. More...
 
KSensorStatus bme280_read_temperature (float *temp)
 Sends temperature command and reads back temperature data. More...
 
KSensorStatus bme280_read_pressure (float *press)
 Sends pressure command and reads back pressure data. More...
 
KSensorStatus bme280_read_humidity (float *hum)
 Sends humidity command and reads back humidity. More...
 
KSensorStatus bme280_read_altitude (float sea_level, float *alt)
 converts pressure to absolute altitude More...
 

Variables

uint16_t bme280_calib_data::dig_T1
 
int16_t bme280_calib_data::dig_T2
 
int16_t bme280_calib_data::dig_T3
 
uint16_t bme280_calib_data::dig_P1
 
int16_t bme280_calib_data::dig_P2
 
int16_t bme280_calib_data::dig_P3
 
int16_t bme280_calib_data::dig_P4
 
int16_t bme280_calib_data::dig_P5
 
int16_t bme280_calib_data::dig_P6
 
int16_t bme280_calib_data::dig_P7
 
int16_t bme280_calib_data::dig_P8
 
int16_t bme280_calib_data::dig_P9
 
uint8_t bme280_calib_data::dig_H1
 
int16_t bme280_calib_data::dig_H2
 
uint8_t bme280_calib_data::dig_H3
 
int16_t bme280_calib_data::dig_H4
 
int16_t bme280_calib_data::dig_H5
 
int8_t bme280_calib_data::dig_H6
 

Enumeration Type Documentation

anonymous enum

register map for BME280 sensor

Enumerator
BME280_REGISTER_DIG_T1 
BME280_REGISTER_DIG_T2 
BME280_REGISTER_DIG_T3 
BME280_REGISTER_DIG_P1 
BME280_REGISTER_DIG_P2 
BME280_REGISTER_DIG_P3 
BME280_REGISTER_DIG_P4 
BME280_REGISTER_DIG_P5 
BME280_REGISTER_DIG_P6 
BME280_REGISTER_DIG_P7 
BME280_REGISTER_DIG_P8 
BME280_REGISTER_DIG_P9 
BME280_REGISTER_DIG_H1 
BME280_REGISTER_DIG_H2 
BME280_REGISTER_DIG_H3 
BME280_REGISTER_DIG_H4 
BME280_REGISTER_DIG_H5 
BME280_REGISTER_DIG_H6 
BME280_REGISTER_CHIPID 
BME280_REGISTER_VERSION 
BME280_REGISTER_SOFTRESET 
BME280_REGISTER_CAL26 
BME280_REGISTER_CONTROLHUMID 
BME280_REGISTER_CONTROL 
BME280_REGISTER_CONFIG 
BME280_REGISTER_PRESSUREDATA 
BME280_REGISTER_TEMPDATA 
BME280_REGISTER_HUMIDDATA 

Function Documentation

KSensorStatus bme280_read_altitude ( float  sea_level,
float *  alt 
)

converts pressure to absolute altitude

Parameters
sea_levelin hPa (1013.25 recommended)
altpointer to altitude in meters (m)
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_ERROR or SENSOR_READ_ERROR on error
KSensorStatus bme280_read_humidity ( float *  hum)

Sends humidity command and reads back humidity.

Parameters
humpointer to humidity in percentage (0.0 - 100.0)
Returns
KSensorStatus, SENSOR_OK on success,SENSOR_ERROR or SENSOR_READ_ERROR on error
KSensorStatus bme280_read_pressure ( float *  press)

Sends pressure command and reads back pressure data.

Parameters
presspointer to pressure data in Pa (101325.0 - 0.0)
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_ERROR or SENSOR_READ_ERROR on error
KSensorStatus bme280_read_temperature ( float *  temp)

Sends temperature command and reads back temperature data.

Parameters
temppointer to temperature data in celsius (-40.0 to 85.0)
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_ERROR or SENSOR_READ_ERROR on error
KSensorStatus bme280_setup ( void  )

Setup the SPI interface for talking with the BME280 and init sensor.

Returns
KSensorStatus, SENSOR_OK on success, SENSOR_WRITE_ERROR or SENSOR_NOT_FOUND on error
KSensorStatus bme280_soft_reset ( void  )

Reset the bme280 to default conditions.

Returns
KSensorStatus, SENSOR_OK on success, SENSOR_WRITE_ERROR on error

Variable Documentation

uint8_t bme280_calib_data::dig_H1
int16_t bme280_calib_data::dig_H2
uint8_t bme280_calib_data::dig_H3
int16_t bme280_calib_data::dig_H4
int16_t bme280_calib_data::dig_H5
int8_t bme280_calib_data::dig_H6
uint16_t bme280_calib_data::dig_P1
int16_t bme280_calib_data::dig_P2
int16_t bme280_calib_data::dig_P3
int16_t bme280_calib_data::dig_P4
int16_t bme280_calib_data::dig_P5
int16_t bme280_calib_data::dig_P6
int16_t bme280_calib_data::dig_P7
int16_t bme280_calib_data::dig_P8
int16_t bme280_calib_data::dig_P9
uint16_t bme280_calib_data::dig_T1
int16_t bme280_calib_data::dig_T2
int16_t bme280_calib_data::dig_T3