F439_CPP_BMP390_Barometric_Pressure_and_Altimeter_01 1.0
STM32F439 BMP390 barometric pressure and altimeter tutorial
Loading...
Searching...
No Matches
Power mode

Set / Get power mode of the sensor.

Set / Get power mode of the sensor.

bmp3_set_op_mode

int8_t bmp3_set_op_mode(struct bmp3_settings *settings, struct bmp3_dev *dev);
This API sets the power mode of the sensor.
Parameters
[in]settings: Structure instance of bmp3_settings
[in]dev: Structure instance of bmp3_dev.
* ----------------------|-------------------
* dev->settings.op_mode |   Macros
* ----------------------|-------------------
*     0                 | BMP3_MODE_SLEEP
*     1                 | BMP3_MODE_FORCED
*     3                 | BMP3_MODE_NORMAL
* ----------------------|-------------------
*
Note
: Before setting normal mode, valid odr and osr settings should be set in the sensor by using 'bmp3_set_sensor_settings' function.
Returns
Result of API execution status
Return values
0-> Success
>0-> Warning
<0-> Error

bmp3_get_op_mode

int8_t bmp3_get_op_mode(uint8_t *op_mode, const struct bmp3_dev *dev);
This API gets the power mode of the sensor.
Parameters
[in]dev: Structure instance of bmp3_dev.
[out]op_mode: Pointer variable to store the op-mode.
* ------------------------------------------
*   op_mode             |   Macros
* ----------------------|-------------------
*     0                 | BMP3_MODE_SLEEP
*     1                 | BMP3_MODE_FORCED
*     3                 | BMP3_MODE_NORMAL
* ------------------------------------------
*
Returns
Result of API execution status
Return values
0-> Success
>0-> Warning
<0-> Error