BME280 Driver 2.0.x
Driver for BME280 sensor
Loading...
Searching...
No Matches
Collaboration diagram for Functions:

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
 

Detailed Description

Function Documentation

◆ bme280_busy_check()

static int8_t bme280_busy_check ( BME280_t Dev)
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

Here is the caller graph for this function:

◆ bme280_compensate_h_u32t()

static BME280_U32_t bme280_compensate_h_u32t ( BME280_t Dev,
BME280_S32_t  adc_H 
)
static

compensate humidity value

Function returns compensated humidity in RH as unsigned 32bit integer. Output value of "47445" represents 47445/1000 = 47.445 RH

Here is the caller graph for this function:

◆ bme280_compensate_p_u32t()

static BME280_U32_t bme280_compensate_p_u32t ( BME280_t Dev,
BME280_S32_t  adc_P 
)
static

compensate pressure value

Function returns compensated pressure in Pa as unsigned 32 bit integer. Output value depends of USE_64BIT configuration.

Here is the caller graph for this function:

◆ bme280_compensate_t_s32t()

static BME280_S32_t bme280_compensate_t_s32t ( BME280_t Dev,
BME280_S32_t  adc_T 
)
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.

Here is the caller graph for this function:

◆ bme280_convert_h_U32_float()

static void bme280_convert_h_U32_float ( BME280_U32_t  hum_in,
float *  hum_out 
)
static

convert humidity to structure

Function converts humidity stored in BME280_U32_t to float variable

Here is the caller graph for this function:

◆ bme280_convert_h_U32_struct()

static void bme280_convert_h_U32_struct ( BME280_U32_t  hum,
BME280_Data_t data 
)
static

convert humidity to structure

Function converts humidity stored in BME280_U32_t to BME280_Data_t structure

Here is the caller graph for this function:

◆ bme280_convert_p_U32_float()

static void bme280_convert_p_U32_float ( BME280_U32_t  press_in,
float *  press_out 
)
static

convert pressure to structure

Function converts pressure stored in BME280_U32_t to float variable

Here is the caller graph for this function:

◆ bme280_convert_p_U32_struct()

static void bme280_convert_p_U32_struct ( BME280_U32_t  press,
BME280_Data_t data 
)
static

convert pressure to structure

Function converts pressure stored in BME280_U32_t to BME280_Data_t structure

Here is the caller graph for this function:

◆ bme280_convert_t_S32_float()

static void bme280_convert_t_S32_float ( BME280_S32_t  temp_in,
float *  temp_out 
)
static

convert temperature to float

Function converts temperature stored in BME280_S32_t to float variable

Here is the caller graph for this function:

◆ bme280_convert_t_S32_struct()

static void bme280_convert_t_S32_struct ( BME280_S32_t  temp,
BME280_Data_t data 
)
static

convert temperature to structure

Function converts temperature stored in BME280_S32_t to BME280_Data_t structure

Here is the caller graph for this function:

◆ bme280_is_normal_mode()

static int8_t bme280_is_normal_mode ( BME280_t Dev)
static

check for normal mode

Function checks if device is initializes and if it's status in *Dev structure is set as "normal_mode"

Here is the caller graph for this function:

◆ bme280_is_sleep_mode()

static int8_t bme280_is_sleep_mode ( BME280_t Dev)
static

check for sleep mode

Function checks if device is initializes and if it's status in *Dev structure is set as "sleep_mode"

Here is the caller graph for this function:

◆ bme280_osrs_to_oversampling()

static void bme280_osrs_to_oversampling ( uint8_t *  osrs)
static

change osrs_x reg value to oversampling

Function converts register value to oversampling value f.e. osrs_p = 0x04 then pressure oversampling = x8

Here is the caller graph for this function:

◆ bme280_parse_hum_s32t()

static BME280_S32_t bme280_parse_hum_s32t ( uint8_t *  raw)
static

convert buffer to single variable

Function converts raw adc values of humidity to single BME280_S32_t variable

Here is the caller graph for this function:

◆ bme280_parse_press_temp_s32t()

static BME280_S32_t bme280_parse_press_temp_s32t ( uint8_t *  raw)
static

convert buffer to single variable

Function converts raw adc values of temperature or pressure to single BME280_S32_t variable

Here is the caller graph for this function:

◆ bme280_read_compensate()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bme280_read_compensation_parameters()

static int8_t bme280_read_compensation_parameters ( BME280_t Dev)
static

read compensation data

Function reads individual compensation data from sensor and stores them into BME280_calibration_data inside *Dev structure

Here is the caller graph for this function:

◆ bme280_set_forced_mode()

static int8_t bme280_set_forced_mode ( BME280_t Dev,
uint8_t *  delay 
)
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

Here is the call graph for this function:
Here is the caller graph for this function: