BMP280 - Barometric Pressure Sensor#

Driver for the Bosch Sensortec BMP280 barometric pressure sensor.

BMP280 example#

Basic example for performing pressure measurement:

#include "sl_i2cspm_instances.h"
#include "sl_bmp280.h"

int main( void )
{

  ...

  float pressure;

  sl_bmp280_init(sl_i2cspm_sensor_env);
  sl_bmp280_measure_pressure(sl_i2cspm_sensor_env, &pressure);

  ...

} 

Modules#

sl_bmp280_config_t

Functions#

sl_status_t
sl_bmp280_init(sl_i2cspm_t *i2cspm)

Initialize the barometric pressure sensor chip.

void
sl_bmp280_deinit(sl_i2cspm_t *i2cspm)

De-initialize the barometric pressure module.

sl_status_t
sl_bmp280_configure(sl_i2cspm_t *i2cspm, sl_bmp280_config_t *cfg)

Configure the barometric pressure sensor.

sl_status_t
sl_bmp280_measure_temperature(sl_i2cspm_t *i2cspm, float *temperature)

Initiate temperature measurement on the barometric pressure sensor and read temperature from it.

sl_status_t
sl_bmp280_measure_pressure(sl_i2cspm_t *i2cspm, float *pressure)

Initiate pressure measurement on the barometric pressure sensor and read pressure from it.

Function Documentation#

sl_bmp280_init#

sl_status_t sl_bmp280_init (sl_i2cspm_t * i2cspm)

Initialize the barometric pressure sensor chip.

Parameters
[in]i2cspm

The I2CSPM instance to use.


Definition at line 91 of file hardware/driver/bmp280/inc/sl_bmp280.h

sl_bmp280_deinit#

void sl_bmp280_deinit (sl_i2cspm_t * i2cspm)

De-initialize the barometric pressure module.

Parameters
[in]i2cspm

The I2CSPM instance to use.


Definition at line 100 of file hardware/driver/bmp280/inc/sl_bmp280.h

sl_bmp280_configure#

sl_status_t sl_bmp280_configure (sl_i2cspm_t * i2cspm, sl_bmp280_config_t * cfg)

Configure the barometric pressure sensor.

Parameters
[in]i2cspm

The I2CSPM instance to use.

[in]cfg

Structure, which holds the configuration parameters

Note

  • Make sure to pass by Sleep Mode before switching between Forced mode and normal mode. Refer to datasheet for more details.


Definition at line 119 of file hardware/driver/bmp280/inc/sl_bmp280.h

sl_bmp280_measure_temperature#

sl_status_t sl_bmp280_measure_temperature (sl_i2cspm_t * i2cspm, float * temperature)

Initiate temperature measurement on the barometric pressure sensor and read temperature from it.

Parameters
[in]i2cspm

The I2CSPM instance to use.

[out]temperature

The measured temperature in degrees Celsius


Definition at line 135 of file hardware/driver/bmp280/inc/sl_bmp280.h

sl_bmp280_measure_pressure#

sl_status_t sl_bmp280_measure_pressure (sl_i2cspm_t * i2cspm, float * pressure)

Initiate pressure measurement on the barometric pressure sensor and read pressure from it.

Parameters
[in]i2cspm

The I2CSPM instance to use.

[out]pressure

The measured pressure in millibars.


Definition at line 151 of file hardware/driver/bmp280/inc/sl_bmp280.h