ardupilot/libraries/AP_Baro/AP_Baro_BMP581.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
840 B
C
Raw Normal View History

2024-06-05 23:31:11 -03:00
#pragma once
#include "AP_Baro_Backend.h"
#if AP_BARO_BMP581_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/Device.h>
#include <AP_HAL/utility/OwnPtr.h>
#ifndef HAL_BARO_BMP581_I2C_ADDR
#define HAL_BARO_BMP581_I2C_ADDR (0x46)
#endif
#ifndef HAL_BARO_BMP581_I2C_ADDR2
#define HAL_BARO_BMP581_I2C_ADDR2 (0x47)
#endif
class AP_Baro_BMP581 : public AP_Baro_Backend
{
public:
AP_Baro_BMP581(AP_Baro &baro, AP_HAL::OwnPtr<AP_HAL::Device> dev);
/* AP_Baro public interface: */
void update() override;
static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::OwnPtr<AP_HAL::Device> dev);
private:
bool init(void);
void timer(void);
AP_HAL::OwnPtr<AP_HAL::Device> _dev;
uint8_t instance;
float pressure_sum;
uint32_t pressure_count;
float temperature;
};
#endif // AP_BARO_BMP581_ENABLED