Path: blob/master/libraries/AP_Airspeed/AP_Airspeed_ASP5033.h
9814 views
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/14#pragma once1516#include "AP_Airspeed_config.h"1718#if AP_AIRSPEED_ASP5033_ENABLED1920/*21backend driver for airspeed from I2C22*/23#include "AP_Airspeed_Backend.h"24#include <AP_HAL/I2CDevice.h>2526class AP_Airspeed_ASP5033 : public AP_Airspeed_Backend27{28public:29using AP_Airspeed_Backend::AP_Airspeed_Backend;3031~AP_Airspeed_ASP5033(void) {32delete dev;33}3435bool init() override;3637// return the current differential_pressure in Pascal38bool get_differential_pressure(float &_pressure) override;3940// return the current temperature in degrees C, if available41bool get_temperature(float &_temperature) override;4243private:44void timer();45bool confirm_sensor_id(void);46float temp_sum;47float press_sum;48float last_pressure;49float last_temperature;50uint32_t press_count;51uint32_t temp_count;52uint32_t last_sample_ms;5354AP_HAL::I2CDevice *dev;55};5657#endif // AP_AIRSPEED_ASP5033_ENABLED585960