BME280 Driver 2.0.x
Driver for BME280 sensor
|
Functions | |
static int8_t | bme280_read_compensation_parameters (BME280_t *Dev) |
read compensation data | |
static int8_t | bme280_read_compensate (uint8_t read_type, BME280_t *Dev, BME280_S32_t *temp, BME280_U32_t *press, BME280_U32_t *hum) |
read and compensate measured values | |
static BME280_S32_t | bme280_parse_press_temp_s32t (uint8_t *raw) |
convert buffer to single variable | |
static BME280_S32_t | bme280_parse_hum_s32t (uint8_t *raw) |
convert buffer to single variable | |
static BME280_S32_t | bme280_compensate_t_s32t (BME280_t *Dev, BME280_S32_t adc_T) |
compensate temperature value | |
static BME280_U32_t | bme280_compensate_p_u32t (BME280_t *Dev, BME280_S32_t adc_P) |
compensate pressure value | |
static BME280_U32_t | bme280_compensate_h_u32t (BME280_t *Dev, BME280_S32_t adc_H) |
compensate humidity value | |
static void | bme280_convert_t_S32_struct (BME280_S32_t temp, BME280_Data_t *data) |
convert temperature to structure | |
static void | bme280_convert_t_S32_float (BME280_S32_t temp_in, float *temp_out) |
convert temperature to float | |
static void | bme280_convert_p_U32_struct (BME280_U32_t press, BME280_Data_t *data) |
convert pressure to structure | |
static void | bme280_convert_p_U32_float (BME280_U32_t press_in, float *press_out) |
convert pressure to structure | |
static void | bme280_convert_h_U32_struct (BME280_U32_t hum, BME280_Data_t *data) |
convert humidity to structure | |
static void | bme280_convert_h_U32_float (BME280_U32_t hum_in, float *hum_out) |
convert humidity to structure | |
static int8_t | bme280_is_normal_mode (BME280_t *Dev) |
check for normal mode | |
static int8_t | bme280_is_sleep_mode (BME280_t *Dev) |
check for sleep mode | |
static int8_t | bme280_set_forced_mode (BME280_t *Dev, uint8_t *delay) |
check and set forced mode | |
static void | bme280_osrs_to_oversampling (uint8_t *osrs) |
change osrs_x reg value to oversampling | |
static int8_t | bme280_busy_check (BME280_t *Dev) |
check if sensor is busy | |
|
static |
check if sensor is busy
Function reads "status" register and checks value of two its bits returns BME280_BUSY_ERR if any of them is set
|
static |
compensate humidity value
Function returns compensated humidity in RH as unsigned 32bit integer. Output value of "47445" represents 47445/1000 = 47.445 RH
|
static |
compensate pressure value
Function returns compensated pressure in Pa as unsigned 32 bit integer. Output value depends of USE_64BIT configuration.
|
static |
compensate temperature value
Function returns compensated temperature in DegC, resolution is 0.01 DegC. Output value of “5123” equals 51.23 DegC. It calculates t_fine variable stored inside *Dev structure as well.
|
static |
convert humidity to structure
Function converts humidity stored in BME280_U32_t to float variable
|
static |
convert humidity to structure
Function converts humidity stored in BME280_U32_t to BME280_Data_t structure
|
static |
convert pressure to structure
Function converts pressure stored in BME280_U32_t to float variable
|
static |
convert pressure to structure
Function converts pressure stored in BME280_U32_t to BME280_Data_t structure
|
static |
convert temperature to float
Function converts temperature stored in BME280_S32_t to float variable
|
static |
convert temperature to structure
Function converts temperature stored in BME280_S32_t to BME280_Data_t structure
|
static |
check for normal mode
Function checks if device is initializes and if it's status in *Dev structure is set as "normal_mode"
|
static |
check for sleep mode
Function checks if device is initializes and if it's status in *Dev structure is set as "sleep_mode"
|
static |
change osrs_x reg value to oversampling
Function converts register value to oversampling value f.e. osrs_p = 0x04 then pressure oversampling = x8
|
static |
convert buffer to single variable
Function converts raw adc values of humidity to single BME280_S32_t variable
|
static |
convert buffer to single variable
Function converts raw adc values of temperature or pressure to single BME280_S32_t variable
|
static |
read and compensate measured values
Function reads selected adc values from sensor, converts them into single variables and compensate with calibration data stored in BME280_calibration_data inside *Dev structure. These variales are then returned as single integer values.
|
static |
read compensation data
Function reads individual compensation data from sensor and stores them into BME280_calibration_data inside *Dev structure
|
static |
check and set forced mode
Function checks if conditions to set forced mode are met, calculates and returns required delay time (via *delay pointer) then sets forced mode
0xFC - 0b11111100