Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_Baro/AP_Baro_BMP581.h
9868 views
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
10
#ifndef HAL_BARO_BMP581_I2C_ADDR
11
#define HAL_BARO_BMP581_I2C_ADDR (0x46)
12
#endif
13
#ifndef HAL_BARO_BMP581_I2C_ADDR2
14
#define HAL_BARO_BMP581_I2C_ADDR2 (0x47)
15
#endif
16
17
class AP_Baro_BMP581 : public AP_Baro_Backend
18
{
19
public:
20
AP_Baro_BMP581(AP_Baro &baro, AP_HAL::Device &dev);
21
22
/* AP_Baro public interface: */
23
void update() override;
24
25
static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::Device &dev);
26
27
private:
28
29
bool init(void);
30
void timer(void);
31
32
AP_HAL::Device *_dev;
33
34
uint8_t instance;
35
float pressure_sum;
36
uint32_t pressure_count;
37
float temperature;
38
};
39
40
#endif // AP_BARO_BMP581_ENABLED
41
42