-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbmp390_runner.h
55 lines (43 loc) · 1.51 KB
/
bmp390_runner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*******************************************************************************
* @file bmp390_runner.h
* @brief BMP390 runner: init and data reading.
*******************************************************************************
*/
#ifndef NERVE__BMP390_RUNNER_H
#define NERVE__BMP390_RUNNER_H
/** Includes. *****************************************************************/
#include "bmp3.h"
#include "bmp3_hal_i2c.h"
#include "diagnostics.h"
/** Definitions. **************************************************************/
// Defines frame count to be requested.
#define FIFO_FRAME_COUNT UINT8_C(64)
#define FIFO_MAX_SIZE UINT16_C(512) // BMP390 Maximum FIFO size.
// Max is 512 total.
// Technically the FIFO_MAX_SIZE can be reduced to FIFO_FRAME_COUNT * 8.
// Header: 2 bytes.
// Temperature: 3 bytes.
// Pressure: 3 bytes.
/** Public variables. *********************************************************/
extern double bmp390_temperature;
extern double bmp390_pressure;
/** Public functions. *********************************************************/
/**
* @brief Initialize BMP390 with BMP3 driver.
*
* @return Result of BMP3 API execution status.
* @retval == 0 -> Success.
* @retval > 0 -> Warning.
* @retval < 0 -> Error.
*/
int8_t bmp390_init(void);
/**
* @brief Update pressure and temperature data using moving average filtering.
*
* @return Result of BMP3 API execution status.
* @retval == 0 -> Success.
* @retval > 0 -> Warning.
* @retval < 0 -> Error.
*/
void bmp390_get_data(void);
#endif