//================================================================= // Dest ID for FSMapper //================================================================= #define FSMAPPER 20 //========================================================================= // Constants //========================================================================= #define NEG_SIGN_BIT_MASK 0x8000 // 32768 -> 0b10000000000000000 #define SPD_FAST_DELTA 10 #define SPD_SLOW_DELTA 1 #define SPD_TIMER 3 #define MACH_TIMER 5 #define VS_TIMER 5 #define FPA_TIMER 5 #define BARO_TIMER_P 5 #define BARO_TIMER_CP 5 #define HDG_FAST_DELTA 10 #define HDG_SLOW_DELTA 1 #define HDG_TIMER 5 #define ALT_FAST_DELTA 10 #define ALT_SLOW_DELTA 1 #define ALT_TIMER 5 #define VS_DELTA 100 #define FPA_DELTA 10 #define BARO_DELTA 1 #define LDG_GEAR_DOWN 16383 // See FSUIPC Offsets in "FSUIPC for Programmers" #define LDG_GEAR_UP 0 // See FSUIPC Offsets in "FSUIPC for Programmers" #define FLAPS_UP 0 // 0x0000 #define FLAPS_1 4096 // 0x1000 #define FLAPS_2 8192 // 0x2000 #define FLAPS_3 12288 // 0x3000 #define FLAPS_FULL 16384 // 0x4000 #define SPD_BRK_ARM 1 #define SPD_BRK_DISARM 0 #define SPD_BRK_UP 0 #define SPD_BRK_1 7695 #define SPD_BRK_2 10590 #define SPD_BRK_3 13485 #define SPD_BRK_4 16383 #define PARKBRK_ON 32767 #define PARKBRK_OFF 0 #define AUTOBRAKE_0 0 // RTO, not used in Airbus #define AUTOBRAKE_OFF 1 #define AUTOBRAKE_LOW 2 #define AUTOBRAKE_MED 3 #define AUTOBRAKE_4 4 // not used on Airbus #define AUTOBRAKE_MAX 5 #define BARO_STD_SETTING 1013 #define SEAT_BELT_ON 1 #define SEAT_BELT_AUTO 0 // to be changed when AUTO function available in pmSystems #define SEAT_BELT_OFF 0 #define NO_SMOKING_ON 1 #define NO_SMOKING_AUTO 0 // to be changed when AUTO function available in pmSystems #define NO_SMOKING_OFF 0 #define APU_STATUS_OFF 0 #define APU_STATUS_ON 1 #define APU_STATUS_RUNNING 2 #define APU_STATUS_COOLING 3 #define APU_STATUS_SHUTDOWN 4 #define STROBE_ON 1 #define STROBE_OFF 0 #define LED_OFF 0 #define LED_ON 1 #define LED_FLASH_FAULT 10 // 10 * 20msec = 200msec. Flash interval for emergency signalisation #define LED_FLASH_NORMAL 20 // 20 * 20msec = 400msec. Flash interval for normal operation //======== command codes =================================================== //-------------------------------------------------------------------------- // Button command codes //-------------------------------------------------------------------------- #define nqw_Cmd_Buttons_00 0x30 #define nqw_Cmd_Buttons_01 0x31 #define nqw_Cmd_Buttons_02 0x32 //-------------------------------------------------------------------------- // send value command codes //-------------------------------------------------------------------------- #define nqw_Cmd_ALT 0x35 // command code to send ALT value to FSUIPC #define nqw_Cmd_HDG 0x36 // command code to send HDG value to FSUIPC #define nqw_Cmd_SPD 0x37 // command code to send SPD value to FSUIPC #define nqw_Cmd_VS 0x38 // command code to send VS value to FSUIPC #define nqw_Cmd_CDU_KEYS 0x39 // command code to send CDU Keys value to FSUIPC #define nqw_Cmd_VOR1crs 0x3a // command code to send VOR1 course value to FSUIPC #define nqw_Cmd_VOR1freq 0x3b // command code to send VOR1 frequency value to FSUIPC #define nqw_Cmd_ILS1crs 0x3c // command code to send ILS1 course value to FSUIPC #define nqw_Cmd_ILS1freq 0x3d // command code to send ILS1 frequency value to FSUIPC #define nqw_Cmd_ADFfreq_Low 0x3e // command code to send ADF frequency value to FSUIPC #define nqw_Cmd_ADFfreq_High 0x3f // command code to send ADF frequency value to FSUIPC #define nqw_Cmd_FLAPS 0x40 // command code to send FLAPS value to FSUIPC #define nqw_Cmd_XPDR 0x41 // command code to send XPDR value to FSUIPC #define nqw_Cmd_BARO_P 0x42 // command code to send BARO_P value to FSUIPC #define nqw_Cmd_BARO_CP 0x43 // command code to send BARO_CP value to FSUIPC #define nqw_Cmd_SPD_BRK 0x44 // command code to send speed brake value to FSUIPC #define nqw_Cmd_LDG_GEAR 0x45 // command code to send Landing gear value to FSUIPC #define nqw_Cmd_PARKBRK 0x46 // command code to send parking brake value to FSUIPC #define nqw_Cmd_MACH 0x47 // command code to send MACH value to FSUIPC #define nqw_Cmd_VHF1freq 0x48 // command code to send VHF1 frequency value to FSUIPC #define nqw_Cmd_ElanCode 0x49 // command code to send ELAN code codes to FS #define nqw_Cmd_Elevator_trim 0x50 // command code to send elevator trim values #define nqw_Cmd_ND_Modes 0x51 // command code to send ND mode values to PM #define nqw_Cmd_GC_KEYB 0x52 // command code to send GC keyboard codes #define nqw_Cmd_AUTOBRAKE 0x53 // command code to send Autobrake positions to FS #define nqw_Cmd_SPD_BRK_ARM 0x54 // command code to send speed brake armed status to FSUIPC #define nqw_Cmd_ENG1_START 0x55 // command code to send engine start command to FS #define nqw_Cmd_ENG2_START 0x56 // command code to send engine start command to FS #define nqw_Cmd_ENG3_START 0x57 // command code to send engine start command to FS #define nqw_Cmd_ENG4_START 0x58 // command code to send engine start command to FS #define nqw_Cmd_ENG1_FUEL 0x59 // command code to send fuel on/off value #define nqw_Cmd_ENG2_FUEL 0x60 // command code to send fuel on/off value #define nqw_Cmd_ENG3_FUEL 0x61 // command code to send fuel on/off value #define nqw_Cmd_ENG4_FUEL 0x62 // command code to send fuel on/off value #define nqw_Cmd_CPT_PFD_ON_OFF 0x63 // command code to send display on/off to PM displays #define nqw_Cmd_CPT_ND_ON_OFF 0x64 // command code to send display on/off to PM displays #define nqw_Cmd_UPPER_ECAM_ON_OFF 0x65 // command code to send display on/off to PM displays #define nqw_Cmd_LOWER_ECAM_ON_OFF 0x66 // command code to send display on/off to PM displays #define nqw_Cmd_FO_PFD_ON_OFF 0x67 // command code to send display on/off to PM displays #define nqw_Cmd_FO_ND_ON_OFF 0x68 // command code to send display on/off to PM displays #define nqw_Cmd_ATHR_GATES 0x69 // command code to send Thrust gates values to PM #define nqw_Cmd_WXR 0x70 // command code to send Weather radar commands #define nqw_Cmd_EngStartSwitch 0x71 // Ignition start switch #define nqw_Cmd_Rudder_trim 0x72 // command to send Rudder Trim value #define nqw_Cmd_NoSmokingSign 0x73 // commant to send no smoking sign value #define nqw_Cmd_SeatBeltSign 0x74 // commant to send fasten seat belts sign value #define nqw_Cmd_APU_Start 0x75 // command to send APU on/off value #define nqw_Cmd_Strobe 0x76 // commant to switch on/off strobe light #define nqw_Cmd_StickPriority 0x1023 // command code to send stick priority values to FSCommunicator //--------- mapping of throttle number to analog channel -------------------- #define THROTTLE_1 4 #define THROTTLE_2 5 #define THROTTLE_3 6 #define THROTTLE_4 7 #define REVERSER_1 8 #define REVERSER_2 9 #define REVERSER_3 10 #define REVERSER_4 11 #define IDLE_POT 250 // value of 250 or greater means idle thrust (pot at idle) #define TOGA_POT 5 // value of 5 or lower meand TOGA thrust (pot at maximum) #define IDLE 1 // 00000001 #define CLB 2 // 00000010 #define FLEX_MCT 4 // 00000100 #define TOGA 8 // 00001000 #define REV_IDLE 16 // 00010000 #define REV_MAX 32 // 00100000 //------------------------------------------------------ // Stick priority takeover commands //------------------------------------------------------ #define StickPrioTakeoverP_On 100 // #define StickPrioTakeoverP_Off 101 // #define StickPrioTakeoverCP_On 102 // #define StickPrioTakeoverCP_Off 103 // //----------------------------------------------------- // offset 55f0 -> brightness control of PM displays // Length 6 // Byte 0 - Captain PFD // Byte 1 - Captain ND // Byte 2 - Upper ECAM // Byte 3 - Lower ECAM // Byte 4 - F/O ND // Byte 5 - F/O PFD // Values : 0 - INOP, 1 Dark -100 Bright //----------------------------------------------------- #define DISPLAY_OFF 1 // 00000000 00000001 #define DISPLAY_ON 256 // 00000001 00000000 //-------- definitions of MCP/FCU Elan codes for offset 0x4f2 -------------- #define BARO_SEL_P 50 // push baro knob #define BARO_STD_P 51 // pull baro knob (set to standard) #define BARO_SEL_CP 150 // push baro knob #define BARO_STD_CP 151 // pull baro knob (set to standard) #define BARO_IN_INCHES 62 #define BARO_IN_HPA 63 #define FD_ON_P 37 #define FD_OFF_P 38 #define FD_ON_CP 17 #define FD_OFF_CP 18 #define LS_P 49 #define LS_CP 149 //-------- Bit Masks for Glass cockpit Keyboard interface ------------------ #define Mask_Pilot 0x1000 // 0b00010000 00000000 #define Mask_CoPilot 0x2000 // 0b00100000 00000000 #define Mask_Eicas 0x4000 // 0b01000000 00000000 #define Mask_UpperByte 0x00ff // 0b00000000 11111111 #define Mask_LowerByte 0xff00 // 0b11111111 00000000 //-------- Shift Key values ------------------------------------------------ #define Key_NORMAL 0x0000 // 0b00000000 00000000 no bit set #define Key_SHIFT 0x0100 // 0b00000001 00000000 bit 0 set #define Key_CTRL 0x0200 // 0b00000010 00000000 bit 1 set #define Key_ALT 0x0400 // 0b00000100 00000000 bit 2 set #define Key_LEFTMOST_BIT 0x8000 // 0b01111000 00000000 no bit set //#define Key_LEFTMOST_BIT 0x8000 // 0b10000000 00000000 no bit set //-------- ASCII Key values -> low byte of word set via enque16(0x39,...) -- #define KeyASCII_BACKSPACE 0x08 #define KeyASCII_TAB 0x09 #define KeyASCII_ENTER 0x0d #define KeyASCII_PAUSE 0x13 #define KeyASCII_ESCAPE 0x1b #define KeyASCII_SPACE 0x20 #define KeyASCII_PAGE_UP 0x21 #define KeyASCII_PAGE_DN 0x22 #define KeyASCII_END 0x23 #define KeyASCII_HOME 0x24 #define KeyASCII_LEFT_ARROW 0x25 #define KeyASCII_UP_ARROW 0x26 #define KeyASCII_RIGHT_ARROW 0x27 #define KeyASCII_DN_ARROW 0x28 #define KeyASCII_INSERT 0x2d #define KeyASCII_DELETE 0x2e #define KeyASCII_0_MAINKEYB 0x30 #define KeyASCII_1_MAINKEYB 0x31 #define KeyASCII_2_MAINKEYB 0x32 #define KeyASCII_3_MAINKEYB 0x33 #define KeyASCII_4_MAINKEYB 0x34 #define KeyASCII_5_MAINKEYB 0x35 #define KeyASCII_6_MAINKEYB 0x36 #define KeyASCII_7_MAINKEYB 0x37 #define KeyASCII_8_MAINKEYB 0x38 #define KeyASCII_9_MAINKEYB 0x39 #define KeyASCII_A 0x41 #define KeyASCII_B 0x42 #define KeyASCII_C 0x43 #define KeyASCII_D 0x44 #define KeyASCII_E 0x45 #define KeyASCII_F 0x46 #define KeyASCII_G 0x47 #define KeyASCII_H 0x48 #define KeyASCII_I 0x49 #define KeyASCII_J 0x4a #define KeyASCII_K 0x4b #define KeyASCII_L 0x4c #define KeyASCII_M 0x4d #define KeyASCII_N 0x4e #define KeyASCII_O 0x4f #define KeyASCII_P 0x50 #define KeyASCII_Q 0x51 #define KeyASCII_R 0x52 #define KeyASCII_S 0x53 #define KeyASCII_T 0x54 #define KeyASCII_U 0x55 #define KeyASCII_V 0x56 #define KeyASCII_W 0x57 #define KeyASCII_X 0x58 #define KeyASCII_Y 0x59 #define KeyASCII_Z 0x5a #define KeyASCII_0_NUMPAD 0x60 // NumLock on #define KeyASCII_1_NUMPAD 0x61 // NumLock on #define KeyASCII_2_NUMPAD 0x62 // NumLock on #define KeyASCII_3_NUMPAD 0x63 // NumLock on #define KeyASCII_4_NUMPAD 0x64 // NumLock on #define KeyASCII_5_NUMPAD 0x65 // NumLock on #define KeyASCII_6_NUMPAD 0x66 // NumLock on #define KeyASCII_7_NUMPAD 0x67 // NumLock on #define KeyASCII_8_NUMPAD 0x68 // NumLock on #define KeyASCII_9_NUMPAD 0x69 // NumLock on #define KeyASCII_ASTERISK_NUMPAD 0x6a #define KeyASCII_PLUS_NUMPAD 0x6b #define KeyASCII_MINUS_NUMPAD 0x6d #define KeyASCII_POINT_NUMPAD 0x6e #define KeyASCII_SLASH_NUMPAD 0x6f #define KeyASCII_F1 0x70 #define KeyASCII_F2 0x71 #define KeyASCII_F3 0x72 #define KeyASCII_F4 0x73 #define KeyASCII_F5 0x74 #define KeyASCII_F6 0x75 #define KeyASCII_F7 0x76 #define KeyASCII_F8 0x77 #define KeyASCII_F9 0x78 #define KeyASCII_F10 0x79 #define KeyASCII_F11 0x7a #define KeyASCII_F12 0x7b #define KeyASCII_ENTER_NUMPAD 0x87 #define KeyASCII_NUMLOCK 0x90 #define KeyASCII_SCROLLLOCK 0x91 //-------- PM Values for control of ND modes (pilot). CoPilot = Value + 100) //-------- Values must be sent to offset 04f4 #define ND_MODE_CP 100 #define ND_MAP 1 #define ND_NAV 2 #define ND_VOR 3 #define ND_PLAN 4 #define ND_ILS 5 #define SHOWCTRL_ECAM 8 #define HIDECTRL_ECAM 9 #define PFD_EICAS 11 // for Airbus, ENG mode in EICAS panel #define TOGGLE_NO_SMOKING 22 #define TOGGLE_SEATBELTS 23 #define TOGGLE_METRIC 26 #define ENGINE_PAGE_0 30 #define ENGINE_PAGE_1 31 #define ENGINE_PAGE_2 32 #define ENGINE_PAGE_3 33 #define ENGINE_PAGE_4 34 #define ENGINE_PAGE_5 35 #define ENGINE_PAGE_6 36 #define ENGINE_PAGE_7 37 #define ENGINE_PAGE_8 38 #define ENGINE_PAGE_9 39 #define ND_RANGE_5 40 #define ND_RANGE_10 41 #define ND_RANGE_20 42 #define ND_RANGE_40 43 #define ND_RANGE_80 44 #define ND_RANGE_160 45 #define ND_RANGE_320 46 #define ND_RANGE_640 47 #define TCAS_Off 50 #define TCAS_On 51 #define TCAS_Callsign 52 #define TCAS_All 53 #define ND_OverviewPage_On 60 #define ND_OverviewPage_Off 61 #define ND_CHRONO_TOGGLE 62 #define WXR_Show 70 #define WXR_Hide 71 #define WXR_Toggle 72 #define VORADFL_OFF 73 #define ADFL_ON 74 #define VORL_ON 75 #define VORADFR_OFF 76 #define ADFR_ON 77 #define VORR_ON 78 #define TerrainDisp_On 80 #define TerrainDisp_Off 81 #define TerrainDisp_Toggle 82 #define TerrainTypeChange 83 #define TerrainColourChange 84 #define TerrainSizeChange 85 #define Terrain3D 86 #define ND_TOGGLE_STA 90 #define ND_TOGGLE_VOR 91 #define ND_TOGGLE_NDB 92 #define ND_TOGGLE_WPT 93 #define ND_TOGGLE_ARPT 94 #define ND_TOGGLE_DATA 95 #define ND_TOGGLE_POS 96 // Sec Eicas Airbus #define SEC_EICAS_ENG 301 #define SEC_EICAS_BLEED 302 #define SEC_EICAS_PRESS 303 #define SEC_EICAS_ELEC_AC 304 #define SEC_EICAS_HYD 305 #define SEC_EICAS_FUEL 306 #define SEC_EICAS_APU 307 #define SEC_EICAS_AIRCOND 308 #define SEC_EICAS_DOOR 309 #define SEC_EICAS_WHEEL 310 #define SEC_EICAS_F_CTL 311 #define SEC_EICAS_ALL 313 #define SEC_EICAS_CLR_LEFT 314 #define SEC_EICAS_STS 315 #define SEC_EICAS_RCL 316 #define SEC_EICAS_CLR_RIGHT 317 #define SEC_EICAS_ELEC_DC 318 #define SEC_EICAS_CIRCUIT_BREAKER 319 //#define SEC_EICAS_TO_CFG xxx //#define SEC_EMER_CANC xxx #define CAUTION_ON 401 // see 0x4fe #define CAUTION_RESET 402 //------------------------------------------------------------------------- // Engine Start commands //------------------------------------------------------------------------- #define ENG_OFF 0 #define ENG_START 1 #define ENG_GEN 2 #define FUEL_ON 255 #define FUEL_OFF 0 #define ENG_1_CUTOFF 0 // 00000001 -> bit no. 0 #define ENG_2_CUTOFF 1 // 00000010 -> bit no. 1 #define ENG_3_CUTOFF 16 // 00010000 -> bit no. 4 #define ENG_4_CUTOFF 32 // 00100000 -> bit no. 5 #define ENG_START_SWITCH_CRANK 0 #define ENG_START_SWITCH_NORM 1 #define ENG_START_SWITCH_START 2 //------------------------------------------------------------------------- // Autothrust gates //------------------------------------------------------------------------- #define ATHR_GATE_MAXREV 1 #define ATHR_GATE_IDLEREV 2 #define ATHR_GATE_IDLE 3 #define ATHR_GATE_CLB 4 #define ATHR_GATE_FLX_MCT 5 #define ATHR_GATE_TOGA 6 //------------------------------------------------------------------------- // SA WXR commands (SA_WXR from Florian Praxmarer) // Sys1 and Sys2 not supported by SA_WXR but is simulated here. Switching // either of the two will switch on or off the same weather radar. // Range can be set by setting bits 4 to 6 with 1,2,3,4,5,6 which equals // to a range of 10,20,40,80,160,320 //------------------------------------------------------------------------- #define WXR_OFF 128 // 00000000 10000000 #define WXR_SYS1_WX 129 // 00000000 10000001 #define WXR_SYS1_WX_TURB 130 // 00000000 10000010 #define WXR_SYS1_MAP 130 // not supported by SA-WXR #define WXR_SYS2_WX 129 // 00000000 10000001 #define WXR_SYS2_WX_TURB 130 // 00000000 10000010 #define WXR_SYS2_MAP 130 // not supported by SA-WXR #define WXR_RANGE_10 144 // 00000000 10010000 -> 1 #define WXR_RANGE_20 160 // 00000000 10100000 -> 2 #define WXR_RANGE_40 176 // 00000000 10110000 -> 3 #define WXR_RANGE_80 192 // 00000000 11000000 -> 4 #define WXR_RANGE_160 208 // 00000000 11010000 -> 5 #define WXR_RANGE_320 224 // 00000000 11100000 -> 6 //========================================================================= // Variable declarations //========================================================================= //------------------------------------------------------------------------- // Rotary Variables (16 bit) // // rvar(,,,,[no wrap flag]); (signed. range -32768 to 32767) // urvar(,,,,[no wrap flag]); (unsigned. range 0 to 65535) // // if the wrap flag is set to false, the rvar will not rotate, but // will stay in the sepcified bounds. //------------------------------------------------------------------------- rvar(rvar_ALT, 0, 600, 45, true); // Alt, wrap flag set rvar(rvar_SPD, 0, 500, 250, true); // speed, wrap flag set rvar(rvar_MACH, 0, 99, 80, true); // MACH, wrap flag set rvar(rvar_HDG, 0, 359, 156, false); // heading (min=0, max=359, default=156, rotate) rvar(rvar_VOR1crs, 0, 359, 156, false); // variable for VOR1 course setting rvar(rvar_ILS1crs, 0, 359, 156, false); // variable for ILS1 course setting (same as VOR1) rvar(rvar_VOR1freq_d, 0, 99, 30, false); // VOR1 frequency, deximals rvar(rvar_VOR1freq_h, 108, 117, 114, false); // VOR1 frequency, hundreds rvar(rvar_ILS1freq_d, 0, 99, 50, false); // variable for ILS1 frequency, decimals rvar(rvar_ILS1freq_h, 108, 117, 110, false); // variable for ILS1 frequency, hundreds rvar(rvar_ADF1stby_d, 0, 99, 50, false); // variable for ADF1 standby frequency, decimals rvar(rvar_ADF1stby_h, 20, 169, 20, false); // variable for ADF1 standby frequency, hundreds rvar(rvar_VHF1stby_d, 0, 99, 52, false); // VHF1 standby, decimal part rvar(rvar_VHF1stby_h, 118, 136, 128, false); // VHF1 standby, hundreds part rvar(rvar_VHF2stby_d, 0, 99, 50, false); // VHF2 standby, decimal part rvar(rvar_VHF2stby_h, 118, 136, 128, false); // VHF2 standby, hundreds part rvar(rvar_XPDR_1, 0, 7, 7, false); // transponder digit 4 (ones) rvar(rvar_XPDR_10, 0, 7, 7, false); // transponder digit 3 (decimals) rvar(rvar_XPDR_100, 0, 7, 7, false); // transponder digit 2 (hundreds) rvar(rvar_XPDR_1000, 0, 7, 7, false); // transponder digit 1 (thousands) //urvar(urvar_ALT, 0, 600, 45, true); // Alt, wrap flag set -> urvar causes a compiler error. //==================================================================== // flags //==================================================================== flag f_FD_P_On = false; // Flight Director flag, FD of PM is not toggled flag f_FD_CP_On = false; // Flight Director flag, FD of PM is not toggled flag f_IdleSet = false; flag f_StkPrio_P = false; flag f_AutoLand_P = false; flag f_StkPrio_CP = false; flag f_AutoLand_CP = false; flag f_MastWarn = false; flag f_MastCaut = false; flag f_NegVS = false; flag f_TOGA1set = false; flag f_TOGA2set = false; flag f_TOGA3set = false; flag f_TOGA4set = false; flag f_RMP_VOR_P = true; // initialize flag RMP_VOR mode flag f_RMP_ILS_P = false; // delete flag RMP_ILS mode flag f_RMP_MLS_P = false; // delete flag RMP_MLS mode flag f_RMP_ADF_P = false; // delete flag RMP_ADF mode flag f_RMP_BFO_P = false; // delete flag RMP_BFO mode flag f_RMP_Freq_P = true; // initialize flag for frequency display (NAV backup) flag f_RMP_VHF1_P = true; // initialize flag for RMP_VHF1_P radio active flag f_Negative = false; flag f_PHValueIsValid = true; flag f_Dummy = true; flag f_SpdTiming = false; flag f_MACHTiming = false; flag f_HdgTiming = false; flag f_AltTiming = false; flag f_VSTiming = false; flag f_FPATiming = false; flag f_BaroTiming_P = false; flag f_BaroTiming_CP = false; flag f_SPD_Active = false; flag f_PlusSign = true; flag f_CDU_KEY = true; flag f_HDG_valid = true; // used to display dash or value in display flag f_SPD_valid = true; // used to display dash or value in display flag f_ALT_valid = true; // used to display dash or value in display flag f_VS_valid = true; // used to display dash or value in display flag f_WXR_SYS_On = false; // either weather radar is on or off flag f_TCAS_On = false; // either TCAS/ATC System is on or off flag f_BaroCP_set = false; // copy the baro setting from pilot to copilot once flag f_FPA_Mode_On = false; // flag for checking if VS or FPA mode is active flag f_AutoBrk_Low_On = false; // Autobrake toggle flag flag f_AutoBrk_Med_On = false; // Autobrake toggle flag flag f_AutoBrk_Max_On = false; // Autobrake toggle flag // flags for BtnToggle replacement (as long as BtnToggle isn't available) //------------------------------------------------------------------------ flag f_BtnToggle_b_AT = false; flag f_BtnToggle_b_StkPrio_P = false; flag f_BtnToggle_b_MastWarn_P = false; flag f_BtnToggle_b_MastCaut_P = false; flag f_BtnToggle_b_AutoLand_P = false; flag f_BtnToggle_b_StkPrio_CP = false; flag f_BtnToggle_b_MastWarn_CP = false; flag f_BtnToggle_b_MastCaut_CP = false; flag f_BtnToggle_b_AutoLand_CP = false; //==================================================================== // Variable definitions //==================================================================== //-------------------------------------------------------------------- // word variables (16 bit) range 0 - 65535 //-------------------------------------------------------------------- //word wrd_ALT = 4500; // ALT setting word wrd_VS = 0; // V/S word wrd_FPA = 0; // Flight path angle word wrd_Baro_P = 1013; // baro Pilot side word wrd_Baro_CP = 1013; // baro CoPilot side word wrd_Baro_hPa_P = 1013; // baro Pilot side word wrd_Baro_hPa_CP = 1013; // baro CoPilot side word wrd_Baro_InHg_P = 2991; // baro Pilot side InHg word wrd_Baro_InHg_CP = 2991; // baro CoPilot side InHg word wrd_Delta = 0; // variable for altitude delta (increment by 100 or 1000) word wrd_VS_tmp = 0; // work variable for V/S settings word wrd_VS1 = 0; // work variable for V/S settings word wrd_wrkVS = 0; // work variable for V/S settings word wrd_FPA_tmp = 0; // work variable for FPA settings word wrd_SegTest = 8888; // used to light up all segments of the 7 seg. displays word wrd_Baro_hPa = 1013; // used to store the barometric pressure from the pigeon hole word wrd_Baro_InHg = 2991; // used to store the barometric pressure from the pigeon hole word wrd_Baro_FS = 0; // contains the baro pressure setting * 16 to send to FS word wrd_XPDR = 7777; // transponder setting word wrd_VHF1 = 0; // VHF1 Variable for the whole value (which is sent to FS) word wrd_VOR1freq = 0; // VOR1 Variable for the whole value (which is sent to FS) word wrd_ADF1 = 0; // ADF1 frequency word wrd_ADF1act = 0; // ADF1 active frequency word wrd_ADF1act_thousands = 0; // variable for ADF1 thousands value word wrd_ADF1act_fraction = 0; // variable for ADF1 fractions value word wrd_ILS1freq = 0; // ILS1 Variable for the whole value (which is sent do FS) word wrd_VOR1crs = 156; // variable for VOR1 course setting word wrd_VOR2crs = 156; // variable for VOR2 course setting word wrd_MLS1crs = 156; // variable for MLS1 course setting word wrd_RudTrimPos = 222; // variable for Ruder position word wrd_WhiskHdg = 0; // variable for magnetic heading (Whiskey Compass) word wrd_NegativeTest = 0; // variable for negativeness test word wrd_Work = 0; // work variable word wrd_LdgGearNose = 0; // Nose landing gear position -> 0 = full up, 16383 = full down word wrd_LdgGearLeft = 0; // Left landing gear position -> 0 = full up, 16383 = full down word wrd_LdgGearRight = 0; // Right landing gear position -> 0 = full up, 16383 = full down word wrd_MACH = 0; // holds the MACH value word wrd_BCD_Work = 0; // Work variable for BCD transformation word wrd_BCD_WorkTemp = 0; // Work variable for BCD transformation word wrd_WorkValueDiv1000 = 0; word wrd_WorkValueDiv100 = 0; word wrd_WorkValueDiv10 = 0; word wrd_WorkValueDiv1 = 0; word wrd_KeyCode = 0; // temporary variable for a Keyboard code word wrd_Cmd_KeyCode = 0; // temporary variable for a Keyboard command code word wrd_Key_ShiftState = 0; // temporary variable for a CDU Keycode word wrd_ElevTrimPos = 0; // elevator trim position word wrd_ND_Mode = 0; // mode value variable for ND modes word wrd_BitToggle = 0; word wrd_Temp = 0; // workaround variable for sending rvar's to ndw's word wrd_Test = 0; word wrd_Offset_4f4_Data = 0; // variable for various offset 4f4 data word wrd_WXR_Mode = 0; // variable for WXR mode passed to funtion word wrd_Autobrake = 0; // Autobrake value word wrd_APU_Status = 0; // APU Status //------------------------------------------------------------------------- // byte variables (8 bit), range 0 - 255 //------------------------------------------------------------------------- byte byt_COMwork_h = 0; // workvariable byte byt_COMwork_d = 0; // workvariable byte byt_MLS1freq_d = 50; // variable for MLS1 frequency, decimals byte byt_MLS1freq_h = 110; // variable for MLS1 frequency, hundreds byte byt_ADF1act_h = 0; // variable for ADF1 active frequency, hundreds byte byt_ADF1act_d = 0; // variable for ADF1 active frequency, decimals byte byt_ADFHiLo = 0; byte byt_COMUpLimit = 136; // COM frequency cannot be higher than 136.xx byte byt_COMLoLimit = 118; // COM frequency cannot be lower than 118.xx byte byt_VORUpLimit = 117; // VOR frequency cannot be higher than 117.xx byte byt_VORLoLimit = 108; // VOR frequency cannot be lower than 108.xx byte byt_ADFUpLimit = 169; // ADF frequency cannot be higher than 169x.x byte byt_ADFLoLimit = 20; // ADF frequency cannot be lower than 02xx.x byte byt_RudTrimPos_LR = 0; // variable for L/R display of rudder trim byte byt_Work = 0; // work variable byte byt_Tick = 0; byte byt_SpdTime = 0; byte byt_MACHTime = 0; byte byt_HdgTime = 0; byte byt_AltTime = 0; byte byt_VSTime = 0; byte byt_FPATime = 0; byte byt_BaroTime_P = 0; byte byt_BaroTime_CP = 0; byte byt_KeyCode = 0; byte byt_AT_mode = 0; byte byt_AT_Status = 0; byte byt_WXR_On = 0; // 1 = on, 0 = off byte byt_APU_Start_LED_Status = 0; // variable used to pass the status of the APU start switch led (on, off, flashing) //-------------------------------------------------------------------- // bcd variables (for values which have signs, units, fractions //-------------------------------------------------------------------- bcd bcd_Baro_InHg = 0; bcd bcd_Baro_InHg_P = 0; bcd bcd_Baro_InHg_CP = 0; bcd bcd_VHF1act = 0; bcd bcd_VHF2act = 0; bcd bcd_ADF1act = 0; bcd bcd_ADF2act = 0; bcd bcd_VOR1freq = 0; bcd bcd_ILS1freq = 0; bcd bcd_FPA = 0; //==================================================================== // QProc definitions (sending data from FS to EPIC Variables) //==================================================================== defineqproc(1,LS_P_On) defineqproc(2,LS_P_Off) //defineqproc(12,AircraftNotOnGround) //defineqproc(13,AircraftOnGround) //defineqproc(18,AutoPilot_Off) //defineqproc(19,AutoPilot_On) //defineqproc(20,ALTHold_Off) //defineqproc(21,ALTHold_On) //defineqproc(22,HDGHold_Off) //defineqproc(23,HDGHold_On) //defineqproc(24,LOC_Off) //defineqproc(25,LOC_On) //defineqproc(36,SpoilerDis) //defineqproc(37,SpoilerArmed) defineqproc(40,APP_Off) defineqproc(41,APP_On) defineqproc(46,SPD_Off) defineqproc(47,SPD_On) defineqproc(48,MACH_Off) defineqproc(49,MACH_On) //defineqproc(50,VS_Off) //defineqproc(51,VS_On) defineqproc(52,AT_Off) defineqproc(53,AT_On) defineqproc(54,FPA_Off) defineqproc(55,FPA_On) //defineqproc(96,Parking_Off) //defineqproc(97,Parking_On) defineqproc(132,Mngd_HDG_Off) defineqproc(133,Mngd_HDG_On) defineqproc(134,Mngd_ALT_Off) defineqproc(135,Mngd_ALT_On) defineqproc(136,Mngd_SPD_Off) defineqproc(137,Mngd_SPD_On) defineqproc(138,THR_Off) defineqproc(139,THR_On) defineqproc(140,FD_Off) defineqproc(141,FD_On) defineqproc(142,AP1_Off) defineqproc(143,AP1_On) defineqproc(144,AP2_Off) defineqproc(145,AP2_On) //defineqproc(146,AP3_Off) //defineqproc(147,AP3_On) defineqproc(150,WindShear_Off) defineqproc(151,WindShear_On) defineqproc(152,BelowGS_Off) defineqproc(153,BelowGS_On) defineqproc(154,MastCaut_Off) defineqproc(155,MastCaut_On) defineqproc(156,MastWarn_Off) defineqproc(157,MastWarn_On) //defineqproc(162,NDVOR1Needle_Off) //defineqproc(163,NDVOR1Needle_On) //defineqproc(164,NDVOR2Needle_Off) //defineqproc(165,NDVOR2Needle_On) //defineqproc(182,CDUExecLight_Off) //defineqproc(183,CDUExecLight_On) //defineqproc(184,CDUMsgLight_Off) //defineqproc(185,CDUMsgLight_On) //defineqproc(186,CDUFailLight_Off) //defineqproc(187,CDUFailLight_On) defineqproc(188,SPD_dashed_Off) defineqproc(189,SPD_dashed_On) defineqproc(190,HDG_dashed_Off) defineqproc(191,HDG_dashed_On) defineqproc(192,VS_dashed_Off) defineqproc(193,VS_dashed_On) defineqproc(315,StickPrio_TakeOver_P_On) defineqproc(314,StickPrio_TakeOver_P_Off) defineqproc(317,StickPrio_RedArrow_P_On) defineqproc(316,StickPrio_RedArrow_P_Off) defineqproc(319,StickPrio_TakeOver_CP_On) defineqproc(318,StickPrio_TakeOver_CP_Off) defineqproc(321,StickPrio_RedArrow_CP_On) defineqproc(320,StickPrio_RedArrow_CP_Off) //defineqproc(1000,MastWarn_On) //defineqproc(1001,MastWarn_Off) //=================================================================== // Macros //=================================================================== //------------------------------------------------------------------- // MakeDec16 // // This is needed to make a binary 16 bit value from two 'decimal' // bytes. i.e. 100*hi + lo. // The result is usefull for "SetBcdPov" calls //------------------------------------------------------------------- #macro MakeDec16(wordv, hi8, lo8) wordv = hi8 * 100; wordv = wordv + lo8; #endmac //------------------------------------------------------------------- // MakeBCD // // This is needed to make a BCD value // VHF, XPDR etc. need the values sent to be in the BCD format // example: // value 3095 in dec -> value 0x3095 -> 12437 in decimal // the value is generated as follows: // 2 * 16^3 + 8 * 16^2 + 5 * 16^1 + 2 * 16^0 // // lshift of 4 bytes corresponds to a multiplication by 16 //------------------------------------------------------------------- #macro MakeBCD(wrd_BCD_Work, wrd_DEC) wrd_WorkValueDiv1000 = wrd_DEC / 1000; // remainder is lost, result is 2 wrd_WorkValueDiv100 = wrd_DEC / 100; // remainder is lost, result is 28 wrd_WorkValueDiv10 = wrd_DEC / 10; // remainder is lost, result is 285 wrd_WorkValueDiv1 = wrd_DEC; // remainder is lost, result is 2852 byt_WorkValue3 = wrd_WorkValueDiv1000; // result is 2 byt_WorkValue2 = wrd_WorkValueDiv100; // result is 28 byt_WorkTemp = wrd_WorkValueDiv1000 * 10; // result is 20 byt_WorkValue2 = byt_WorkValue2 - byt_WorkTemp; // result is 8 byt_WorkValue1 = wrd_WorkValueDiv10; // result is 285 byt_WorkTemp = wrd_WorkValueDiv100 * 10; // result is 280 byt_WorkValue1 = byt_WorkValue1 - byt_WorkTemp; // result is 5 byt_WorkValue0 = wrd_WorkValueDiv1; // result is 2852 byt_WorkTemp = wrd_WorkValueDiv10 * 10; // result is 2850 byt_WorkValue0 = byt_WorkValue0 - byt_WorkTemp; // result is 2 wrd_BCD_Work = byt_WorkValue3 << 12; // multiply by 16^3 wrd_BCD_WorkTemp = byt_WorkValue2 << 8; // multiply by 16^2 wrd_BCD_Work = wrd_BCD_Work + wrd_BCD_WorkTemp; wrd_BCD_WorkTemp = byt_WorkValue1 << 4; // multiply by 16^1 wrd_BCD_Work = wrd_BCD_Work + wrd_BCD_WorkTemp; wrd_BCD_WorkTemp = byt_WorkValue0; // 'multiply by 16^0' wrd_BCD_Work = wrd_BCD_Work + wrd_BCD_WorkTemp; #endmac //=================================================================== // ENQUE16 device/button numbers // The format is 0xddbb, where dd is the device number and bb is the // button number defined in this device. There is no way of using // virtual buttons (like Joystick_02.b_AP_on) yet, but will be in the future. //=================================================================== // Device 0 (Joystick_00) //------------------------------------------------------------------- #define e_Brake 0x0001 // b_Brake button 00, Joystick 0, abs. btn 00 // #define e_ElevTrimUp 0x0002 // b_ElevTrimUp button 01, Joystick 0, abs. btn 01 // #define e_ElevTrimDn 0x0003 // b_ElevTrimDn button 02, Joystick 0, abs. btn 02 #define e_AP_Dis 0x0004 // b_AP_dis button 03, Joystick 0, abs. btn 03 #define e_4 0x0005 // b_ button 04, Joystick 0, abs. btn 04 #define e_5 0x0006 // b_ button 05, Joystick 0, abs. btn 05 #define e_6 0x0007 // b_ button 06, Joystick 0, abs. btn 06 #define e_7 0x0008 // b_ button 07, Joystick 0, abs. btn 07 #define e_Eng1_Master 0x0009 // b_Eng1_Master button 08, Joystick 0, abs. btn 08 #define e_Eng2_Master 0x000a // b_Eng2_Master button 09, Joystick 0, abs. btn 09 #define e_Eng3_Master 0x000b // b_Eng3_Master button 10, Joystick 0, abs. btn 10 #define e_Eng4_Master 0x000c // b_Eng4_Master button 11, Joystick 0, abs. btn 11 #define e_12 0x000d // b_ button 12, Joystick 0, abs. btn 12 #define e_13 0x000e // b_ button 13, Joystick 0, abs. btn 13 #define e_14 0x000f // b_ button 14, Joystick 0, abs. btn 14 #define e_15 0x0010 // b_ button 15, Joystick 0, abs. btn 15 #define e_VORADFL_Off_P 0x0011 // b_VORADF1OFF_P button 16, Joystick 0, abs. btn 16 #define e_VORADFR_Off_P 0x0012 // b_VORADF2OFF_P button 17, Joystick 0, abs. btn 17 #define e_VORADFL_Off_CP 0x0013 // b_VORADF1OFF_CP button 18, Joystick 0, abs. btn 18 #define e_VORADFR_Off_CP 0x0014 // b_VORADF2OFF_CP button 19, Joystick 0, abs. btn 19#define e_20 0x0015 // b_ button 20, Joystick 0, abs. btn 20 #define e_21 0x0016 // b_ button 21, Joystick 0, abs. btn 21 #define e_22 0x0017 // b_ button 22, Joystick 0, abs. btn 22 #define e_23 0x0018 // b_ button 23, Joystick 0, abs. btn 23 #define e_LdgGear 0x0019 // b_LdgGear button 24, Joystick 0, abs. btn 24 #define e_AutoBrakeLow 0x001a // b_AutoBrkLow button 25, Joystick 0, abs. btn 25 #define e_AutoBrakeMed 0x001b // b_AutoBrkMed button 26, Joystick 0, abs. btn 26 #define e_AutoBrakeMax 0x001c // b_AutoBrkMax button 27, Joystick 0, abs. btn 27 #define e_BrakeFan 0x001d // b_BrakeFan button 28, Joystick 0, abs. btn 28 #define e_Askid_NW 0x001e // b_Askid_NW button 29, Joystick 0, abs. btn 29 #define e_30 0x001f // b_ button 30, Joystick 0, abs. btn 30 #define e_31 0x0020 // b_ button 31, Joystick 0, abs. btn 31 #define e_32 0x0080 // #define e_33 0x0081 // #define e_34 0x0082 // #define e_35 0x0083 // #define e_36 0x0084 // #define e_37 0x0085 // // Device 1 (Joystick_01) //------------------------------------------------------------------- #define e_ParkBrk 0x0100 // b_ParkBrk button 00, Joystick 1, abs. btn 32 #define e_SpdBrkArm 0x0101 // b_SpdBrkArm button 01, Joystick 1, abs. btn 33 #define e_SpdBrkUp 0x0102 // b_SpdBrkUp button 02, Joystick 1, abs. btn 34 #define e_SpdBrk1 0x0103 // b_SpdBrk1 button 03, Joystick 1, abs. btn 35 #define e_SpdBrk2 0x0104 // b_SpdBrk2 button 04, Joystick 1, abs. btn 36 #define e_SpdBrk3 0x0105 // b_SpdBrk3 button 05, Joystick 1, abs. btn 37 #define e_SpdBrk4 0x0106 // b_SpdBrk4 button 06, Joystick 1, abs. btn 38 #define e_AT_Dis 0x0107 // b_AT_Dis button 07, Joystick 1, abs. btn 39 #define e_FlapsUp 0x0108 // b_FlapsUp button 08, Joystick 1, abs. btn 40 #define e_Flaps1 0x0109 // b_Flaps1 button 09, Joystick 1, abs. btn 41 #define e_Flaps2 0x010a // b_Flaps2 button 10, Joystick 1, abs. btn 42 #define e_Flaps3 0x010b // b_Flaps3 button 11, Joystick 1, abs. btn 43 #define e_FlapsFull 0x010c // b_FlapsFull button 12, Joystick 1, abs. btn 44 #define e_45 0x010d // b_ button 13, Joystick 1, abs. btn 45 #define e_46 0x010e // b_ button 14, Joystick 1, abs. btn 46 #define e_47 0x010f // b_ button 15, Joystick 1, abs. btn 47 #define e_SPD_MACH 0x0110 // b_SPD_MACH button 16, Joystick 1, abs. btn 48 #define e_selected_SPD 0x0111 // b_selected_SPD button 17, Joystick 1, abs. btn 49 #define e_selected_HDG 0x0112 // b_selected_HDG button 18, Joystick 1, abs. btn 50 #define e_LOC 0x0113 // b_LOC button 19, Joystick 1, abs. btn 51 #define e_HDG_FPA 0x0114 // b_HDG_FPA button 20, Joystick 1, abs. btn 52 #define e_AP1 0x0115 // b_AP1 button 21, Joystick 1, abs. btn 53 #define e_AP2 0x0116 // b_AP2 button 22, Joystick 1, abs. btn 54 #define e_AT 0x0117 // b_AT button 23, Joystick 1, abs. btn 55 #define e_selected_ALT 0x0118 // b_selected_ALT button 24, Joystick 1, abs. btn 56 #define e_ALT 0x0119 // b_ALT button 25, Joystick 1, abs. btn 57 #define e_metric_ALT 0x011a // b_metric_ALT button 26, Joystick 1, abs. btn 58 #define e_range_ALT 0x011b // b_range_ALT button 27, Joystick 1, abs. btn 59 #define e_selected_VS 0x011c // b_selected_VS button 28, Joystick 1, abs. btn 60 #define e_APP 0x011d // b_APP button 29, Joystick 1, abs. btn 61 #define e_managed_HDG 0x011e // b_managed_HDG button 30, Joystick 1, abs. btn 62 #define e_managed_ALT 0x011f // b_managed_ALT button 31, Joystick 1, abs. btn 63 // Device 2 (Joystick_02) //------------------------------------------------------------------- #define e_ADFL_On_P 0x0200 // b_ADF1_P button 00, Joystick 2, abs. btn 64 #define e_VORL_On_P 0x0201 // b_VOR1_P button 01, Joystick 2, abs. btn 65 #define e_ADFR_On_P 0x0202 // b_ADF2_P button 02, Joystick 2, abs. btn 66 #define e_VORR_On_P 0x0203 // b_VOR2_P button 03, Joystick 2, abs. btn 67 #define e_LS_P 0x0204 // b_LS_P button 04, Joystick 2, abs. btn 68 #define e_FD_P_On 0x0205 // b_FD_P button 05, Joystick 2, abs. btn 69 #define e_InHg_hPa_P 0x0206 // e_Hg_hPa_P button 06, Joystick 2, abs. btn 70 #define e_BaroStd_P 0x0207 // b_BaroStd_P button 07, Joystick 2, abs. btn 71 #define e_ND_10_P 0x0208 // b_ND_10_P button 08, Joystick 2, abs. btn 72 #define e_ND_20_P 0x0209 // b_ND_20_P button 09, Joystick 2, abs. btn 73 #define e_ND_40_P 0x020a // b_ND_40_P button 10, Joystick 2, abs. btn 74 #define e_ND_80_P 0x020b // b_ND_80_P button 11, Joystick 2, abs. btn 75 #define e_ND_160_P 0x020c // b_ND_160_P button 12, Joystick 2, abs. btn 76 #define e_ND_320_P 0x020d // b_ND_320_P button 13, Joystick 2, abs. btn 77 #define e_ARPT_P 0x020e // b_ARPT_P button 14, Joystick 2, abs. btn 78 #define e_NDB_P 0x020f // b_NDB_P button 15, Joystick 2, abs. btn 79 #define e_ND_ILS_P 0x0210 // b_ND_ILS_P button 16, Joystick 2, abs. btn 80 #define e_ND_VOR_P 0x0211 // b_ND_VOR_P button 17, Joystick 2, abs. btn 81 #define e_ND_NAV_P 0x0212 // b_ND_NAV_P button 18, Joystick 2, abs. btn 82 #define e_ND_ARC_P 0x0213 // b_ND_ARC_P button 10, Joystick 2, abs. btn 83 #define e_ND_PLN_P 0x0214 // b_ND_PLN_P button 20, Joystick 2, abs. btn 84 #define e_ND_ENG_P 0x0215 // b_ND_ENG_P button 21, Joystick 2, abs. btn 85 #define e_VORD_P 0x0216 // b_VORD_P button 22, Joystick 2, abs. btn 86 #define e_WPT_P 0x0217 // b_WPT_P button 23, Joystick 2, abs. btn 87 #define e_CSTR_P 0x0218 // b_CSTR_P button 24, Joystick 2, abs. btn 88 #define e_StkPrio_P 0x0219 // b_StkPrio_P button 25, Joystick 2, abs. btn 89 #define e_MastWarn_P 0x021a // b_MastWarn_P button 26, Joystick 2, abs. btn 90 #define e_MastCaut_P 0x021b // b_MastCaut_P button 27, Joystick 2, abs. btn 91 #define e_AutoLand_P 0x021c // b_AutoLand_P button 28, Joystick 2, abs. btn 92 #define e_Chrono_P 0x021d // b_Chrono_P button 29, Joystick 2, abs. btn 93 #define e_TOGA 0x021e // b_TOGA button 30, Joystick 2, abs. btn 94 #define e_FD_P_Off 0x021f // FD Off virtual button #define e_BaroSel_P 0x0220 // b_BaroSel virtual button // Device 3 (Joystick_03) //------------------------------------------------------------------- #define e_ADFL_On_CP 0x0300 // b_ADF1_CP button 00, Joystick 3, abs. btn 96 #define e_VORL_On_CP 0x0301 // b_VOR1_CP button 01, Joystick 3, abs. btn 97 #define e_ADFR_On_CP 0x0302 // b_ADF2_CP button 02, Joystick 3, abs. btn 98 #define e_VORR_On_CP 0x0303 // b_VOR2_CP button 03, Joystick 3, abs. btn 99 #define e_LS_CP 0x0304 // b_LS_CP button 04, Joystick 3, abs. btn 100 #define e_FD_CP_On 0x0305 // b_FD_CP button 05, Joystick 3, abs. btn 101 #define e_InHg_hPa_CP 0x0306 // b_e_Hg_hPa_CP button 06, Joystick 3, abs. btn 102 #define e_BaroStd_CP 0x0307 // b_BaroStd_CP button 07, Joystick 3, abs. btn 103 #define e_ND_10_CP 0x0308 // b_ND_10_CP button 08, Joystick 3, abs. btn 104 #define e_ND_20_CP 0x0309 // b_ND_20_CP button 09, Joystick 3, abs. btn 105 #define e_ND_40_CP 0x030a // b_ND_40_CP button 10, Joystick 3, abs. btn 106 #define e_ND_80_CP 0x030b // b_ND_80_CP button 11, Joystick 3, abs. btn 107 #define e_ND_160_CP 0x030c // b_ND_160_CP button 12, Joystick 3, abs. btn 108 #define e_ND_320_CP 0x030d // b_ND_320_CP button 13, Joystick 3, abs. btn 109 #define e_ARPT_CP 0x030e // b_ARPT_CP button 14, Joystick 3, abs. btn 110 #define e_NDB_CP 0x030f // b_NDB_CP button 15, Joystick 3, abs. btn 111 #define e_ND_ILS_CP 0x0310 // b_ND_ILS_CP button 16, Joystick 3, abs. btn 112 #define e_ND_VOR_CP 0x0311 // b_ND_VOR_CP button 17, Joystick 3, abs. btn 113 #define e_ND_NAV_CP 0x0312 // b_ND_NAV_CP button 18, Joystick 3, abs. btn 114 #define e_ND_ARC_CP 0x0313 // b_ND_ARC_CP button 19, Joystick 3, abs. btn 115 #define e_ND_PLN_CP 0x0314 // b_ND_PLN_CP button 20, Joystick 3, abs. btn 116 #define e_ND_ENG_CP 0x0315 // b_ND_ENG_CP button 21, Joystick 3, abs. btn 117 #define e_VORD_CP 0x0316 // b_VORD_CP button 22, Joystick 3, abs. btn 118 #define e_WPT_CP 0x0317 // b_WPT_CP button 23, Joystick 3, abs. btn 119 #define e_CSTR_CP 0x0318 // b_CSTR_CP button 24, Joystick 3, abs. btn 120 #define e_StkPrio_CP 0x0319 // b_StkPrio_CP button 00, Joystick 3, abs. btn 121 #define e_MastWarn_CP 0x031a // b_MastWarn_CP button 01, Joystick 3, abs. btn 122 #define e_MastCaut_CP 0x031b // b_MastCaut_CP button 02, Joystick 3, abs. btn 123 #define e_AutoLand_CP 0x031c // b_AutoLand_CP button 03, Joystick 3, abs. btn 124 #define e_Chrono_CP 0x031d // b_Chrono_CP button 04, Joystick 3, abs. btn 125 #define e_managed_SPD 0x031e // b_managed_SPD (vb) button 05, Joystick 3, abs. btn 126 #define e_LevelOff_VS 0x031f // b_LevelOff_VS (vb) button 06, Joystick 3, abs. btn 127 #define e_FD_CP_Off 0x0320 // FD CP off, virtual button #define e_BaroSel_CP 0x0321 // b_BaroSel virtual button // Device 4 (Joystick_04) //------------------------------------------------------------------- #define e_CDU_LSK1L_P 0x0400 // b_CDU_LSK1L_P button 00, Joystick 4, abs. btn 128 #define e_CDU_LSK2L_P 0x0401 // b_CDU_LSK2L_P button 01, Joystick 4, abs. btn 129 #define e_CDU_LSK3L_P 0x0402 // b_CDU_LSK3L_P button 02, Joystick 4, abs. btn 130 #define e_CDU_LSK4L_P 0x0403 // b_CDU_LSK4L_P button 03, Joystick 4, abs. btn 131 #define e_CDU_LSK5L_P 0x0404 // b_CDU_LSK5L_P button 04, Joystick 4, abs. btn 132 #define e_CDU_LSK6L_P 0x0405 // b_CDU_LSK6L_P button 05, Joystick 4, abs. btn 133 #define e_CDU_ARPT_P 0x0406 // b_CDU_ARPT_P button 06, Joystick 4, abs. btn 134 #define e_CDU_DIR_P 0x0407 // b_CDU_DIR_P button 07, Joystick 4, abs. btn 135 #define e_CDU_LSK1R_P 0x0408 // b_CDU_LSK1R_P button 08, Joystick 4, abs. btn 136 #define e_CDU_LSK2R_P 0x0409 // b_CDU_LSK2R_P button 09, Joystick 4, abs. btn 137 #define e_CDU_LSK3R_P 0x040a // b_CDU_LSK2R_P button 10, Joystick 4, abs. btn 138 #define e_CDU_LSK4R_P 0x040b // b_CDU_LSK4R_P button 11, Joystick 4, abs. btn 139 #define e_CDU_LSK5R_P 0x040c // b_CDU_LSK5R_P button 12, Joystick 4, abs. btn 140 #define e_CDU_LSK6R_P 0x040d // b_CDU_LSK6R_P button 13, Joystick 4, abs. btn 141 #define e_CDU_DATA_P 0x040e // b_CDU_DATA_P button 14, Joystick 4, abs. btn 142 #define e_CDU_INIT_P 0x040f // b_CDU_INIT_P button 15, Joystick 4, abs. btn 143 #define e_CDU_PROG_P 0x0410 // b_CDU_PROG_P button 16, Joystick 4, abs. btn 144 #define e_CDU_PERF_P 0x0411 // b_CDU_PERF_P button 17, Joystick 4, abs. btn 145 #define e_CDU_NXTPG_P 0x0412 // b_CDU_NXTPG_P button 18, Joystick 4, abs. btn 146 #define e_CDU_FPLN_P 0x0413 // b_CDU_FPLN_P button 19, Joystick 4, abs. btn 147 #define e_CDU_RADNAV_P 0x0414 // b_CDU_RADNAV_P button 20, Joystick 4, abs. btn 148 #define e_CDU_FPRED_P 0x0415 // b_CDU_FPRED_P button 21, Joystick 4, abs. btn 149 #define e_CDU_SFPLN_P 0x0416 // b_CDU_SFPLN_P button 22, Joystick 4, abs. btn 150 #define e_CDU_VOID_P 0x0417 // b_CDU_VOID_P button 23, Joystick 4, abs. btn 151 #define e_CDU_MENU_P 0x0418 // b_CDU_MENU_P button 24, Joystick 4, abs. btn 152 #define e_CDU_A_P 0x0419 // b_CDU_A_P button 25, Joystick 4, abs. btn 153 #define e_CDU_B_P 0x041a // b_CDU_B_P button 26, Joystick 4, abs. btn 154 #define e_CDU_C_P 0x041b // b_CDU_C_P button 27, Joystick 4, abs. btn 155 #define e_CDU_D_P 0x041c // b_CDU_D_P button 28, Joystick 4, abs. btn 156 #define e_CDU_E_P 0x041d // b_CDU_E_P button 29, Joystick 4, abs. btn 157 #define e_CDU_F_P 0x041e // b_CDU_F_P button 30, Joystick 4, abs. btn 158 #define e_CDU_G_P 0x041f // b_CDU_G_P button 31, Joystick 4, abs. btn 159 // Device 5 (Joystick_05) //------------------------------------------------------------------- #define e_CDU_H_P 0x0500 // b_CDU_H_P button 00, Joystick 5, abs. btn 160 #define e_CDU_I_P 0x0501 // b_CDU_I_P button 01, Joystick 5, abs. btn 161 #define e_CDU_J_P 0x0502 // b_CDU_J_P button 02, Joystick 5, abs. btn 162 #define e_CDU_K_P 0x0503 // b_CDU_K_P button 03, Joystick 5, abs. btn 163 #define e_CDU_L_P 0x0504 // b_CDU_L_P button 04, Joystick 5, abs. btn 164 #define e_CDU_M_P 0x0505 // b_CDU_M_P button 05, Joystick 5, abs. btn 165 #define e_CDU_N_P 0x0506 // b_CDU_N_P button 06, Joystick 5, abs. btn 166 #define e_CDU_O_P 0x0507 // b_CDU_O_P button 07, Joystick 5, abs. btn 167 #define e_CDU_P_P 0x0508 // b_CDU_P_P button 08, Joystick 5, abs. btn 168 #define e_CDU_Q_P 0x0509 // b_CDU_Q_P button 09, Joystick 5, abs. btn 169 #define e_CDU_R_P 0x050a // b_CDU_R_P button 10, Joystick 5, abs. btn 170 #define e_CDU_S_P 0x050b // b_CDU_S_P button 11, Joystick 5, abs. btn 171 #define e_CDU_T_P 0x050c // b_CDU_T_P button 12, Joystick 5, abs. btn 172 #define e_CDU_U_P 0x050d // b_CDU_U_P button 13, Joystick 5, abs. btn 173 #define e_CDU_V_P 0x050e // b_CDU_V_P button 14, Joystick 5, abs. btn 174 #define e_CDU_W_P 0x050f // b_CDU_W_P button 15, Joystick 5, abs. btn 175 #define e_CDU_X_P 0x0510 // b_CDU_X_P button 16, Joystick 5, abs. btn 176 #define e_CDU_Y_P 0x0511 // b_CDU_Y_P button 17, Joystick 5, abs. btn 177 #define e_CDU_Z_P 0x0512 // b_CDU_Z_P button 18, Joystick 5, abs. btn 178 #define e_CDU_SLASH_P 0x0513 // b_CDU_SLASH_P button 19, Joystick 5, abs. btn 179 #define e_CDU_SPACE_P 0x0514 // b_CDU_SPACE_P button 20, Joystick 5, abs. btn 180 #define e_CDU_OVFY_P 0x0515 // b_CDU_OVFY_P button 21, Joystick 5, abs. btn 181 #define e_CDU_CLEAR_P 0x0516 // b_CDU_CLEAR_P button 22, Joystick 5, abs. btn 182 #define e_CDU_SIGN_P 0x0517 // b_CDU_SIGN_P button 23, Joystick 5, abs. btn 183 #define e_CDU_LEFT_P 0x0518 // b_CDU_LEFT_P button 24, Joystick 5, abs. btn 184 #define e_CDU_UP_P 0x0519 // b_CDU_UP_P button 25, Joystick 5, abs. btn 185 #define e_CDU_RIGHT_P 0x051a // b_CDU_RIGHT_P button 26, Joystick 5, abs. btn 186 #define e_CDU_DOWN_P 0x051b // b_CDU_DOWN_P button 27, Joystick 5, abs. btn 187 #define e_CDU_1_P 0x051c // b_CDU_1_P button 28, Joystick 5, abs. btn 188 #define e_CDU_2_P 0x051d // b_CDU_2_P button 29, Joystick 5, abs. btn 189 #define e_CDU_3_P 0x051e // b_CDU_3_P button 30, Joystick 5, abs. btn 190 #define e_CDU_4_P 0x051f // b_CDU_4_P button 31, Joystick 5, abs. btn 191 // Device 6 (Joystick_06) -> vb = virtual button //------------------------------------------------------------------- #define e_CDU_5_P 0x0600 // b_CDU_5_P button 00, Joystick 6, abs. btn 192 #define e_CDU_6_P 0x0601 // b_CDU_6_P button 01, Joystick 6, abs. btn 193 #define e_CDU_7_P 0x0602 // b_CDU_7_P button 02, Joystick 6, abs. btn 194 #define e_CDU_8_P 0x0603 // b_CDU_8_P button 03, Joystick 6, abs. btn 195 #define e_CDU_9_P 0x0604 // b_CDU_9_P button 04, Joystick 6, abs. btn 196 #define e_CDU_0_P 0x0605 // b_CDU_0_P button 05, Joystick 6, abs. btn 197 #define e_CDU_POINT_P 0x0606 // b_CDU_POINT_P button 06, Joystick 6, abs. btn 198 #define e_RMP_XFER_P 0x0607 // b_RMP_XFER_P button 07, Joystick 6, abs. btn 199 #define e_RMP_VHF1_P 0x0608 // b_RMP_VHF1_P button 08, Joystick 6, abs. btn 200 #define e_RMP_VHF2_P 0x0609 // b_RMP_VHF2_P button 09, Joystick 6, abs. btn 201 #define e_RMP_VHF3_P 0x060a // b_RMP_VHF3_P button 10, Joystick 6, abs. btn 202 #define e_RMP_HF1_P 0x060b // b_RMP_HF1_P button 11, Joystick 6, abs. btn 203 #define e_RMP_SEL_P 0x060c // b_RMP_SEL_P button 12, Joystick 6, abs. btn 204 #define e_RMP_HF2_P 0x060d // b_RMP_HF2_P button 13, Joystick 6, abs. btn 205 #define e_RMP_AM_P 0x060e // b_RMP_AM_P button 14, Joystick 6, abs. btn 206 #define e_RMP_NAV_P 0x060f // b_RMP_NAV_P button 15, Joystick 6, abs. btn 207 #define e_RMP_VOR_P 0x0610 // b_RMP_VOR_P button 16, Joystick 6, abs. btn 208 #define e_RMP_ILS_P 0x0611 // b_RMP_ILS_P button 17, Joystick 6, abs. btn 209 #define e_RMP_MLS_P 0x0612 // b_RMP_MLS_P button 18, Joystick 6, abs. btn 210 #define e_RMP_ADF_P 0x0613 // b_RMP_ADF_P button 19, Joystick 6, abs. btn 211 #define e_RMP_BFO_P 0x0614 // b_RMP_BFO_P button 20, Joystick 6, abs. btn 212 #define e_RMP_OnOff_P 0x0615 // b_RMP_OnOff_P button 21, Joystick 6, abs. btn 213 #define e_RUD_TRIM_L 0x0616 // b_RudderTrim_Left button 22, Joystick 6, abs. btn 214 #define e_RUD_TRIM_R 0x0617 // b_RudderTrim_Right button 23, Joystick 6, abs. btn 215 #define e_216 0x0618 // b_RMP_VOR_P button 16, Joystick 6, abs. btn 216 #define e_217 0x0619 // b_RMP_ILS_P button 17, Joystick 6, abs. btn 217 #define e_218 0x061a // b_RMP_MLS_P button 18, Joystick 6, abs. btn 218 #define e_219 0x061b // b_RMP_ADF_P button 19, Joystick 6, abs. btn 219 #define e_220 0x061c // b_RMP_BFO_P button 20, Joystick 6, abs. btn 220 #define e_221 0x061d // b_RMP_OnOff_P button 21, Joystick 6, abs. btn 221 #define e_222 0x061e // b_ button 22, Joystick 6, abs. btn 222 #define e_223 0x061f // b_ button 23, Joystick 6, abs. btn 223 // Device 7 (Joystick_07) //------------------------------------------------------------------- #define e_224 0x0708 // b_ button 00, Joystick 7, abs. btn 224 #define e_225 0x0709 // b_ button 01, Joystick 7, abs. btn 225 #define e_226 0x070a // b_ button 02, Joystick 7, abs. btn 226 #define e_227 0x070b // b_ button 03, Joystick 7, abs. btn 227 #define e_228 0x070c // b_ button 04, Joystick 7, abs. btn 228 #define e_229 0x070d // b_ button 05, Joystick 7, abs. btn 229 #define e_230 0x070e // b_ button 06, Joystick 7, abs. btn 230 #define e_231 0x070f // b_ button 07, Joystick 7, abs. btn 231 #define e_232 0x0708 // b_ button 08, Joystick 7, abs. btn 232 #define e_233 0x0709 // b_ button 09, Joystick 7, abs. btn 233 #define e_234 0x070a // b_ button 10, Joystick 7, abs. btn 234 #define e_235 0x070b // b_ button 11, Joystick 7, abs. btn 235 #define e_236 0x070c // b_ button 12, Joystick 7, abs. btn 236 #define e_237 0x070d // b_ button 13, Joystick 7, abs. btn 237 #define e_238 0x070e // b_ button 14, Joystick 7, abs. btn 238 #define e_239 0x070f // b_ button 15, Joystick 7, abs. btn 239 #define e_240 0x0710 // b_ button 16, Joystick 7, abs. btn 240 #define e_241 0x0711 // b_ button 17, Joystick 7, abs. btn 241 #define e_242 0x0712 // b_ button 18, Joystick 7, abs. btn 242 #define e_243 0x0713 // b_ button 19, Joystick 7, abs. btn 243 #define e_244 0x0714 // b_ button 20, Joystick 7, abs. btn 244 #define e_245 0x0715 // b_ button 21, Joystick 7, abs. btn 245 #define e_246 0x0716 // b_ button 22, Joystick 7, abs. btn 246 #define e_247 0x0717 // b_ button 23, Joystick 7, abs. btn 247 #define e_248 0x0718 // b_ button 24, Joystick 7, abs. btn 248 #define e_249 0x0719 // b_ button 25, Joystick 7, abs. btn 249 #define e_250 0x071a // b_ button 26, Joystick 7, abs. btn 250 #define e_251 0x071b // b_ button 27, Joystick 7, abs. btn 251 #define e_252 0x071c // b_ button 28, Joystick 7, abs. btn 252 #define e_253 0x071d // b_ button 29, Joystick 7, abs. btn 253 #define e_254 0x071e // b_ button 30, Joystick 7, abs. btn 254 #define e_255 0x071f // b_ button 31, Joystick 7, abs. btn 255 // Device 8 (Joystick_08) //------------------------------------------------------------------- #define e_256 0x0800 // b_ button 00, Joystick 8, abs. btn 256 #define e_257 0x0801 // b_ button 01, Joystick 8, abs. btn 257 #define e_258 0x0802 // b_ button 02, Joystick 8, abs. btn 258 #define e_259 0x0803 // b_ button 03, Joystick 8, abs. btn 259 #define e_260 0x0804 // b_ button 04, Joystick 8, abs. btn 260 #define e_261 0x0805 // b_ button 05, Joystick 8, abs. btn 261 #define e_262 0x0806 // b_ button 06, Joystick 8, abs. btn 262 #define e_263 0x0807 // b_ button 07, Joystick 8, abs. btn 263 #define e_264 0x0808 // b_ button 08, Joystick 8, abs. btn 264 #define e_265 0x0809 // b_ button 09, Joystick 8, abs. btn 265 #define e_266 0x080a // b_ button 10, Joystick 8, abs. btn 266 #define e_267 0x080b // b_ button 11, Joystick 8, abs. btn 267 #define e_268 0x080c // b_ button 12, Joystick 8, abs. btn 268 #define e_269 0x080d // b_ button 13, Joystick 8, abs. btn 269 #define e_270 0x080e // b_ button 14, Joystick 8, abs. btn 270 #define e_271 0x080f // b_ button 15, Joystick 8, abs. btn 271 #define e_272 0x0810 // b_ button 16, Joystick 8, abs. btn 272 #define e_273 0x0811 // b_ button 17, Joystick 8, abs. btn 273 #define e_274 0x0812 // b_ button 18, Joystick 8, abs. btn 274 #define e_275 0x0813 // b_ button 19, Joystick 8, abs. btn 275 #define e_276 0x0814 // b_ button 20, Joystick 8, abs. btn 276 #define e_277 0x0815 // b_ button 21, Joystick 8, abs. btn 277 #define e_278 0x0816 // b_ button 22, Joystick 8, abs. btn 278 #define e_RwyTurnOffL 0x0817 // b_ #define e_RwyTurnOffR 0x0818 // b_ #define e_NoseLight 0x0819 // b_ #define e_NoseLightTO 0x081a // b_ #define e_APUMaster 0x081b // b_ #define e_TaxiLight 0x081c // b_ #define e_SeatBeltsSignOff 0x081d // b_ #define e_SeatBeltsSignOn 0x081e // b_ #define e_NoSmokingSignOff 0x081f // b_ #define e_AnnLtTest 0x0820 // b_ // Device 9 (Joystick_09) //------------------------------------------------------------------- #define e_DomeDim 0x0900 // b_DomeDim #define e_DomeStorm 0x0901 // b_ #define e_AnnLtDim 0x0902 // b_ #define e_AnnLightTest 0x0903 // b_ #define e_EmerExitLtOff 0x0904 // b_ #define e_EmerExitLtOn 0x0905 // b_ #define e_LandLightsL 0x0906 // b_ #define e_LandLightsR 0x0907 // b_ #define e_LandLightsOutL 0x0908 // b_ #define e_LandLightsOutR 0x0909 // b_ #define e_Beacon 0x090a // b_ #define e_WingLight 0x090b // b_ #define e_LogoLight 0x090c // b_ #define e_NavLight 0x090d // b_ #define e_302 0x090e // b_ #define e_303 0x090f // b_ // Module 2. Event number is in format fMRB // // f -> constant, identifies MRB event format // M -> module number (Hexadecimal, from 0 to f // R -> row number (Hexadecimal, from 0 t0 f // B -> button number (Hexadecimal) //------------------------------------------------------------------- // Row 8 #define M2R8B0 0xf280 // Engine 1 starter switch Module 2, row 0 button 00, abs. btn 352 #define M2R8B1 0xf281 // Engine 2 starter switch Module 2, row 0 button 01, abs. btn 353 #define M2R8B2 0xf282 // Engine 3 starter switch Module 2, row 0 button 02, abs. btn 354 #define M2R8B3 0xf283 // Engine 4 starter switch Module 2, row 0 button 03, abs. btn 355 //===================================================================== // Events of expansion module 2 //===================================================================== #define e_APU_Bleed 0x0910 // B_APU_Bleed