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(PCBTARANIS)
51 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
52 #define MAX_FLIGHT_MODES 9
55 #define MAX_LOGICAL_SWITCHES 64
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(PCBSKY9X)
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
70 #define MAX_TRAINER_CHANNELS 16
71 #define MAX_TELEMETRY_SENSORS 32
72 #elif defined(CPUM2560) || defined(CPUM2561)
74 #define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
75 #define MAX_FLIGHT_MODES 6
78 #define MAX_LOGICAL_SWITCHES 12
79 #define MAX_SPECIAL_FUNCTIONS 24 // number of functions assigned to switches
80 #define MAX_TRAINER_CHANNELS 8
81 #define MAX_TELEMETRY_SENSORS 0
82 #elif defined(CPUM128)
84 #define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
85 #define MAX_FLIGHT_MODES 5
88 #define MAX_LOGICAL_SWITCHES 12
89 #define MAX_SPECIAL_FUNCTIONS 24 // number of functions assigned to switches
90 #define MAX_TRAINER_CHANNELS 8
91 #define MAX_TELEMETRY_SENSORS 0
94 #define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
95 #define MAX_FLIGHT_MODES 5
98 #define MAX_LOGICAL_SWITCHES 12
99 #define MAX_SPECIAL_FUNCTIONS 16 // number of functions assigned to switches
100 #define MAX_TRAINER_CHANNELS 8
101 #define MAX_TELEMETRY_SENSORS 0
111 #define NUM_CAL_PPM 4
116 CURVE_TYPE_LAST
= CURVE_TYPE_CUSTOM
120 #define MIN_POINTS_PER_CURVE 3
122 #define MIN_POINTS_PER_CURVE 3
125 #define MAX_POINTS_PER_CURVE 17
127 #if defined(PCBHORUS)
128 #define LEN_MODEL_NAME 15
129 #define LEN_TIMER_NAME 8
130 #define LEN_FLIGHT_MODE_NAME 10
131 #define LEN_BITMAP_NAME 10 // TODO next EEPROM change: we need 14 here as we have to store the file extension
132 #define LEN_EXPOMIX_NAME 6
133 #define LEN_CHANNEL_NAME 6
134 #define LEN_INPUT_NAME 4
135 #define LEN_CURVE_NAME 3
136 #define LEN_FUNCTION_NAME 6
137 #define MAX_CURVES 32
138 #define MAX_CURVE_POINTS 512
139 #elif defined(PCBSKY9X) || defined(PCBX7)
140 #define LEN_MODEL_NAME 10
141 #define LEN_TIMER_NAME 3
142 #define LEN_FLIGHT_MODE_NAME 6
143 #define LEN_EXPOMIX_NAME 6
144 #define LEN_CHANNEL_NAME 4
145 #define LEN_INPUT_NAME 3
146 #define LEN_CURVE_NAME 3
147 #define LEN_FUNCTION_NAME 6
148 #define MAX_CURVES 16 // TODO next EEPROM check if can be changed to 32 to have all ARM the same
149 #define MAX_CURVE_POINTS 512
150 #elif defined(PCBTARANIS)
151 #define LEN_MODEL_NAME 12
152 #define LEN_TIMER_NAME 8
153 #define LEN_FLIGHT_MODE_NAME 10
154 #define LEN_BITMAP_NAME 10
155 #define LEN_EXPOMIX_NAME 8 // TODO next EEPROM change: 6 seem enough
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
163 #define LEN_MODEL_NAME 10
164 #define LEN_FLIGHT_MODE_NAME 6
166 #define MAX_CURVE_POINTS (112-MAX_CURVES)
169 #if defined(PCBTARANIS) || defined(PCBSKY9X) || defined(PCBHORUS)
170 #define NUM_MODULES 2
172 #define NUM_MODULES 1
175 #define XPOTS_MULTIPOS_COUNT 6
177 #if defined(PCBSKY9X) && defined(REVX)
178 #define MAX_ROTARY_ENCODERS 1
179 #define NUM_ROTARY_ENCODERS 0
180 #elif defined(PCBSKY9X)
181 #define MAX_ROTARY_ENCODERS 1
182 #define NUM_ROTARY_ENCODERS 1
183 #elif defined(CPUM2560)
184 #define MAX_ROTARY_ENCODERS 2
185 #define NUM_ROTARY_ENCODERS 2
187 #define MAX_ROTARY_ENCODERS 0
188 #define NUM_ROTARY_ENCODERS 0
192 #define NUM_AUX_TRIMS 2
193 #define NUM_MOUSE_ANALOGS 2
194 #define NUM_DUMMY_ANAS 2
195 #elif defined(PCBHORUS)
196 #define NUM_AUX_TRIMS 2
197 #define NUM_MOUSE_ANALOGS 2
198 #define NUM_DUMMY_ANAS 0
200 #define NUM_AUX_TRIMS 0
201 #define NUM_MOUSE_ANALOGS 0
202 #define NUM_DUMMY_ANAS 0
205 #if defined(COLORLCD)
208 VIEW_TIMERS_ALTITUDE
,
240 #if defined(PCBTARANIS) || defined(PCBHORUS)
247 TRAINER_MODE_MASTER_TRAINER_JACK
,
249 #if defined(PCBTARANIS)
250 TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE
,
251 TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
,
253 TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
,
254 #if defined(BLUETOOTH)
255 TRAINER_MODE_MASTER_BLUETOOTH
,
256 TRAINER_MODE_SLAVE_BLUETOOTH
,
259 #elif defined(PCBSKY9X)
267 #if defined(BLUETOOTH)
268 #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
270 #define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
272 #define TRAINER_MODE_MAX() HAS_WIRELESS_TRAINER_HARDWARE() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
275 #if defined(PCBTARANIS) || defined(PCBHORUS)
276 #define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE)
277 #elif defined(PCBSKY9X)
278 #define IS_INTERNAL_MODULE_ENABLED() (false)
280 #define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE)
284 #if defined(CLI) || defined(DEBUG)
289 UART_MODE_TELEMETRY_MIRROR
,
291 UART_MODE_SBUS_TRAINER
,
292 // UART_MODE_CPPM_TRAINER,
294 UART_MODE_MAX
= UART_MODE_COUNT
-1
297 #if defined(PCBHORUS)
298 #define LEN_SWITCH_NAME 3
299 #define LEN_ANA_NAME 3
300 #define LEN_MODEL_FILENAME 16
301 #define LEN_BLUETOOTH_NAME 10
302 #elif defined(CPUARM)
303 #define LEN_SWITCH_NAME 3
304 #define LEN_ANA_NAME 3
305 #define LEN_BLUETOOTH_NAME 10
309 #define TELEM_LABEL_LEN 4
316 UNIT_METERS_PER_SECOND
,
317 UNIT_FEET_PER_SECOND
,
338 // FrSky format used for these fields, could be another format in the future
340 UNIT_CELLS
= UNIT_FIRST_VIRTUAL
,
345 // Internal units (not stored in sensor unit)
349 UNIT_DATETIME_DAY_MONTH
,
350 UNIT_DATETIME_HOUR_MIN
,
353 #define UNIT_MAX UNIT_FLOZ
354 #define UNIT_DIST UNIT_METERS
355 #define UNIT_TEMPERATURE UNIT_CELSIUS
356 #define UNIT_SPEED UNIT_KMH
359 enum TelemetrySource
{
364 TELEM_TIMER_MAX
=TELEM_TIMER2
,
368 TELEM_A1
=TELEM_A_FIRST
,
370 TELEM_A_LAST
=TELEM_A2
,
393 TELEM_MIN_A1
=TELEM_MIN_A_FIRST
,
395 TELEM_MIN_A_LAST
=TELEM_MIN_A2
,
411 TELEM_CSW_MAX
= TELEM_MAX_POWER
,
412 TELEM_NOUSR_MAX
= TELEM_A2
,
413 #if defined(TELEMETRY_FRSKY)
414 TELEM_DISPLAY_MAX
= TELEM_MAX_POWER
,
416 TELEM_DISPLAY_MAX
= TELEM_TIMER2
, // because used also in PlayValue
418 TELEM_STATUS_MAX
= TELEM_GPS_TIME
,
419 TELEM_FIRST_STREAMED_VALUE
= TELEM_RSSI_TX
,
422 #if defined(FRSKY_HUB)
423 #define NUM_TELEMETRY TELEM_CSW_MAX
424 #elif defined(WS_HOW_HIGH)
425 #define NUM_TELEMETRY TELEM_ALT
426 #elif defined(TELEMETRY_FRSKY)
427 #define NUM_TELEMETRY TELEM_A2
428 #elif defined(TELEMETRY_MAVLINK)
429 #define NUM_TELEMETRY 4
431 #define NUM_TELEMETRY TELEM_TIMER2
439 UNIT_METERS_PER_SECOND
,
446 UNIT_A1A2_MAX
= UNIT_MILLIAMPS
,
462 #define NUM_LINE_ITEMS 3
464 #define NUM_LINE_ITEMS 2
467 #if defined(PCBTARANIS)
468 #define MAX_TELEM_SCRIPT_INPUTS 8
472 enum TelemetryScreenType
{
473 TELEMETRY_SCREEN_TYPE_NONE
,
474 TELEMETRY_SCREEN_TYPE_VALUES
,
475 TELEMETRY_SCREEN_TYPE_GAUGES
,
477 TELEMETRY_SCREEN_TYPE_SCRIPT
,
478 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_SCRIPT
480 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_GAUGES
483 #define MAX_TELEMETRY_SCREENS 4
484 #define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.frsky.screensType >> (2*(screenIndex))) & 0x03)
485 #define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_GAUGES)
487 #define MAX_FRSKY_A_CHANNELS 2
488 #define MAX_TELEMETRY_SCREENS 2
489 #define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
490 #define MIN_BLADES 0 // 2 blades
491 #define MAX_BLADES 3 // 5 blades
494 #define FAILSAFE_CHANNEL_HOLD 2000
495 #define FAILSAFE_CHANNEL_NOPULSE 2001
497 #define LEN_SCRIPT_FILENAME 6
498 #define LEN_SCRIPT_NAME 6
499 #define MAX_SCRIPT_INPUTS 6
500 #define MAX_SCRIPT_OUTPUTS 6
509 #define LEN_GVAR_NAME 3
510 #define GVAR_MAX 1024
511 #define GVAR_MIN -GVAR_MAX
514 #define RESERVE_RANGE_FOR_GVARS 10
515 // even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc.
517 #if defined(PCBSTD) && defined(GVARS)
519 #elif defined(PCBSTD)
521 #elif defined(CPUARM)
532 #if defined(PCBTARANIS) || defined(PCBHORUS)
533 SWSRC_SA0
= SWSRC_FIRST_SWITCH
,
561 SWSRC_TRAINER
= SWSRC_SH2
,
593 SWSRC_LAST_SWITCH
= SWSRC_SR2
,
595 SWSRC_LAST_SWITCH
= SWSRC_SH2
,
598 SWSRC_ID0
= SWSRC_FIRST_SWITCH
,
607 SWSRC_TRAINER
= SWSRC_TRN
,
608 SWSRC_LAST_SWITCH
= SWSRC_TRN
,
612 SWSRC_FIRST_MULTIPOS_SWITCH
,
613 SWSRC_LAST_MULTIPOS_SWITCH
= SWSRC_FIRST_MULTIPOS_SWITCH
+ (NUM_XPOTS
*XPOTS_MULTIPOS_COUNT
) - 1,
617 SWSRC_TrimRudLeft
= SWSRC_FIRST_TRIM
,
625 #if defined(PCBHORUS)
630 SWSRC_LAST_TRIM
= SWSRC_TrimT6Up
,
632 SWSRC_LAST_TRIM
= SWSRC_TrimAilRight
,
635 #if defined(PCBSKY9X)
637 #elif defined(CPUM2560)
642 SWSRC_FIRST_LOGICAL_SWITCH
,
643 SWSRC_SW1
= SWSRC_FIRST_LOGICAL_SWITCH
,
655 SWSRC_LAST_LOGICAL_SWITCH
= SWSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
661 SWSRC_FIRST_FLIGHT_MODE
,
662 SWSRC_LAST_FLIGHT_MODE
= SWSRC_FIRST_FLIGHT_MODE
+MAX_FLIGHT_MODES
-1,
664 SWSRC_TELEMETRY_STREAMING
,
666 SWSRC_LAST_SENSOR
= SWSRC_FIRST_SENSOR
+MAX_TELEMETRY_SENSORS
-1,
671 SWSRC_OFF
= -SWSRC_ON
,
673 SWSRC_LAST
= SWSRC_COUNT
-1,
674 SWSRC_FIRST
= -SWSRC_LAST
,
677 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_COUNT
-1,
678 SWSRC_LAST_IN_MIXES
= SWSRC_COUNT
-1,
680 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_LAST_LOGICAL_SWITCH
,
681 SWSRC_LAST_IN_MIXES
= SWSRC_LAST_LOGICAL_SWITCH
,
684 SWSRC_FIRST_IN_LOGICAL_SWITCHES
= -SWSRC_LAST_IN_LOGICAL_SWITCHES
,
685 SWSRC_FIRST_IN_MIXES
= -SWSRC_LAST_IN_MIXES
,
688 SWSRC_INVERT
= SWSRC_COUNT
+1,
695 #if defined(VIRTUAL_INPUTS)
696 MIXSRC_FIRST_INPUT
, LUA_EXPORT_MULTIPLE("input", "Input [I%d]", MAX_INPUTS
)
697 MIXSRC_LAST_INPUT
= MIXSRC_FIRST_INPUT
+MAX_INPUTS
-1,
700 #if defined(LUA_INPUTS)
702 MIXSRC_LAST_LUA
= MIXSRC_FIRST_LUA
+(MAX_SCRIPTS
*MAX_SCRIPT_OUTPUTS
)-1,
706 MIXSRC_Rud
= MIXSRC_FIRST_STICK
, LUA_EXPORT("rud", "Rudder")
707 MIXSRC_Ele
, LUA_EXPORT("ele", "Elevator")
708 MIXSRC_Thr
, LUA_EXPORT("thr", "Throttle")
709 MIXSRC_Ail
, LUA_EXPORT("ail", "Aileron")
712 #if defined(PCBHORUS)
713 MIXSRC_S1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer S1")
714 MIXSRC_6POS
, LUA_EXPORT("6pos", "Multipos Switch")
715 MIXSRC_S2
, LUA_EXPORT("s2", "Potentiometer S2")
717 MIXSRC_S3
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("s3", "Slider S3")
718 MIXSRC_S4
, LUA_EXPORT("s4", "Slider S4")
719 MIXSRC_LS
, LUA_EXPORT("ls", "Left rear slider")
720 MIXSRC_RS
, LUA_EXPORT("rs", "Right rear slider")
721 MIXSRC_LAST_POT
= MIXSRC_RS
,
722 #elif defined(PCBX9E)
723 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
724 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
725 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
726 MIXSRC_POT4
, LUA_EXPORT("s4", "Potentiometer 4 (X9E only)")
728 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
729 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
730 MIXSRC_SLIDER3
, LUA_EXPORT("lcs", "Left center slider (X9E only)")
731 MIXSRC_SLIDER4
, LUA_EXPORT("rcs", "Right center slider (X9E only)")
732 MIXSRC_LAST_POT
= MIXSRC_SLIDER4
,
734 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
735 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
736 MIXSRC_LAST_POT
= MIXSRC_POT2
,
737 #elif defined(PCBTARANIS)
738 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
739 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
740 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
742 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
743 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
744 MIXSRC_LAST_POT
= MIXSRC_SLIDER2
,
746 MIXSRC_P1
= MIXSRC_FIRST_POT
,
749 MIXSRC_LAST_POT
= MIXSRC_P3
,
752 #if defined(PCBHORUS)
753 MIXSRC_MOUSE1
, LUA_EXPORT("jsx", "Joystick X")
754 MIXSRC_MOUSE2
, LUA_EXPORT("jsy", "Joystick Y")
757 #if defined(PCBSKY9X)
759 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REa
,
760 #elif defined(CPUM2560)
763 #if ROTARY_ENCODERS > 2
766 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REd
,
768 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REb
,
775 MIXSRC_CYC1
= MIXSRC_FIRST_HELI
, LUA_EXPORT("cyc1", "Cyclic 1")
776 MIXSRC_CYC2
, LUA_EXPORT("cyc2", "Cyclic 2")
777 MIXSRC_CYC3
, LUA_EXPORT("cyc3", "Cyclic 3")
780 MIXSRC_TrimRud
= MIXSRC_FIRST_TRIM
, LUA_EXPORT("trim-rud", "Rudder trim")
781 MIXSRC_TrimEle
, LUA_EXPORT("trim-ele", "Elevator trim")
782 MIXSRC_TrimThr
, LUA_EXPORT("trim-thr", "Throttle trim")
783 MIXSRC_TrimAil
, LUA_EXPORT("trim-ail", "Aileron trim")
784 #if defined(PCBHORUS)
785 MIXSRC_TrimT5
, LUA_EXPORT("trim-t5", "Aux trim T5")
786 MIXSRC_TrimT6
, LUA_EXPORT("trim-t6", "Aux trim T6")
787 MIXSRC_LAST_TRIM
= MIXSRC_TrimT6
,
789 MIXSRC_LAST_TRIM
= MIXSRC_TrimAil
,
794 #if defined(PCBTARANIS) || defined(PCBHORUS)
795 MIXSRC_SA
= MIXSRC_FIRST_SWITCH
, LUA_EXPORT("sa", "Switch A")
796 MIXSRC_SB
, LUA_EXPORT("sb", "Switch B")
797 MIXSRC_SC
, LUA_EXPORT("sc", "Switch C")
798 MIXSRC_SD
, LUA_EXPORT("sd", "Switch D")
800 MIXSRC_SE
, LUA_EXPORT("se", "Switch E")
802 MIXSRC_SF
, LUA_EXPORT("sf", "Switch F")
804 MIXSRC_SG
, LUA_EXPORT("sg", "Switch G")
806 MIXSRC_SH
, LUA_EXPORT("sh", "Switch H")
808 MIXSRC_SI
, LUA_EXPORT("si", "Switch I")
809 MIXSRC_SJ
, LUA_EXPORT("sj", "Switch J")
810 MIXSRC_SK
, LUA_EXPORT("sk", "Switch K")
811 MIXSRC_SL
, LUA_EXPORT("sl", "Switch L")
812 MIXSRC_SM
, LUA_EXPORT("sm", "Switch M")
813 MIXSRC_SN
, LUA_EXPORT("sn", "Switch N")
814 MIXSRC_SO
, LUA_EXPORT("so", "Switch O")
815 MIXSRC_SP
, LUA_EXPORT("sp", "Switch P")
816 MIXSRC_SQ
, LUA_EXPORT("sq", "Switch Q")
817 MIXSRC_SR
, LUA_EXPORT("sr", "Switch R")
818 MIXSRC_LAST_SWITCH
= MIXSRC_SR
,
820 MIXSRC_LAST_SWITCH
= MIXSRC_SH
,
823 MIXSRC_3POS
= MIXSRC_FIRST_SWITCH
,
830 MIXSRC_LAST_SWITCH
= MIXSRC_TRN
,
832 MIXSRC_FIRST_LOGICAL_SWITCH
,
833 MIXSRC_SW1
= MIXSRC_FIRST_LOGICAL_SWITCH
, LUA_EXPORT_MULTIPLE("ls", "Logical switch L%d", MAX_LOGICAL_SWITCHES
)
834 MIXSRC_LAST_LOGICAL_SWITCH
= MIXSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
836 MIXSRC_FIRST_TRAINER
, LUA_EXPORT_MULTIPLE("trn", "Trainer input %d", MAX_TRAINER_CHANNELS
)
837 MIXSRC_LAST_TRAINER
= MIXSRC_FIRST_TRAINER
+MAX_TRAINER_CHANNELS
-1,
840 MIXSRC_CH1
= MIXSRC_FIRST_CH
, LUA_EXPORT_MULTIPLE("ch", "Channel CH%d", MAX_OUTPUT_CHANNELS
)
856 MIXSRC_LAST_CH
= MIXSRC_CH1
+MAX_OUTPUT_CHANNELS
-1,
859 MIXSRC_GVAR1
= MIXSRC_FIRST_GVAR
, LUA_EXPORT_MULTIPLE("gvar", "Global variable %d", MAX_GVARS
)
860 MIXSRC_LAST_GVAR
= MIXSRC_FIRST_GVAR
+MAX_GVARS
-1,
863 MIXSRC_TX_VOLTAGE
, LUA_EXPORT("tx-voltage", "Transmitter battery voltage [volts]")
864 MIXSRC_TX_TIME
, LUA_EXPORT("clock", "RTC clock [minutes from midnight]")
865 #if defined(INTERNAL_GPS)
867 MIXSRC_FIRST_RESERVE
,
869 MIXSRC_FIRST_RESERVE
,
876 MIXSRC_TIMER1
= MIXSRC_FIRST_TIMER
, LUA_EXPORT("timer1", "Timer 1 value [seconds]")
877 MIXSRC_TIMER2
, LUA_EXPORT("timer2", "Timer 2 value [seconds]")
878 MIXSRC_TIMER3
, LUA_EXPORT("timer3", "Timer 3 value [seconds]")
879 MIXSRC_LAST_TIMER
= MIXSRC_TIMER3
,
884 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+3*MAX_TELEMETRY_SENSORS
-1
886 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+NUM_TELEMETRY
-1
890 #define MIXSRC_FIRST (MIXSRC_NONE+1)
891 #define MIXSRC_LAST MIXSRC_LAST_CH
892 #define INPUTSRC_FIRST MIXSRC_Rud
893 #define INPUTSRC_LAST MIXSRC_LAST_TELEM
896 e_backlight_mode_off
= 0,
897 e_backlight_mode_keys
= 1,
898 e_backlight_mode_sticks
= 2,
899 e_backlight_mode_all
= e_backlight_mode_keys
+e_backlight_mode_sticks
,
904 // first the functions which need a checkbox
905 FUNC_OVERRIDE_CHANNEL
,
919 // then the other functions
920 FUNC_FIRST_WITHOUT_ENABLE
,
921 FUNC_PLAY_SOUND
= FUNC_FIRST_WITHOUT_ENABLE
,
932 FUNC_BACKGND_MUSIC_PAUSE
,
940 #if defined(PCBTARANIS)
944 FUNC_TEST
, // should remain the last before MAX as not added in Companion
958 enum CountDownModes
{
968 enum ResetFunctionParam
{
975 #if defined(TELEMETRY_FRSKY)
976 FUNC_RESET_TELEMETRY
,
978 #if ROTARY_ENCODERS > 0
981 #if ROTARY_ENCODERS > 1
985 FUNC_RESET_PARAM_FIRST_TELEM
,
986 FUNC_RESET_PARAM_LAST_TELEM
= FUNC_RESET_PARAM_FIRST_TELEM
+ MAX_TELEMETRY_SENSORS
,
988 FUNC_RESET_PARAMS_COUNT
,
989 FUNC_RESET_PARAM_LAST
= FUNC_RESET_PARAMS_COUNT
-1,
992 enum AdjustGvarFunctionParam
{
993 FUNC_ADJUST_GVAR_CONSTANT
,
994 FUNC_ADJUST_GVAR_SOURCE
,
995 FUNC_ADJUST_GVAR_GVAR
,
996 FUNC_ADJUST_GVAR_INCDEC
,
999 enum BluetoothModes
{
1001 BLUETOOTH_TELEMETRY
,
1005 #endif // _DATACONSTANTS_H_