BME280 Driver 2.0.x
Driver for BME280 sensor
Loading...
Searching...
No Matches
Public functions

Use these functions only. More...

Collaboration diagram for Public functions:

Modules

 Get Functions
 Read sensor's settings.
 
 Set Functions
 change sensor's settings
 
 Read Functions (int)
 read measured data from sensor as integers
 
 Read Functions (float)
 read measured data from sensor as floating point values
 

Functions

int8_t BME280_Init (BME280_t *Dev, BME280_Driver_t *Driver)
 Function to initialize sensor and resources.
 
int8_t BME280_Reset (BME280_t *Dev)
 Function to perform sensor's software reset.
 
int8_t BME280_ConfigureAll (BME280_t *Dev, BME280_Config_t *Config)
 Function to set all sensor settings at once.
 

Detailed Description

Use these functions only.

Function Documentation

◆ BME280_ConfigureAll()

int8_t BME280_ConfigureAll ( BME280_t Dev,
BME280_Config_t Config 
)

Function to set all sensor settings at once.

Note
Sensor must be in BME280_SLEEPMODE to set all parameters. Force BME280_SLEEPMODE with BME280_SetMode function before or use it directly after BME280_Init function only.

Function writes all 3 config registers without reading them before. It can be usefull after power-up or reset. It sets current operating mode inside *Dev structure at the end.

Parameters
[in]*Devpointer to sensor's BME280_t structure
[in]*Configpointer to BME280_Config_t structure which contains all paramaters to be set
Returns
BME280_OK success
BME280_PARAM_ERR wrong parameter passed
BME280_INTERFACE_ERR user defined read/write function returned non-zero value
BME280_NO_INIT_ERR sensor was not initialized before
BME280_CONDITION_ERR sensor is not in BME280_SLEEPMODE
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BME280_Init()

int8_t BME280_Init ( BME280_t Dev,
BME280_Driver_t Driver 
)

Function to initialize sensor and resources.

Note
This must be a first function usend in code before any other opearion can be performed!

Init funtion performs sensor reset and checks BME280_ID. It doesn't set any sensor's parameters. Calibration data specific for each one sensor are read while Init function. If operation is completed with success function sets "initialized" value in BME280_t structure.

Parameters
[in]*Devpointer to BME280_t structure which should be initialized
[in]*Driverpointer to BME280_Driver_t structure where all platform specific data are stored. This structure MUST exist while program is running - do not use local structures to init sensor!
Returns
BME280_OK success
BME280_PARAM_ERR wrong parameter passed
BME280_INTERFACE_ERR user defined read/write function returned non-zero value
BME280_ID_ERR sensor's id doesnt match with BME280_ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BME280_Reset()

int8_t BME280_Reset ( BME280_t Dev)

Function to perform sensor's software reset.

Function sends BME280_RESET_VALUE to BME280_RESET_ADDR. To perform this operation bme280_writeregister function must be set inside BME280_t *Dev structure. Function sets "sleep_mode" inside *Dev structure after reset.

Parameters
[in]*Devpointer to sensor's BME280_t structure
Returns
BME280_OK success
BME280_PARAM_ERR wrong parameter passed or bme280_writeregister function is not set
BME280_INTERFACE_ERR user defined read/write function returned non-zero value
Here is the caller graph for this function: