Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_Baro/AP_Baro_AUAV.h
9807 views
1
#pragma once
2
3
#include "AP_Baro_Backend.h"
4
5
#if AP_BARO_AUAV_ENABLED
6
7
#include <AP_HAL/AP_HAL.h>
8
#include <AP_HAL/Device.h>
9
10
// Baro uses the airspeed AUAV Pressure sensor class from airspeed, airspeed must be enabled
11
#include <AP_Airspeed/AP_Airspeed_config.h>
12
#if !AP_AIRSPEED_AUAV_ENABLED
13
#error AUAV Baro requires AUAV Airspeed
14
#endif
15
16
#include <AP_Airspeed/AP_Airspeed_AUAV.h>
17
18
19
#ifndef HAL_BARO_AUAV_I2C_ADDR
20
#define HAL_BARO_AUAV_I2C_ADDR 0x27
21
#endif
22
23
class AP_Baro_AUAV : public AP_Baro_Backend {
24
public:
25
AP_Baro_AUAV(AP_Baro &baro, AP_HAL::Device *dev);
26
27
void update() override;
28
29
static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::Device &dev);
30
31
protected:
32
bool init();
33
34
void timer();
35
36
AP_HAL::Device *dev;
37
38
AUAV_Pressure_sensor sensor { dev, AUAV_Pressure_sensor::Type::Absolute };
39
40
uint8_t instance;
41
42
uint32_t count;
43
float pressure_sum;
44
float temperature_sum;
45
46
bool measurement_requested;
47
};
48
49
#endif // AP_BARO_AUAV_ENABLED
50
51