2016-01-29 07:38:33 -04:00
|
|
|
#pragma once
|
2013-09-28 05:40:29 -03:00
|
|
|
|
2015-08-11 03:28:42 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2016-01-29 07:38:33 -04:00
|
|
|
#include <AP_Param/AP_Param.h>
|
|
|
|
|
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:
|
2016-06-08 21:10:54 -03:00
|
|
|
AP_Airspeed_Analog(const AP_Int8 &pin, const AP_Float &psi_range)
|
2016-01-29 07:38:33 -04:00
|
|
|
: _source(NULL)
|
|
|
|
, _pin(pin)
|
2016-06-08 21:10:54 -03:00
|
|
|
, _psi_range(psi_range)
|
2016-01-29 07:38:33 -04:00
|
|
|
{ }
|
2013-09-28 05:40:29 -03:00
|
|
|
|
|
|
|
// probe and initialise the sensor
|
|
|
|
bool init(void);
|
|
|
|
|
|
|
|
// return the current differential_pressure in Pascal
|
|
|
|
bool get_differential_pressure(float &pressure);
|
|
|
|
|
|
|
|
// temperature not available via analog backend
|
|
|
|
bool get_temperature(float &temperature) { return false; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_HAL::AnalogSource *_source;
|
|
|
|
const AP_Int8 &_pin;
|
2016-06-08 21:10:54 -03:00
|
|
|
const AP_Float &_psi_range;
|
2013-09-28 05:40:29 -03:00
|
|
|
};
|