2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
20 #include "config/parameter_group.h"
21 #include "common/filter.h"
22 #include "common/calibration.h"
24 #include "drivers/pitotmeter/pitotmeter.h"
36 #define PITOT_MAX PITOT_FAKE
37 #define PITOT_SAMPLE_COUNT_MAX 48
39 typedef struct pitotmeterConfig_s
{
40 uint8_t pitot_hardware
; // Pitotmeter hardware to use
41 uint16_t pitot_lpf_milli_hz
; // additional LPF to reduce pitot noise in [0.001Hz]
42 float pitot_scale
; // scale value
45 PG_DECLARE(pitotmeterConfig_t
, pitotmeterConfig
);
47 typedef struct pito_s
{
51 zeroCalibrationScalar_t zeroCalibration
;
53 timeUs_t lastMeasurementUs
;
54 timeMs_t lastSeenHealthyMs
;
65 bool pitotIsCalibrationComplete(void);
66 void pitotStartCalibration(void);
67 void pitotUpdate(void);
68 float getAirspeedEstimate(void);
69 bool pitotIsHealthy(void);