NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rc_controls.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Copyright: collective.
5  * Cleanup: Martin Schröder <mkschreder.uk@gmail.com>
6  * Original source from Cleanflight.
7  *
8  * Ninjaflight is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Ninjaflight is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 #define MAX_MODE_ACTIVATION_CONDITION_COUNT 20
25 
26 typedef enum {
27  BOXARM = 0,
31  // BOXVARIO,
57 } boxId_e;
58 
59 // steps are 25 apart
60 // a value of 0 corresponds to a channel value of 900 or less
61 // a value of 48 corresponds to a channel value of 2100 or more
62 // 48 steps between 900 and 1200
63 typedef struct channelRange_s {
64  uint8_t startStep;
65  uint8_t endStep;
66 } __attribute__((packed)) channelRange_t;
67 
68 struct rc_func_range {
70  uint8_t auxChannelIndex;
71  channelRange_t range;
72 } __attribute__((packed)) ;
73 
76 };
77 
78 struct arming_config {
79  // Arming configuration
80  uint8_t retarded_arm;
83  uint8_t max_arm_angle;
84 };
85 
87  uint8_t deadband;
88  uint8_t yaw_deadband;
93 };
94 
Definition: rc_controls.h:41
Definition: rc_controls.h:36
boxId_e modeId
Definition: rc_controls.h:69
struct rc_func_range ranges[MAX_MODE_ACTIVATION_CONDITION_COUNT]
Definition: rc_controls.h:75
uint8_t yaw_deadband
introduce a deadband around the stick center for yaw axis. Must be greater than zero.
Definition: rc_controls.h:88
uint8_t alt_hold_fast_change
when disabled, turn off the althold when throttle stick is out of deadband defined with alt_hold_dead...
Definition: rc_controls.h:90
Definition: rc_controls.h:42
Definition: rc_controls.h:56
Definition: rc_controls.h:32
Definition: rc_controls.h:45
Definition: rc_controls.h:46
Definition: rc_controls.h:33
uint8_t disarm_kill_switch
allow disarm via AUX switch regardless of throttle value
Definition: rc_controls.h:81
boxId_e
Definition: rc_controls.h:26
Definition: rc_controls.h:86
uint8_t auto_disarm_delay
allow automatically disarming multicopters after auto_disarm_delay seconds of zero throttle...
Definition: rc_controls.h:82
Definition: rc_controls.h:54
uint8_t auxChannelIndex
Definition: rc_controls.h:70
uint8_t max_arm_angle
specifies the maximum angle allow arming at.
Definition: rc_controls.h:83
uint16_t deadband3d_throttle
default throttle deadband from MIDRC
Definition: rc_controls.h:92
Definition: rc_controls.h:39
Definition: rc_controls.h:27
Definition: rc_controls.h:55
Definition: rc_controls.h:50
Definition: rc_controls.h:47
Definition: rc_controls.h:35
#define MAX_MODE_ACTIVATION_CONDITION_COUNT
Definition: rc_controls.h:24
Definition: rc_controls.h:43
int8_t yaw_control_direction
change control direction of yaw (inverted, normal)
Definition: rc_controls.h:91
uint8_t retarded_arm
allow disarm/arm on throttle down + roll left/right
Definition: rc_controls.h:80
uint8_t deadband
introduce a deadband around the stick center for pitch and roll axis. Must be greater than zero...
Definition: rc_controls.h:87
Definition: rc_controls.h:34
Definition: rc_controls.h:38
Definition: rc_controls.h:68
uint8_t endStep
Definition: rc_controls.h:65
channelRange_t range
Definition: rc_controls.h:71
typedef __attribute__
uint8_t startStep
Definition: rc_controls.h:64
Definition: rc_controls.h:30
Definition: rc_controls.h:78
Definition: rc_controls.h:48
Definition: rc_controls.h:49
Definition: rc_controls.h:40
Definition: rc_controls.h:28
Definition: rc_controls.h:63
uint8_t alt_hold_deadband
defines the neutral zone of throttle stick during altitude hold, default setting is +/-40 ...
Definition: rc_controls.h:89
Definition: rc_controls.h:52
Definition: rc_controls.h:37
Definition: rc_controls.h:29
Definition: rc_controls.h:51
Definition: rc_controls.h:53
Definition: rc_controls.h:74
Definition: rc_controls.h:44