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
140 #define LEN_MODEL_NAME 12
141 #define LEN_TIMER_NAME 8
142 #define LEN_FLIGHT_MODE_NAME 10
143 #define LEN_BITMAP_NAME 10
144 #define LEN_EXPOMIX_NAME 8 // TODO next EEPROM change: 6 seem enough
145 #define LEN_CHANNEL_NAME 6
146 #define LEN_INPUT_NAME 4
147 #define LEN_CURVE_NAME 3
148 #define LEN_FUNCTION_NAME 8
149 #define MAX_CURVES 32
150 #define MAX_CURVE_POINTS 512
151 #elif defined(CPUARM)
152 #define LEN_MODEL_NAME 10
153 #define LEN_TIMER_NAME 3
154 #define LEN_FLIGHT_MODE_NAME 6
155 #define LEN_EXPOMIX_NAME 6
156 #define LEN_CHANNEL_NAME 4
157 #define LEN_INPUT_NAME 3
158 #define LEN_CURVE_NAME 3
159 #define LEN_FUNCTION_NAME 6
160 #define MAX_CURVES 16 // TODO next EEPROM check if can be changed to 32 to have all ARM the same
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
191 #if defined(COLORLCD)
194 VIEW_TIMERS_ALTITUDE
,
226 #if defined(PCBTARANIS) || defined(PCBHORUS)
234 TRAINER_MODE_MASTER_TRAINER_JACK
,
236 #if defined(PCBTARANIS)
237 TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE
,
238 TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
,
240 TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
,
241 #if defined(BLUETOOTH)
242 TRAINER_MODE_MASTER_BLUETOOTH
,
243 TRAINER_MODE_SLAVE_BLUETOOTH
,
246 #elif defined(PCBSKY9X)
254 #if defined(BLUETOOTH)
255 #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
256 #elif defined(PCBX7) || defined(PCBXLITE)
257 #define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
259 #define TRAINER_MODE_MAX() HAS_WIRELESS_TRAINER_HARDWARE() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
262 #if defined(PCBTARANIS) || defined(PCBHORUS)
263 #define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE)
264 #elif defined(PCBSKY9X)
265 #define IS_INTERNAL_MODULE_ENABLED() (false)
267 #define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE)
271 #if defined(CLI) || defined(DEBUG)
276 UART_MODE_TELEMETRY_MIRROR
,
278 UART_MODE_SBUS_TRAINER
,
279 // UART_MODE_CPPM_TRAINER,
281 UART_MODE_MAX
= UART_MODE_COUNT
-1
284 #if defined(PCBHORUS)
285 #define LEN_SWITCH_NAME 3
286 #define LEN_ANA_NAME 3
287 #define LEN_MODEL_FILENAME 16
288 #define LEN_BLUETOOTH_NAME 10
289 #elif defined(CPUARM)
290 #define LEN_SWITCH_NAME 3
291 #define LEN_ANA_NAME 3
292 #define LEN_BLUETOOTH_NAME 10
296 #define TELEM_LABEL_LEN 4
303 UNIT_METERS_PER_SECOND
,
304 UNIT_FEET_PER_SECOND
,
325 // FrSky format used for these fields, could be another format in the future
327 UNIT_CELLS
= UNIT_FIRST_VIRTUAL
,
332 // Internal units (not stored in sensor unit)
336 UNIT_DATETIME_DAY_MONTH
,
337 UNIT_DATETIME_HOUR_MIN
,
340 #define UNIT_MAX UNIT_FLOZ
341 #define UNIT_DIST UNIT_METERS
342 #define UNIT_TEMPERATURE UNIT_CELSIUS
343 #define UNIT_SPEED UNIT_KMH
346 enum TelemetrySource
{
351 TELEM_TIMER_MAX
=TELEM_TIMER2
,
355 TELEM_A1
=TELEM_A_FIRST
,
357 TELEM_A_LAST
=TELEM_A2
,
380 TELEM_MIN_A1
=TELEM_MIN_A_FIRST
,
382 TELEM_MIN_A_LAST
=TELEM_MIN_A2
,
398 TELEM_CSW_MAX
= TELEM_MAX_POWER
,
399 TELEM_NOUSR_MAX
= TELEM_A2
,
400 #if defined(TELEMETRY_FRSKY)
401 TELEM_DISPLAY_MAX
= TELEM_MAX_POWER
,
403 TELEM_DISPLAY_MAX
= TELEM_TIMER2
, // because used also in PlayValue
405 TELEM_STATUS_MAX
= TELEM_GPS_TIME
,
406 TELEM_FIRST_STREAMED_VALUE
= TELEM_RSSI_TX
,
409 #if defined(FRSKY_HUB)
410 #define NUM_TELEMETRY TELEM_CSW_MAX
411 #elif defined(WS_HOW_HIGH)
412 #define NUM_TELEMETRY TELEM_ALT
413 #elif defined(TELEMETRY_FRSKY)
414 #define NUM_TELEMETRY TELEM_A2
415 #elif defined(TELEMETRY_MAVLINK)
416 #define NUM_TELEMETRY 4
418 #define NUM_TELEMETRY TELEM_TIMER2
426 UNIT_METERS_PER_SECOND
,
433 UNIT_A1A2_MAX
= UNIT_MILLIAMPS
,
449 #define NUM_LINE_ITEMS 3
451 #define NUM_LINE_ITEMS 2
454 #if defined(PCBTARANIS)
455 #define MAX_TELEM_SCRIPT_INPUTS 8
459 enum TelemetryScreenType
{
460 TELEMETRY_SCREEN_TYPE_NONE
,
461 TELEMETRY_SCREEN_TYPE_VALUES
,
462 TELEMETRY_SCREEN_TYPE_GAUGES
,
464 TELEMETRY_SCREEN_TYPE_SCRIPT
,
465 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_SCRIPT
467 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_GAUGES
470 #define MAX_TELEMETRY_SCREENS 4
471 #define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.frsky.screensType >> (2*(screenIndex))) & 0x03)
472 #define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_GAUGES)
474 #define MAX_FRSKY_A_CHANNELS 2
475 #define MAX_TELEMETRY_SCREENS 2
476 #define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
477 #define MIN_BLADES 0 // 2 blades
478 #define MAX_BLADES 3 // 5 blades
481 #define FAILSAFE_CHANNEL_HOLD 2000
482 #define FAILSAFE_CHANNEL_NOPULSE 2001
484 #define LEN_SCRIPT_FILENAME 6
485 #define LEN_SCRIPT_NAME 6
486 #define MAX_SCRIPT_INPUTS 6
487 #define MAX_SCRIPT_OUTPUTS 6
496 #define LEN_GVAR_NAME 3
497 #define GVAR_MAX 1024
498 #define GVAR_MIN -GVAR_MAX
501 #define RESERVE_RANGE_FOR_GVARS 10
502 // even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc.
504 #if defined(PCBSTD) && defined(GVARS)
506 #elif defined(PCBSTD)
508 #elif defined(CPUARM)
519 #if defined(PCBTARANIS) || defined(PCBHORUS)
520 SWSRC_SA0
= SWSRC_FIRST_SWITCH
,
532 #if !defined(PCBX7) && !defined(PCBXLITE)
537 #if !defined(PCBXLITE)
542 #if !defined(PCBX7) && !defined(PCBXLITE)
547 #if !defined(PCBXLITE)
585 SWSRC_TRAINER
= SWSRC_SH2
,
586 SWSRC_LAST_SWITCH
= SWSRC_SR2
,
587 #elif defined(PCBXLITE)
588 SWSRC_TRAINER
= SWSRC_SD2
,
589 SWSRC_LAST_SWITCH
= SWSRC_SD2
,
591 SWSRC_TRAINER
= SWSRC_SH2
,
592 SWSRC_LAST_SWITCH
= SWSRC_SH2
,
594 #else // neither Taranis nor Horus
595 SWSRC_ID0
= SWSRC_FIRST_SWITCH
,
604 SWSRC_TRAINER
= SWSRC_TRN
,
605 SWSRC_LAST_SWITCH
= SWSRC_TRN
,
609 SWSRC_FIRST_MULTIPOS_SWITCH
,
610 SWSRC_LAST_MULTIPOS_SWITCH
= SWSRC_FIRST_MULTIPOS_SWITCH
+ (NUM_XPOTS
*XPOTS_MULTIPOS_COUNT
) - 1,
614 SWSRC_TrimRudLeft
= SWSRC_FIRST_TRIM
,
631 #if defined(PCBSKY9X)
633 #elif defined(CPUM2560)
638 SWSRC_FIRST_LOGICAL_SWITCH
,
639 SWSRC_SW1
= SWSRC_FIRST_LOGICAL_SWITCH
,
651 SWSRC_LAST_LOGICAL_SWITCH
= SWSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
657 SWSRC_FIRST_FLIGHT_MODE
,
658 SWSRC_LAST_FLIGHT_MODE
= SWSRC_FIRST_FLIGHT_MODE
+MAX_FLIGHT_MODES
-1,
660 SWSRC_TELEMETRY_STREAMING
,
662 SWSRC_LAST_SENSOR
= SWSRC_FIRST_SENSOR
+MAX_TELEMETRY_SENSORS
-1,
667 SWSRC_OFF
= -SWSRC_ON
,
669 SWSRC_LAST
= SWSRC_COUNT
-1,
670 SWSRC_FIRST
= -SWSRC_LAST
,
673 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_COUNT
-1,
674 SWSRC_LAST_IN_MIXES
= SWSRC_COUNT
-1,
676 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_LAST_LOGICAL_SWITCH
,
677 SWSRC_LAST_IN_MIXES
= SWSRC_LAST_LOGICAL_SWITCH
,
680 SWSRC_FIRST_IN_LOGICAL_SWITCHES
= -SWSRC_LAST_IN_LOGICAL_SWITCHES
,
681 SWSRC_FIRST_IN_MIXES
= -SWSRC_LAST_IN_MIXES
,
684 SWSRC_INVERT
= SWSRC_COUNT
+1,
688 #define SWSRC_LAST_TRIM (SWSRC_FIRST_TRIM + 2*NUM_TRIMS - 1)
693 #if defined(VIRTUAL_INPUTS)
694 MIXSRC_FIRST_INPUT
, LUA_EXPORT_MULTIPLE("input", "Input [I%d]", MAX_INPUTS
)
695 MIXSRC_LAST_INPUT
= MIXSRC_FIRST_INPUT
+MAX_INPUTS
-1,
698 #if defined(LUA_INPUTS)
699 MIXSRC_FIRST_LUA
, LUA_EXPORT_MULTIPLE("lua", "Lua mix output %d", MAX_SCRIPTS
*MAX_SCRIPT_OUTPUTS
)
700 MIXSRC_LAST_LUA
= MIXSRC_FIRST_LUA
+(MAX_SCRIPTS
*MAX_SCRIPT_OUTPUTS
)-1,
704 MIXSRC_Rud
= MIXSRC_FIRST_STICK
, LUA_EXPORT("rud", "Rudder")
705 MIXSRC_Ele
, LUA_EXPORT("ele", "Elevator")
706 MIXSRC_Thr
, LUA_EXPORT("thr", "Throttle")
707 MIXSRC_Ail
, LUA_EXPORT("ail", "Aileron")
710 #if defined(PCBHORUS)
711 MIXSRC_S1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer S1")
712 MIXSRC_6POS
, LUA_EXPORT("6pos", "Multipos Switch")
713 MIXSRC_S2
, LUA_EXPORT("s2", "Potentiometer S2")
715 MIXSRC_S3
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("s3", "Slider S3")
716 MIXSRC_S4
, LUA_EXPORT("s4", "Slider S4")
717 MIXSRC_LS
, LUA_EXPORT("ls", "Left rear slider")
718 MIXSRC_RS
, LUA_EXPORT("rs", "Right rear slider")
719 MIXSRC_LAST_POT
= MIXSRC_RS
,
720 #elif defined(PCBX9E)
721 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
722 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
723 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
724 MIXSRC_POT4
, LUA_EXPORT("s4", "Potentiometer 4 (X9E only)")
726 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
727 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
728 MIXSRC_SLIDER3
, LUA_EXPORT("lcs", "Left center slider (X9E only)")
729 MIXSRC_SLIDER4
, LUA_EXPORT("rcs", "Right center slider (X9E only)")
730 MIXSRC_LAST_POT
= MIXSRC_SLIDER4
,
731 #elif defined(PCBX7) || defined(PCBXLITE)
732 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
733 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
734 MIXSRC_LAST_POT
= MIXSRC_POT2
,
735 #elif defined(PCBTARANIS)
736 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
737 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
738 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
740 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
741 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
742 MIXSRC_LAST_POT
= MIXSRC_SLIDER2
,
744 MIXSRC_P1
= MIXSRC_FIRST_POT
,
747 MIXSRC_LAST_POT
= MIXSRC_P3
,
750 #if defined(PCBHORUS)
751 MIXSRC_MOUSE1
, LUA_EXPORT("jsx", "Joystick X")
752 MIXSRC_MOUSE2
, LUA_EXPORT("jsy", "Joystick Y")
755 #if defined(PCBSKY9X)
757 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REa
,
758 #elif defined(CPUM2560)
761 #if ROTARY_ENCODERS > 2
764 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REd
,
766 MIXSRC_LAST_ROTARY_ENCODER
= MIXSRC_REb
,
773 MIXSRC_CYC1
= MIXSRC_FIRST_HELI
, LUA_EXPORT("cyc1", "Cyclic 1")
774 MIXSRC_CYC2
, LUA_EXPORT("cyc2", "Cyclic 2")
775 MIXSRC_CYC3
, LUA_EXPORT("cyc3", "Cyclic 3")
778 MIXSRC_TrimRud
= MIXSRC_FIRST_TRIM
, LUA_EXPORT("trim-rud", "Rudder trim")
779 MIXSRC_TrimEle
, LUA_EXPORT("trim-ele", "Elevator trim")
780 MIXSRC_TrimThr
, LUA_EXPORT("trim-thr", "Throttle trim")
781 MIXSRC_TrimAil
, LUA_EXPORT("trim-ail", "Aileron trim")
782 #if defined(PCBHORUS)
783 MIXSRC_TrimT5
, LUA_EXPORT("trim-t5", "Aux trim T5")
784 MIXSRC_TrimT6
, LUA_EXPORT("trim-t6", "Aux trim T6")
785 MIXSRC_LAST_TRIM
= MIXSRC_TrimT6
,
787 MIXSRC_LAST_TRIM
= MIXSRC_TrimAil
,
792 #if defined(PCBXLITE)
793 MIXSRC_SA
= MIXSRC_FIRST_SWITCH
, LUA_EXPORT("sa", "Switch A")
794 MIXSRC_SB
, LUA_EXPORT("sb", "Switch B")
795 MIXSRC_SC
, LUA_EXPORT("sc", "Switch C")
796 MIXSRC_SD
, LUA_EXPORT("sd", "Switch D")
797 MIXSRC_LAST_SWITCH
= MIXSRC_SD
,
798 #elif defined(PCBTARANIS) || defined(PCBHORUS)
799 MIXSRC_SA
= MIXSRC_FIRST_SWITCH
, LUA_EXPORT("sa", "Switch A")
800 MIXSRC_SB
, LUA_EXPORT("sb", "Switch B")
801 MIXSRC_SC
, LUA_EXPORT("sc", "Switch C")
802 MIXSRC_SD
, LUA_EXPORT("sd", "Switch D")
804 MIXSRC_SE
, LUA_EXPORT("se", "Switch E")
806 MIXSRC_SF
, LUA_EXPORT("sf", "Switch F")
808 MIXSRC_SG
, LUA_EXPORT("sg", "Switch G")
810 MIXSRC_SH
, LUA_EXPORT("sh", "Switch H")
812 MIXSRC_SI
, LUA_EXPORT("si", "Switch I")
813 MIXSRC_SJ
, LUA_EXPORT("sj", "Switch J")
814 MIXSRC_SK
, LUA_EXPORT("sk", "Switch K")
815 MIXSRC_SL
, LUA_EXPORT("sl", "Switch L")
816 MIXSRC_SM
, LUA_EXPORT("sm", "Switch M")
817 MIXSRC_SN
, LUA_EXPORT("sn", "Switch N")
818 MIXSRC_SO
, LUA_EXPORT("so", "Switch O")
819 MIXSRC_SP
, LUA_EXPORT("sp", "Switch P")
820 MIXSRC_SQ
, LUA_EXPORT("sq", "Switch Q")
821 MIXSRC_SR
, LUA_EXPORT("sr", "Switch R")
822 MIXSRC_LAST_SWITCH
= MIXSRC_SR
,
824 MIXSRC_LAST_SWITCH
= MIXSRC_SH
,
827 MIXSRC_3POS
= MIXSRC_FIRST_SWITCH
,
834 MIXSRC_LAST_SWITCH
= MIXSRC_TRN
,
836 MIXSRC_FIRST_LOGICAL_SWITCH
,
837 MIXSRC_SW1
= MIXSRC_FIRST_LOGICAL_SWITCH
, LUA_EXPORT_MULTIPLE("ls", "Logical switch L%d", MAX_LOGICAL_SWITCHES
)
838 MIXSRC_LAST_LOGICAL_SWITCH
= MIXSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
840 MIXSRC_FIRST_TRAINER
, LUA_EXPORT_MULTIPLE("trn", "Trainer input %d", MAX_TRAINER_CHANNELS
)
841 MIXSRC_LAST_TRAINER
= MIXSRC_FIRST_TRAINER
+MAX_TRAINER_CHANNELS
-1,
844 MIXSRC_CH1
= MIXSRC_FIRST_CH
, LUA_EXPORT_MULTIPLE("ch", "Channel CH%d", MAX_OUTPUT_CHANNELS
)
860 MIXSRC_LAST_CH
= MIXSRC_CH1
+MAX_OUTPUT_CHANNELS
-1,
863 MIXSRC_GVAR1
= MIXSRC_FIRST_GVAR
, LUA_EXPORT_MULTIPLE("gvar", "Global variable %d", MAX_GVARS
)
864 MIXSRC_LAST_GVAR
= MIXSRC_FIRST_GVAR
+MAX_GVARS
-1,
867 MIXSRC_TX_VOLTAGE
, LUA_EXPORT("tx-voltage", "Transmitter battery voltage [volts]")
868 MIXSRC_TX_TIME
, LUA_EXPORT("clock", "RTC clock [minutes from midnight]")
869 #if defined(INTERNAL_GPS)
871 MIXSRC_FIRST_RESERVE
,
873 MIXSRC_FIRST_RESERVE
,
880 MIXSRC_TIMER1
= MIXSRC_FIRST_TIMER
, LUA_EXPORT("timer1", "Timer 1 value [seconds]")
881 MIXSRC_TIMER2
, LUA_EXPORT("timer2", "Timer 2 value [seconds]")
882 MIXSRC_TIMER3
, LUA_EXPORT("timer3", "Timer 3 value [seconds]")
883 MIXSRC_LAST_TIMER
= MIXSRC_TIMER3
,
886 MIXSRC_FIRST_TELEM
, LUA_EXPORT_MULTIPLE("telem", "Telemetry sensor %d", MAX_TELEMETRY_SENSORS
)
888 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+3*MAX_TELEMETRY_SENSORS
-1
890 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+NUM_TELEMETRY
-1
894 #define MIXSRC_FIRST (MIXSRC_NONE+1)
895 #define MIXSRC_LAST MIXSRC_LAST_CH
896 #define INPUTSRC_FIRST MIXSRC_Rud
897 #define INPUTSRC_LAST MIXSRC_LAST_TELEM
900 e_backlight_mode_off
= 0,
901 e_backlight_mode_keys
= 1,
902 e_backlight_mode_sticks
= 2,
903 e_backlight_mode_all
= e_backlight_mode_keys
+e_backlight_mode_sticks
,
908 // first the functions which need a checkbox
909 FUNC_OVERRIDE_CHANNEL
,
923 // then the other functions
924 FUNC_FIRST_WITHOUT_ENABLE
,
925 FUNC_PLAY_SOUND
= FUNC_FIRST_WITHOUT_ENABLE
,
936 FUNC_BACKGND_MUSIC_PAUSE
,
944 #if defined(PCBTARANIS)
948 FUNC_TEST
, // should remain the last before MAX as not added in Companion
962 enum CountDownModes
{
972 enum ResetFunctionParam
{
979 #if defined(TELEMETRY_FRSKY)
980 FUNC_RESET_TELEMETRY
,
982 #if ROTARY_ENCODERS > 0
985 #if ROTARY_ENCODERS > 1
989 FUNC_RESET_PARAM_FIRST_TELEM
,
990 FUNC_RESET_PARAM_LAST_TELEM
= FUNC_RESET_PARAM_FIRST_TELEM
+ MAX_TELEMETRY_SENSORS
,
992 FUNC_RESET_PARAMS_COUNT
,
993 FUNC_RESET_PARAM_LAST
= FUNC_RESET_PARAMS_COUNT
-1,
996 enum AdjustGvarFunctionParam
{
997 FUNC_ADJUST_GVAR_CONSTANT
,
998 FUNC_ADJUST_GVAR_SOURCE
,
999 FUNC_ADJUST_GVAR_GVAR
,
1000 FUNC_ADJUST_GVAR_INCDEC
,
1003 enum BluetoothModes
{
1005 BLUETOOTH_TELEMETRY
,
1009 #endif // _DATACONSTANTS_H_