5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _DATACONSTANTS_H_
22 #define _DATACONSTANTS_H_
27 #define LUA_EXPORT(...) LEXP(__VA_ARGS__)
28 #define LUA_EXPORT_MULTIPLE(...) LEXP_MULTIPLE(__VA_ARGS__)
29 #define LUA_EXPORT_EXTRA(...) LEXP_EXTRA(__VA_ARGS__)
31 #define LUA_EXPORT(...)
32 #define LUA_EXPORT_MULTIPLE(...)
33 #define LUA_EXPORT_EXTRA(...)
38 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
39 #define MAX_FLIGHT_MODES 9
42 #define MAX_LOGICAL_SWITCHES 64
43 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
46 #define MAX_TRAINER_CHANNELS 16
47 #define MAX_TELEMETRY_SENSORS 32
48 #define MAX_CUSTOM_SCREENS 5
49 #elif defined(PCBFLAMENCO)
51 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
52 #define MAX_FLIGHT_MODES 9
55 #define MAX_LOGICAL_SWITCHES 32
56 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
59 #define MAX_TRAINER_CHANNELS 16
60 #define MAX_TELEMETRY_SENSORS 32
61 #elif defined(PCBTARANIS)
63 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
64 #define MAX_FLIGHT_MODES 9
67 #define MAX_LOGICAL_SWITCHES 64
68 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
71 #define MAX_TRAINER_CHANNELS 16
72 #define MAX_TELEMETRY_SENSORS 32
73 #elif defined(PCBSKY9X)
75 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
76 #define MAX_FLIGHT_MODES 9
79 #define MAX_LOGICAL_SWITCHES 64
80 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
82 #define MAX_TRAINER_CHANNELS 16
83 #define MAX_TELEMETRY_SENSORS 32
84 #elif defined(CPUM2560) || defined(CPUM2561)
86 #define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
87 #define MAX_FLIGHT_MODES 6
90 #define MAX_LOGICAL_SWITCHES 12
91 #define MAX_SPECIAL_FUNCTIONS 24 // number of functions assigned to switches
92 #define MAX_TRAINER_CHANNELS 8
93 #define MAX_TELEMETRY_SENSORS 0
94 #elif defined(CPUM128)
96 #define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
97 #define MAX_FLIGHT_MODES 5
100 #define MAX_LOGICAL_SWITCHES 12
101 #define MAX_SPECIAL_FUNCTIONS 24 // number of functions assigned to switches
102 #define MAX_TRAINER_CHANNELS 8
103 #define MAX_TELEMETRY_SENSORS 0
105 #define MAX_MODELS 16
106 #define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
107 #define MAX_FLIGHT_MODES 5
108 #define MAX_MIXERS 32
110 #define MAX_LOGICAL_SWITCHES 12
111 #define MAX_SPECIAL_FUNCTIONS 16 // number of functions assigned to switches
112 #define MAX_TRAINER_CHANNELS 8
113 #define MAX_TELEMETRY_SENSORS 0
123 #define NUM_CAL_PPM 4
128 CURVE_TYPE_LAST
= CURVE_TYPE_CUSTOM
132 #define MIN_POINTS_PER_CURVE 3
134 #define MIN_POINTS_PER_CURVE 3
137 #define MAX_POINTS_PER_CURVE 17
139 #if defined(PCBHORUS)
140 #define LEN_MODEL_NAME 15
141 #define LEN_TIMER_NAME 8
142 #define LEN_FLIGHT_MODE_NAME 10
143 #define LEN_BITMAP_NAME 10 // TODO next EEPROM change: we need 14 here as we have to store the file extension
144 #define LEN_EXPOMIX_NAME 6
145 #define LEN_CHANNEL_NAME 6
146 #define LEN_INPUT_NAME 4
147 #define LEN_CURVE_NAME 3
148 #define LEN_FUNCTION_NAME 6
149 #define MAX_CURVES 32
150 #define MAX_CURVE_POINTS 512
151 #elif defined(PCBFLAMENCO)
152 #define LEN_MODEL_NAME 12
153 #define LEN_TIMER_NAME 8
154 #define LEN_FLIGHT_MODE_NAME 10
155 #define LEN_EXPOMIX_NAME 6
156 #define LEN_CHANNEL_NAME 6
157 #define LEN_INPUT_NAME 4
158 #define LEN_CURVE_NAME 3
159 #define LEN_FUNCTION_NAME 8
160 #define MAX_CURVES 32
161 #define MAX_CURVE_POINTS 512
162 #elif defined(PCBSKY9X) || defined(PCBX7)
163 #define LEN_MODEL_NAME 10
164 #define LEN_TIMER_NAME 3
165 #define LEN_FLIGHT_MODE_NAME 6
166 #define LEN_EXPOMIX_NAME 6
167 #define LEN_CHANNEL_NAME 4
168 #define LEN_INPUT_NAME 3
169 #define LEN_CURVE_NAME 3
170 #define LEN_FUNCTION_NAME 6
171 #define MAX_CURVES 16 // TODO next EEPROM check if can be changed to 32 to have all ARM the same
172 #define MAX_CURVE_POINTS 512
173 #elif defined(PCBTARANIS)
174 #define LEN_MODEL_NAME 12
175 #define LEN_TIMER_NAME 8
176 #define LEN_FLIGHT_MODE_NAME 10
177 #define LEN_BITMAP_NAME 10
178 #define LEN_EXPOMIX_NAME 8 // TODO next EEPROM change: 6 seem enough
179 #define LEN_CHANNEL_NAME 6
180 #define LEN_INPUT_NAME 4
181 #define LEN_CURVE_NAME 3
182 #define LEN_FUNCTION_NAME 8
183 #define MAX_CURVES 32
184 #define MAX_CURVE_POINTS 512
186 #define LEN_MODEL_NAME 10
187 #define LEN_FLIGHT_MODE_NAME 6
189 #define MAX_CURVE_POINTS (112-MAX_CURVES)
192 #if defined(PCBTARANIS) || defined(PCBSKY9X) || defined(PCBHORUS)
193 #define NUM_MODULES 2
195 #define NUM_MODULES 1
198 #if defined(PCBFLAMENCO)
199 #define NUM_SWITCHES 5 // TODO in board.h
202 #define XPOTS_MULTIPOS_COUNT 6
204 #if defined(PCBSKY9X) && defined(REVX)
205 #define MAX_ROTARY_ENCODERS 1
206 #define NUM_ROTARY_ENCODERS 0
207 #elif defined(PCBSKY9X)
208 #define MAX_ROTARY_ENCODERS 1
209 #define NUM_ROTARY_ENCODERS 1
210 #elif defined(CPUM2560)
211 #define MAX_ROTARY_ENCODERS 2
212 #define NUM_ROTARY_ENCODERS 2
214 #define MAX_ROTARY_ENCODERS 0
215 #define NUM_ROTARY_ENCODERS 0
219 #define NUM_AUX_TRIMS 2
220 #define NUM_MOUSE_ANALOGS 2
221 #define NUM_DUMMY_ANAS 2
222 #elif defined(PCBHORUS)
223 #define NUM_AUX_TRIMS 2
224 #define NUM_MOUSE_ANALOGS 2
225 #define NUM_DUMMY_ANAS 0
227 #define NUM_AUX_TRIMS 0
228 #define NUM_MOUSE_ANALOGS 0
229 #define NUM_DUMMY_ANAS 0
232 #if defined(COLORLCD)
235 VIEW_TIMERS_ALTITUDE
,
267 #if defined(PCBFLAMENCO)
276 #elif defined(PCBTARANIS) || defined(PCBHORUS)
283 TRAINER_MODE_MASTER_TRAINER_JACK
,
285 #if defined(PCBTARANIS)
286 TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE
,
287 TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
,
289 TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
,
290 #if defined(BLUETOOTH)
291 TRAINER_MODE_MASTER_BLUETOOTH
,
292 TRAINER_MODE_SLAVE_BLUETOOTH
,
295 #elif defined(PCBSKY9X)
303 #if defined(BLUETOOTH)
304 #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
306 #define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
308 #define TRAINER_MODE_MAX() HAS_WIRELESS_TRAINER_HARDWARE() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
311 #if defined(PCBTARANIS) || defined(PCBHORUS)
312 #define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE)
313 #elif defined(PCBSKY9X)
314 #define IS_INTERNAL_MODULE_ENABLED() (false)
316 #define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE)
320 #if defined(CLI) || defined(DEBUG)
325 UART_MODE_TELEMETRY_MIRROR
,
327 UART_MODE_SBUS_TRAINER
,
328 // UART_MODE_CPPM_TRAINER,
330 UART_MODE_MAX
= UART_MODE_COUNT
-1
333 #if defined(PCBHORUS)
334 #define LEN_SWITCH_NAME 3
335 #define LEN_ANA_NAME 3
336 #define LEN_MODEL_FILENAME 16
337 #define LEN_BLUETOOTH_NAME 10
338 #elif defined(CPUARM)
339 #define LEN_SWITCH_NAME 3
340 #define LEN_ANA_NAME 3
341 #define LEN_BLUETOOTH_NAME 10
345 #define TELEM_LABEL_LEN 4
352 UNIT_METERS_PER_SECOND
,
353 UNIT_FEET_PER_SECOND
,
374 // FrSky format used for these fields, could be another format in the future
376 UNIT_CELLS
= UNIT_FIRST_VIRTUAL
,
381 // Internal units (not stored in sensor unit)
385 UNIT_DATETIME_DAY_MONTH
,
386 UNIT_DATETIME_HOUR_MIN
,
389 #define UNIT_MAX UNIT_FLOZ
390 #define UNIT_DIST UNIT_METERS
391 #define UNIT_TEMPERATURE UNIT_CELSIUS
392 #define UNIT_SPEED UNIT_KMH
395 enum TelemetrySource
{
400 TELEM_TIMER_MAX
=TELEM_TIMER2
,
404 TELEM_A1
=TELEM_A_FIRST
,
406 TELEM_A_LAST
=TELEM_A2
,
429 TELEM_MIN_A1
=TELEM_MIN_A_FIRST
,
431 TELEM_MIN_A_LAST
=TELEM_MIN_A2
,
447 TELEM_CSW_MAX
= TELEM_MAX_POWER
,
448 TELEM_NOUSR_MAX
= TELEM_A2
,
449 #if defined(TELEMETRY_FRSKY)
450 TELEM_DISPLAY_MAX
= TELEM_MAX_POWER
,
452 TELEM_DISPLAY_MAX
= TELEM_TIMER2
, // because used also in PlayValue
454 TELEM_STATUS_MAX
= TELEM_GPS_TIME
,
455 TELEM_FIRST_STREAMED_VALUE
= TELEM_RSSI_TX
,
458 #if defined(FRSKY_HUB)
459 #define NUM_TELEMETRY TELEM_CSW_MAX
460 #elif defined(WS_HOW_HIGH)
461 #define NUM_TELEMETRY TELEM_ALT
462 #elif defined(TELEMETRY_FRSKY)
463 #define NUM_TELEMETRY TELEM_A2
464 #elif defined(TELEMETRY_MAVLINK)
465 #define NUM_TELEMETRY 4
467 #define NUM_TELEMETRY TELEM_TIMER2
475 UNIT_METERS_PER_SECOND
,
482 UNIT_A1A2_MAX
= UNIT_MILLIAMPS
,
498 #define NUM_LINE_ITEMS 3
500 #define NUM_LINE_ITEMS 2
503 #if defined(PCBTARANIS)
504 #define MAX_TELEM_SCRIPT_INPUTS 8
508 enum TelemetryScreenType
{
509 TELEMETRY_SCREEN_TYPE_NONE
,
510 TELEMETRY_SCREEN_TYPE_VALUES
,
511 TELEMETRY_SCREEN_TYPE_GAUGES
,
513 TELEMETRY_SCREEN_TYPE_SCRIPT
,
514 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_SCRIPT
516 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_GAUGES
519 #define MAX_TELEMETRY_SCREENS 4
520 #define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.frsky.screensType >> (2*(screenIndex))) & 0x03)
521 #define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_GAUGES)
523 #define MAX_FRSKY_A_CHANNELS 2
524 #define MAX_TELEMETRY_SCREENS 2
525 #define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
526 #define MIN_BLADES 0 // 2 blades
527 #define MAX_BLADES 3 // 5 blades
530 #define FAILSAFE_CHANNEL_HOLD 2000
531 #define FAILSAFE_CHANNEL_NOPULSE 2001
533 #define LEN_SCRIPT_FILENAME 6
534 #define LEN_SCRIPT_NAME 6
535 #define MAX_SCRIPT_INPUTS 6
536 #define MAX_SCRIPT_OUTPUTS 6
545 #define LEN_GVAR_NAME 3
546 #define GVAR_MAX 1024
547 #define GVAR_MIN -GVAR_MAX
550 #define RESERVE_RANGE_FOR_GVARS 10
551 // even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc.
553 #if defined(PCBSTD) && defined(GVARS)
555 #elif defined(PCBSTD)
557 #elif defined(CPUARM)
568 #if defined(PCBFLAMENCO)
569 SWSRC_SA0
= SWSRC_FIRST_SWITCH
,
585 SWSRC_LAST_SWITCH
= SWSRC_SF2
,
586 #elif defined(PCBTARANIS) || defined(PCBHORUS)
587 SWSRC_SA0
= SWSRC_FIRST_SWITCH
,
615 SWSRC_TRAINER
= SWSRC_SH2
,
647 SWSRC_LAST_SWITCH
= SWSRC_SR2
,
649 SWSRC_LAST_SWITCH
= SWSRC_SH2
,
652 SWSRC_ID0
= SWSRC_FIRST_SWITCH
,
661 SWSRC_TRAINER
= SWSRC_TRN
,
662 SWSRC_LAST_SWITCH
= SWSRC_TRN
,
666 SWSRC_FIRST_MULTIPOS_SWITCH
,
667 SWSRC_LAST_MULTIPOS_SWITCH
= SWSRC_FIRST_MULTIPOS_SWITCH
+ (NUM_XPOTS
*XPOTS_MULTIPOS_COUNT
) - 1,
671 SWSRC_TrimRudLeft
= SWSRC_FIRST_TRIM
,
679 #if defined(PCBHORUS)
684 SWSRC_LAST_TRIM
= SWSRC_TrimT6Up
,
686 SWSRC_LAST_TRIM
= SWSRC_TrimAilRight
,
689 #if defined(PCBSKY9X)
691 #elif defined(CPUM2560)
696 SWSRC_FIRST_LOGICAL_SWITCH
,
697 SWSRC_SW1
= SWSRC_FIRST_LOGICAL_SWITCH
,
709 SWSRC_LAST_LOGICAL_SWITCH
= SWSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
715 SWSRC_FIRST_FLIGHT_MODE
,
716 SWSRC_LAST_FLIGHT_MODE
= SWSRC_FIRST_FLIGHT_MODE
+MAX_FLIGHT_MODES
-1,
718 SWSRC_TELEMETRY_STREAMING
,
720 SWSRC_LAST_SENSOR
= SWSRC_FIRST_SENSOR
+MAX_TELEMETRY_SENSORS
-1,
725 SWSRC_OFF
= -SWSRC_ON
,
727 SWSRC_LAST
= SWSRC_COUNT
-1,
728 SWSRC_FIRST
= -SWSRC_LAST
,
731 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_COUNT
-1,
732 SWSRC_LAST_IN_MIXES
= SWSRC_COUNT
-1,
734 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_LAST_LOGICAL_SWITCH
,
735 SWSRC_LAST_IN_MIXES
= SWSRC_LAST_LOGICAL_SWITCH
,
738 SWSRC_FIRST_IN_LOGICAL_SWITCHES
= -SWSRC_LAST_IN_LOGICAL_SWITCHES
,
739 SWSRC_FIRST_IN_MIXES
= -SWSRC_LAST_IN_MIXES
,
742 SWSRC_INVERT
= SWSRC_COUNT
+1,
749 #if defined(VIRTUAL_INPUTS)
750 MIXSRC_FIRST_INPUT
, LUA_EXPORT_MULTIPLE("input", "Input [I%d]", MAX_INPUTS
)
751 MIXSRC_LAST_INPUT
= MIXSRC_FIRST_INPUT
+MAX_INPUTS
-1,
754 #if defined(LUA_INPUTS)
756 MIXSRC_LAST_LUA
= MIXSRC_FIRST_LUA
+(MAX_SCRIPTS
*MAX_SCRIPT_OUTPUTS
)-1,
760 MIXSRC_Rud
= MIXSRC_FIRST_STICK
, LUA_EXPORT("rud", "Rudder")
761 MIXSRC_Ele
, LUA_EXPORT("ele", "Elevator")
762 MIXSRC_Thr
, LUA_EXPORT("thr", "Throttle")
763 MIXSRC_Ail
, LUA_EXPORT("ail", "Aileron")
766 #if defined(PCBHORUS)
767 MIXSRC_S1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer S1")
768 MIXSRC_6POS
, LUA_EXPORT("6pos", "Multipos Switch")
769 MIXSRC_S2
, LUA_EXPORT("s2", "Potentiometer S2")
771 MIXSRC_S3
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("s3", "Slider S3")
772 MIXSRC_S4
, LUA_EXPORT("s4", "Slider S4")
773 MIXSRC_LS
, LUA_EXPORT("ls", "Left rear slider")
774 MIXSRC_RS
, LUA_EXPORT("rs", "Right rear slider")
775 MIXSRC_LAST_POT
= MIXSRC_RS
,
776 #elif defined(PCBFLAMENCO)
777 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("sd", "Potentiometer D")
778 MIXSRC_SLIDER1
, LUA_EXPORT("ls", "Left slider")
779 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
780 MIXSRC_LAST_POT
= MIXSRC_SLIDER2
,
781 #elif defined(PCBX9E)
782 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
783 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
784 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
785 MIXSRC_POT4
, LUA_EXPORT("s4", "Potentiometer 4 (X9E only)")
787 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
788 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
789 MIXSRC_SLIDER3
, LUA_EXPORT("lcs", "Left center slider (X9E only)")
790 MIXSRC_SLIDER4
, LUA_EXPORT("rcs", "Right center slider (X9E only)")
791 MIXSRC_LAST_POT
= MIXSRC_SLIDER4
,
793 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
794 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
795 MIXSRC_LAST_POT
= MIXSRC_POT2
,
796 #elif defined(PCBTARANIS)
797 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
798 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
799 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
801 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
802 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
803 MIXSRC_LAST_POT
= MIXSRC_SLIDER2
,
805 MIXSRC_P1
= MIXSRC_FIRST_POT
,
808 MIXSRC_LAST_POT
= MIXSRC_P3
,
811 #if defined(PCBHORUS)
812 MIXSRC_MOUSE1
, LUA_EXPORT("jsx", "Joystick X")
813 MIXSRC_MOUSE2
, LUA_EXPORT("jsy", "Joystick Y")
816 #if defined(PCBSKY9X)
818 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REa
,
819 #elif defined(CPUM2560)
822 #if ROTARY_ENCODERS > 2
825 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REd
,
827 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REb
,
834 MIXSRC_CYC1
= MIXSRC_FIRST_HELI
, LUA_EXPORT("cyc1", "Cyclic 1")
835 MIXSRC_CYC2
, LUA_EXPORT("cyc2", "Cyclic 2")
836 MIXSRC_CYC3
, LUA_EXPORT("cyc3", "Cyclic 3")
839 MIXSRC_TrimRud
= MIXSRC_FIRST_TRIM
, LUA_EXPORT("trim-rud", "Rudder trim")
840 MIXSRC_TrimEle
, LUA_EXPORT("trim-ele", "Elevator trim")
841 MIXSRC_TrimThr
, LUA_EXPORT("trim-thr", "Throttle trim")
842 MIXSRC_TrimAil
, LUA_EXPORT("trim-ail", "Aileron trim")
843 #if defined(PCBHORUS)
844 MIXSRC_TrimT5
, LUA_EXPORT("trim-t5", "Aux trim T5")
845 MIXSRC_TrimT6
, LUA_EXPORT("trim-t6", "Aux trim T6")
846 MIXSRC_LAST_TRIM
= MIXSRC_TrimT6
,
848 MIXSRC_LAST_TRIM
= MIXSRC_TrimAil
,
853 #if defined(PCBFLAMENCO)
854 MIXSRC_SA
= MIXSRC_FIRST_SWITCH
, LUA_EXPORT("sa", "Switch A")
855 MIXSRC_SB
, LUA_EXPORT("sb", "Switch B")
856 MIXSRC_SC
, LUA_EXPORT("sc", "Switch C")
857 MIXSRC_SE
, LUA_EXPORT("se", "Switch E")
858 MIXSRC_SF
, LUA_EXPORT("sf", "Switch F")
859 MIXSRC_LAST_SWITCH
= MIXSRC_SF
,
860 #elif defined(PCBTARANIS) || defined(PCBHORUS)
861 MIXSRC_SA
= MIXSRC_FIRST_SWITCH
, LUA_EXPORT("sa", "Switch A")
862 MIXSRC_SB
, LUA_EXPORT("sb", "Switch B")
863 MIXSRC_SC
, LUA_EXPORT("sc", "Switch C")
864 MIXSRC_SD
, LUA_EXPORT("sd", "Switch D")
866 MIXSRC_SE
, LUA_EXPORT("se", "Switch E")
868 MIXSRC_SF
, LUA_EXPORT("sf", "Switch F")
870 MIXSRC_SG
, LUA_EXPORT("sg", "Switch G")
872 MIXSRC_SH
, LUA_EXPORT("sh", "Switch H")
874 MIXSRC_SI
, LUA_EXPORT("si", "Switch I")
875 MIXSRC_SJ
, LUA_EXPORT("sj", "Switch J")
876 MIXSRC_SK
, LUA_EXPORT("sk", "Switch K")
877 MIXSRC_SL
, LUA_EXPORT("sl", "Switch L")
878 MIXSRC_SM
, LUA_EXPORT("sm", "Switch M")
879 MIXSRC_SN
, LUA_EXPORT("sn", "Switch N")
880 MIXSRC_SO
, LUA_EXPORT("so", "Switch O")
881 MIXSRC_SP
, LUA_EXPORT("sp", "Switch P")
882 MIXSRC_SQ
, LUA_EXPORT("sq", "Switch Q")
883 MIXSRC_SR
, LUA_EXPORT("sr", "Switch R")
884 MIXSRC_LAST_SWITCH
= MIXSRC_SR
,
886 MIXSRC_LAST_SWITCH
= MIXSRC_SH
,
889 MIXSRC_3POS
= MIXSRC_FIRST_SWITCH
,
896 MIXSRC_LAST_SWITCH
= MIXSRC_TRN
,
898 MIXSRC_FIRST_LOGICAL_SWITCH
,
899 MIXSRC_SW1
= MIXSRC_FIRST_LOGICAL_SWITCH
, LUA_EXPORT_MULTIPLE("ls", "Logical switch L%d", MAX_LOGICAL_SWITCHES
)
900 MIXSRC_LAST_LOGICAL_SWITCH
= MIXSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
902 MIXSRC_FIRST_TRAINER
, LUA_EXPORT_MULTIPLE("trn", "Trainer input %d", MAX_TRAINER_CHANNELS
)
903 MIXSRC_LAST_TRAINER
= MIXSRC_FIRST_TRAINER
+MAX_TRAINER_CHANNELS
-1,
906 MIXSRC_CH1
= MIXSRC_FIRST_CH
, LUA_EXPORT_MULTIPLE("ch", "Channel CH%d", MAX_OUTPUT_CHANNELS
)
922 MIXSRC_LAST_CH
= MIXSRC_CH1
+MAX_OUTPUT_CHANNELS
-1,
925 MIXSRC_GVAR1
= MIXSRC_FIRST_GVAR
, LUA_EXPORT_MULTIPLE("gvar", "Global variable %d", MAX_GVARS
)
926 MIXSRC_LAST_GVAR
= MIXSRC_FIRST_GVAR
+MAX_GVARS
-1,
929 MIXSRC_TX_VOLTAGE
, LUA_EXPORT("tx-voltage", "Transmitter battery voltage [volts]")
930 MIXSRC_TX_TIME
, LUA_EXPORT("clock", "RTC clock [minutes from midnight]")
931 #if defined(INTERNAL_GPS)
933 MIXSRC_FIRST_RESERVE
,
935 MIXSRC_FIRST_RESERVE
,
942 MIXSRC_TIMER1
= MIXSRC_FIRST_TIMER
, LUA_EXPORT("timer1", "Timer 1 value [seconds]")
943 MIXSRC_TIMER2
, LUA_EXPORT("timer2", "Timer 2 value [seconds]")
944 MIXSRC_TIMER3
, LUA_EXPORT("timer3", "Timer 3 value [seconds]")
945 MIXSRC_LAST_TIMER
= MIXSRC_TIMER3
,
950 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+3*MAX_TELEMETRY_SENSORS
-1
952 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+NUM_TELEMETRY
-1
956 #define MIXSRC_FIRST (MIXSRC_NONE+1)
957 #define MIXSRC_LAST MIXSRC_LAST_CH
958 #define INPUTSRC_FIRST MIXSRC_Rud
959 #define INPUTSRC_LAST MIXSRC_LAST_TELEM
962 e_backlight_mode_off
= 0,
963 e_backlight_mode_keys
= 1,
964 e_backlight_mode_sticks
= 2,
965 e_backlight_mode_all
= e_backlight_mode_keys
+e_backlight_mode_sticks
,
970 // first the functions which need a checkbox
971 FUNC_OVERRIDE_CHANNEL
,
985 // then the other functions
986 FUNC_FIRST_WITHOUT_ENABLE
,
987 FUNC_PLAY_SOUND
= FUNC_FIRST_WITHOUT_ENABLE
,
998 FUNC_BACKGND_MUSIC_PAUSE
,
1002 #if !defined(PCBSTD)
1006 #if defined(PCBTARANIS)
1010 FUNC_TEST
, // should remain the last before MAX as not added in Companion
1024 enum CountDownModes
{
1034 enum ResetFunctionParam
{
1041 #if defined(TELEMETRY_FRSKY)
1042 FUNC_RESET_TELEMETRY
,
1044 #if ROTARY_ENCODERS > 0
1047 #if ROTARY_ENCODERS > 1
1051 FUNC_RESET_PARAM_FIRST_TELEM
,
1052 FUNC_RESET_PARAM_LAST_TELEM
= FUNC_RESET_PARAM_FIRST_TELEM
+ MAX_TELEMETRY_SENSORS
,
1054 FUNC_RESET_PARAMS_COUNT
,
1055 FUNC_RESET_PARAM_LAST
= FUNC_RESET_PARAMS_COUNT
-1,
1058 enum AdjustGvarFunctionParam
{
1059 FUNC_ADJUST_GVAR_CONSTANT
,
1060 FUNC_ADJUST_GVAR_SOURCE
,
1061 FUNC_ADJUST_GVAR_GVAR
,
1062 FUNC_ADJUST_GVAR_INCDEC
,
1065 enum BluetoothModes
{
1067 BLUETOOTH_TELEMETRY
,
1071 #endif // _DATACONSTANTS_H_