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"
37 #define PITOT_MAX PITOT_FAKE
38 #define PITOT_SAMPLE_COUNT_MAX 48
40 typedef struct pitotmeterConfig_s
{
41 uint8_t pitot_hardware
; // Pitotmeter hardware to use
42 uint16_t pitot_lpf_milli_hz
; // additional LPF to reduce pitot noise in [0.001Hz]
43 float pitot_scale
; // scale value
46 PG_DECLARE(pitotmeterConfig_t
, pitotmeterConfig
);
48 typedef struct pito_s
{
52 zeroCalibrationScalar_t zeroCalibration
;
54 timeUs_t lastMeasurementUs
;
55 timeMs_t lastSeenHealthyMs
;
67 bool pitotIsCalibrationComplete(void);
68 void pitotStartCalibration(void);
69 void pitotUpdate(void);
70 float getAirspeedEstimate(void);
71 bool pitotIsHealthy(void);