2016-01-29 07:38:33 -04:00
|
|
|
#pragma once
|
2013-09-28 05:40:29 -03:00
|
|
|
|
2023-06-09 02:58:29 -03:00
|
|
|
#include "AP_Airspeed_config.h"
|
2022-05-04 05:13:29 -03:00
|
|
|
|
|
|
|
#if AP_AIRSPEED_ANALOG_ENABLED
|
|
|
|
|
2015-08-11 03:28:42 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2016-01-29 07:38:33 -04:00
|
|
|
|
2015-08-11 03:28:42 -03:00
|
|
|
#include "AP_Airspeed_Backend.h"
|
2013-09-28 05:40:29 -03:00
|
|
|
|
|
|
|
class AP_Airspeed_Analog : public AP_Airspeed_Backend
|
|
|
|
{
|
|
|
|
public:
|
2017-11-03 03:17:34 -03:00
|
|
|
AP_Airspeed_Analog(AP_Airspeed &frontend, uint8_t _instance);
|
2013-09-28 05:40:29 -03:00
|
|
|
|
|
|
|
// probe and initialise the sensor
|
2016-11-30 00:49:19 -04:00
|
|
|
bool init(void) override;
|
2013-09-28 05:40:29 -03:00
|
|
|
|
|
|
|
// return the current differential_pressure in Pascal
|
2016-11-30 00:49:19 -04:00
|
|
|
bool get_differential_pressure(float &pressure) override;
|
2013-09-28 05:40:29 -03:00
|
|
|
|
|
|
|
// temperature not available via analog backend
|
2016-11-30 00:49:19 -04:00
|
|
|
bool get_temperature(float &temperature) override { return false; }
|
2013-09-28 05:40:29 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
AP_HAL::AnalogSource *_source;
|
|
|
|
};
|
2022-05-04 05:13:29 -03:00
|
|
|
|
|
|
|
#endif // AP_AIRSPEED_ANALOG_ENABLED
|