Merge pull request #11483 from SteveCEvans/elrs_race
[betaflight.git] / src / main / fc / rc.h
blob4babf5ebc888a075ba4f08e3b5e6811843003e45
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #include "drivers/time.h"
25 #include "fc/rc_controls.h"
27 #ifdef USE_RC_SMOOTHING_FILTER
28 #define RC_SMOOTHING_AUTO_FACTOR_MIN 0
29 #define RC_SMOOTHING_AUTO_FACTOR_MAX 250
30 #endif
32 void processRcCommand(void);
33 float getSetpointRate(int axis);
34 float getRcDeflection(int axis);
35 float getRcDeflectionAbs(int axis);
36 void updateRcCommands(void);
37 void resetYawAxis(void);
38 void initRcProcessing(void);
39 bool isMotorsReversed(void);
40 rcSmoothingFilter_t *getRcSmoothingData(void);
41 bool rcSmoothingAutoCalculate(void);
42 bool rcSmoothingInitializationComplete(void);
43 float getRawSetpoint(int axis);
44 float getRcCommandDelta(int axis);
45 float applyCurve(int axis, float deflection);
46 bool getShouldUpdateFeedforward();
47 void updateRcRefreshRate(timeUs_t currentTimeUs);
48 uint16_t getCurrentRxRefreshRate(void);
49 bool getRxRateValid(void);