BMP3xx - Barometric Pressure Sensor#
Driver for the Bosch Sensortec BMP3xx barometric pressure sensor.
BMP3xx example#
Basic example to perform pressure measurement:
#include "sl_i2cspm_instances.h"
#include "sl_bmp3xx.h"
int main( void )
{
...
float pressure;
int8_t result;
result = sl_bmp3xx_init(sl_i2cspm_sensor_env);
if (result != SL_STATUS_OK) {
return SL_STATUS_FAIL;
}
result = sl_bmp3xx_measure_pressure(sl_i2cspm_sensor_env, &pressure);
if (result != SL_STATUS_OK) {
return SL_STATUS_FAIL;
}
...
}
Modules#
Functions#
Initialize the barometric pressure sensor chip.
De-initialize the barometric pressure module.
Set the barometric pressure sensor configuration.
Get the barometric pressure sensor configuration.
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_bmp3xx_init#
sl_status_t sl_bmp3xx_init (sl_i2cspm_t * i2cspm)
Initialize the barometric pressure sensor chip.
[in] | i2cspm | The I2CSPM instance to use. |
128
of file hardware/driver/bmp3xx/inc/sl_bmp3xx.h
sl_bmp3xx_deinit#
void sl_bmp3xx_deinit (sl_i2cspm_t * i2cspm)
De-initialize the barometric pressure module.
[in] | i2cspm | The I2CSPM instance to use. |
137
of file hardware/driver/bmp3xx/inc/sl_bmp3xx.h
sl_bmp3xx_set_config#
sl_status_t sl_bmp3xx_set_config (sl_i2cspm_t * i2cspm, sl_bmp3xx_config_t * cfg)
Set the barometric pressure sensor configuration.
[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.
156
of file hardware/driver/bmp3xx/inc/sl_bmp3xx.h
sl_bmp3xx_get_config#
void sl_bmp3xx_get_config (sl_i2cspm_t * i2cspm, sl_bmp3xx_config_t * cfg)
Get the barometric pressure sensor configuration.
[in] | i2cspm | The I2CSPM instance to use. |
[out] | cfg | Structure to get the sensor configuration. |
168
of file hardware/driver/bmp3xx/inc/sl_bmp3xx.h
sl_bmp3xx_measure_temperature#
sl_status_t sl_bmp3xx_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 |
It is a blocking function.
184
of file hardware/driver/bmp3xx/inc/sl_bmp3xx.h
sl_bmp3xx_measure_pressure#
sl_status_t sl_bmp3xx_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 Pascal. |
It is a blocking function.
200
of file hardware/driver/bmp3xx/inc/sl_bmp3xx.h