Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / fc / rc.h
blob4fe55b9b12825bd8127153ca9c9d883a72adc1bc
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 float getThrottlePIDAttenuation(void);
37 void updateRcCommands(void);
38 void resetYawAxis(void);
39 void initRcProcessing(void);
40 bool isMotorsReversed(void);
41 rcSmoothingFilter_t *getRcSmoothingData(void);
42 bool rcSmoothingAutoCalculate(void);
43 bool rcSmoothingInitializationComplete(void);
44 float getRawSetpoint(int axis);
45 float getRcCommandDelta(int axis);
46 float applyCurve(int axis, float deflection);
47 bool getShouldUpdateFeedforward();
48 void updateRcRefreshRate(timeUs_t currentTimeUs);
49 uint16_t getCurrentRxRefreshRate(void);
50 bool getRxRateValid(void);