[FLYWOOF411] add board documentation
[inav/snaewe.git] / src / main / fc / controlrate_profile.h
blobb8428347aaf90d702db96544a8bd6152031c654a
1 /*
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/>.
18 #pragma once
20 #include <stdint.h>
22 #include "config/parameter_group.h"
24 #define MAX_CONTROL_RATE_PROFILE_COUNT 3
26 Max and min available values for rates are now stored as absolute
27 tenths of degrees-per-second [dsp/10]
28 That means, max. rotation rate 180 equals 1800dps
30 New defaults of 200dps for pitch,roll and yaw are more less
31 equivalent of rates 0 from previous versions of iNav, Cleanflight, Baseflight
32 and so on.
34 #define CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_MAX 180
35 #define CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_MIN 6
36 #define CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_DEFAULT 20
37 #define CONTROL_RATE_CONFIG_YAW_RATE_MAX 180
38 #define CONTROL_RATE_CONFIG_YAW_RATE_MIN 2
39 #define CONTROL_RATE_CONFIG_YAW_RATE_DEFAULT 20
41 #define CONTROL_RATE_CONFIG_TPA_MAX 100
43 typedef struct controlRateConfig_s {
45 struct {
46 uint8_t rcMid8;
47 uint8_t rcExpo8;
48 uint8_t dynPID;
49 uint16_t pa_breakpoint; // Breakpoint where TPA is activated
50 uint16_t fixedWingTauMs; // Time constant of airplane TPA PT1-filter
51 } throttle;
53 struct {
54 uint8_t rcExpo8;
55 uint8_t rcYawExpo8;
56 uint8_t rates[3];
57 } stabilized;
59 struct {
60 uint8_t rcExpo8;
61 uint8_t rcYawExpo8;
62 uint8_t rates[3];
63 } manual;
65 struct {
66 uint8_t fpvCamAngleDegrees; // Camera angle to treat as "forward" base axis in ACRO (Roll and Yaw sticks will command rotation considering this axis)
67 } misc;
69 } controlRateConfig_t;
71 PG_DECLARE_ARRAY(controlRateConfig_t, MAX_CONTROL_RATE_PROFILE_COUNT, controlRateProfiles);
73 extern const controlRateConfig_t *currentControlRateProfile;
75 void setControlRateProfile(uint8_t profileIndex);
76 void changeControlRateProfile(uint8_t profileIndex);
77 void activateControlRateConfig(void);
78 uint8_t getCurrentControlRateProfile(void);