CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_Baro/AP_Baro_BMP581.h
Views: 1798
1
#pragma once
2
3
#include "AP_Baro_Backend.h"
4
5
#if AP_BARO_BMP581_ENABLED
6
7
#include <AP_HAL/AP_HAL.h>
8
#include <AP_HAL/Device.h>
9
#include <AP_HAL/utility/OwnPtr.h>
10
11
#ifndef HAL_BARO_BMP581_I2C_ADDR
12
#define HAL_BARO_BMP581_I2C_ADDR (0x46)
13
#endif
14
#ifndef HAL_BARO_BMP581_I2C_ADDR2
15
#define HAL_BARO_BMP581_I2C_ADDR2 (0x47)
16
#endif
17
18
class AP_Baro_BMP581 : public AP_Baro_Backend
19
{
20
public:
21
AP_Baro_BMP581(AP_Baro &baro, AP_HAL::OwnPtr<AP_HAL::Device> dev);
22
23
/* AP_Baro public interface: */
24
void update() override;
25
26
static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::OwnPtr<AP_HAL::Device> dev);
27
28
private:
29
30
bool init(void);
31
void timer(void);
32
33
AP_HAL::OwnPtr<AP_HAL::Device> _dev;
34
35
uint8_t instance;
36
float pressure_sum;
37
uint32_t pressure_count;
38
float temperature;
39
};
40
41
#endif // AP_BARO_BMP581_ENABLED
42
43