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#
Functions#
Initialize the barometric pressure sensor chip.
De-initialize the barometric pressure module.
Configure the barometric pressure sensor.
Initiate temperature measurement on the barometric pressure sensor and read temperature from it.
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.
[in] | i2cspm | The I2CSPM instance to use. |
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.
[in] | i2cspm | The I2CSPM instance to use. |
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.
[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.
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.
[in] | i2cspm | The I2CSPM instance to use. |
[out] | temperature | The measured temperature in degrees Celsius |
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.
[in] | i2cspm | The I2CSPM instance to use. |
[out] | pressure | The measured pressure in millibars. |
151
of file hardware/driver/bmp280/inc/sl_bmp280.h