From 2e4c313f017959a0194df2e5fd467ae11279a6ed Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Fri, 15 Oct 2021 19:32:11 +0200 Subject: [PATCH] Pack the frozen time capsule --- radio/src/storage/conversions/CMakeLists.txt | 2 + .../storage/conversions/yaml/CMakeLists.txt | 2 + radio/src/storage/conversions/yaml/bitfield.h | 88 ++ .../conversions/yaml/dataconstants_220.h | 1036 +++++++++++++++++ .../conversions/yaml/datastructs_220.h | 1021 ++++++++++++++++ .../src/storage/conversions/yaml/layout_220.h | 57 + .../storage/conversions/yaml/myeeprom_220.h | 282 +++++ .../conversions/yaml/yaml_datastructs.cpp | 69 ++ .../yaml/yaml_datastructs_funcs.cpp | 605 ++++++++++ .../yaml/yaml_datastructs_nv14.cpp | 858 ++++++++++++++ .../conversions/yaml/yaml_datastructs_t12.cpp | 831 +++++++++++++ .../conversions/yaml/yaml_datastructs_t8.cpp | 831 +++++++++++++ .../yaml/yaml_datastructs_tlite.cpp | 831 +++++++++++++ .../yaml/yaml_datastructs_tx12.cpp | 831 +++++++++++++ .../conversions/yaml/yaml_datastructs_x10.cpp | 875 ++++++++++++++ .../yaml/yaml_datastructs_x12s.cpp | 875 ++++++++++++++ .../conversions/yaml/yaml_datastructs_x7.cpp | 831 +++++++++++++ .../conversions/yaml/yaml_datastructs_x9d.cpp | 846 ++++++++++++++ .../conversions/yaml/yaml_datastructs_x9e.cpp | 886 ++++++++++++++ .../yaml/yaml_datastructs_x9lite.cpp | 816 +++++++++++++ .../yaml/yaml_datastructs_x9lites.cpp | 826 +++++++++++++ .../yaml/yaml_datastructs_xlite.cpp | 823 +++++++++++++ .../yaml/yaml_datastructs_xlites.cpp | 827 +++++++++++++ radio/src/storage/conversions/yaml/zone_220.h | 66 ++ 24 files changed, 15015 insertions(+) create mode 100644 radio/src/storage/conversions/yaml/CMakeLists.txt create mode 100644 radio/src/storage/conversions/yaml/bitfield.h create mode 100644 radio/src/storage/conversions/yaml/dataconstants_220.h create mode 100644 radio/src/storage/conversions/yaml/datastructs_220.h create mode 100644 radio/src/storage/conversions/yaml/layout_220.h create mode 100644 radio/src/storage/conversions/yaml/myeeprom_220.h create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_nv14.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_t12.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_t8.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_tlite.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_tx12.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x10.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x12s.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x7.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x9d.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x9e.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x9lite.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_x9lites.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_xlite.cpp create mode 100644 radio/src/storage/conversions/yaml/yaml_datastructs_xlites.cpp create mode 100644 radio/src/storage/conversions/yaml/zone_220.h diff --git a/radio/src/storage/conversions/CMakeLists.txt b/radio/src/storage/conversions/CMakeLists.txt index bf49d73c9..239e97983 100644 --- a/radio/src/storage/conversions/CMakeLists.txt +++ b/radio/src/storage/conversions/CMakeLists.txt @@ -7,4 +7,6 @@ if(STORAGE_CONVERSIONS) storage/conversions/conversions.cpp storage/conversions/conversions_219_220.cpp ) + + include(storage/conversions/yaml/CMakeLists.txt) endif() diff --git a/radio/src/storage/conversions/yaml/CMakeLists.txt b/radio/src/storage/conversions/yaml/CMakeLists.txt new file mode 100644 index 000000000..e089ee135 --- /dev/null +++ b/radio/src/storage/conversions/yaml/CMakeLists.txt @@ -0,0 +1,2 @@ +set(SRC ${SRC} + storage/conversions/yaml/yaml_datastructs.cpp) diff --git a/radio/src/storage/conversions/yaml/bitfield.h b/radio/src/storage/conversions/yaml/bitfield.h new file mode 100644 index 000000000..a0c753e0f --- /dev/null +++ b/radio/src/storage/conversions/yaml/bitfield.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * This file is based on work published at http://www.coranac.com/documents/working-with-bits-and-bitfields + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef BITFIELD_H +#define BITFIELD_H + +#include + +// A set of bitfield handling macros + +template +inline T bfBit(uint8_t n) +{ + return T(1) << n; +} + +#define BFBIT_SET(y, mask) ( y |= (mask) ) +#define BFBIT_CLEAR(y, mask) ( y &= ~(mask) ) +#define BFBIT_FLIP(y, mask) ( y ^= (mask) ) +#define BF_SINGLE_BIT_SET(y, i) BFBIT_SET(y, bfBit(i)) + +//! Create a bitmask of length 'len'. +template +inline T bfBitmask(uint8_t len) +{ + return bfBit(len) - 1; +} + +//! Create a bitfield mask of length 'len' starting at bit 'start'. +template +inline T bfMask(uint8_t start, uint8_t len) +{ + return bfBitmask(len) << start; +} + +//! Prepare a bitmask for insertion or combining. +template +inline T bfPrep(T x, uint8_t start, uint8_t len) +{ + return (x & bfBitmask(len)) << start; +} + +//! Extract a bitfield of length 'len' starting at bit 'start' from 'y'. +template +inline T bfGet(T y, uint8_t start, uint8_t len) +{ + return ((y)>>(start)) & bfBitmask(len); +} + +//! Insert 'len' bits of 'x 'into 'y', starting at bit 'start' from 'y'. +template +inline T bfSet(T to, T from, uint8_t start, uint8_t len) +{ + return (to & ~bfMask(start, len)) | bfPrep(from, start, len); +} + +template +inline T bfBitGet(T y, T mask) +{ + return (y & mask); +} + +template +inline T bfSingleBitGet(T y, uint8_t i) +{ + return bfBitGet(y, bfBit(i)); +} + +#endif //BITFIELD_H diff --git a/radio/src/storage/conversions/yaml/dataconstants_220.h b/radio/src/storage/conversions/yaml/dataconstants_220.h new file mode 100644 index 000000000..30c0cba2f --- /dev/null +++ b/radio/src/storage/conversions/yaml/dataconstants_220.h @@ -0,0 +1,1036 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _DATACONSTANTS_H_ +#define _DATACONSTANTS_H_ + +#include +#include + +// from board.h (taranis, horus, nv14) +#if defined(PCBNV14) + +#define STORAGE_NUM_SWITCHES 8 +#define STORAGE_NUM_POTS 5 +#define STORAGE_NUM_SLIDERS 0 +#define STORAGE_NUM_MOUSE_ANALOGS 0 + +#elif defined(PCBHORUS) + +#define STORAGE_NUM_SWITCHES 10 +#define STORAGE_NUM_POTS 5 +#define STORAGE_NUM_SLIDERS 4 +#define STORAGE_NUM_MOUSE_ANALOGS 2 + +#elif defined(PCBTARANIS) + +#if defined(PCBX9LITE) + // #define NUM_POTS 1 + // #define NUM_SLIDERS 0 + #define STORAGE_NUM_POTS 1 + #define STORAGE_NUM_SLIDERS 0 +#elif defined(RADIO_T8) || defined(RADIO_TLITE) + // #define NUM_POTS 0 + // #define NUM_SLIDERS 0 + #define STORAGE_NUM_POTS 2 + #define STORAGE_NUM_SLIDERS 0 +#elif defined(PCBXLITE) || defined(PCBX7) + // #define NUM_POTS 2 + // #define NUM_SLIDERS 0 + #define STORAGE_NUM_POTS 2 + #define STORAGE_NUM_SLIDERS 0 +#elif defined(PCBX9E) + // #define NUM_POTS 4 + // #define NUM_SLIDERS 4 + #define STORAGE_NUM_POTS 4 + #define STORAGE_NUM_SLIDERS 4 +#elif defined(PCBX9DP) + // #define NUM_POTS 3 + // #define NUM_SLIDERS 2 + #define STORAGE_NUM_POTS 3 + #define STORAGE_NUM_SLIDERS 2 +#else + // #define NUM_POTS 3 // TODO X9D has only 2 pots + // #define NUM_SLIDERS 2 + #define STORAGE_NUM_POTS 3 + #define STORAGE_NUM_SLIDERS 2 +#endif + +// #define NUM_XPOTS STORAGE_NUM_POTS +// #define NUM_TRIMS 4 +// #define NUM_MOUSE_ANALOGS 0 +#define STORAGE_NUM_MOUSE_ANALOGS 0 + +#if defined(PCBXLITES) || defined(PCBXLITE) +#define STORAGE_NUM_SWITCHES 6 +#elif defined(RADIO_TLITE) || defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_TX12) || defined(RADIO_T8) || defined(PCBX7ACCESS) || defined(PCBX7) +#define STORAGE_NUM_SWITCHES 8 +#elif defined(PCBX9LITES) +#define STORAGE_NUM_SWITCHES 7 +#elif defined(PCBX9LITE) +#define STORAGE_NUM_SWITCHES 5 +#elif defined(PCBX9E) +#define STORAGE_NUM_SWITCHES 18 +#elif defined(RADIO_X9DP2019) || defined(PCBX9D) || defined(PCBX9DP) +#define STORAGE_NUM_SWITCHES 9 +#endif + +#else +#error "Unsupported board" +#endif + +#define STORAGE_NUM_SWITCHES_POSITIONS (STORAGE_NUM_SWITCHES * 3) + +#define NUM_STICKS 4 + +#if defined(PCBHORUS) +#define NUM_TRIMS 6 +#else +#define NUM_TRIMS 4 +#endif + +#define LUA_EXPORT(...) +#define LUA_EXPORT_MULTIPLE(...) +#define LUA_EXPORT_EXTRA(...) + +#if defined(PCBHORUS) || defined(PCBNV14) + #define MAX_MODELS 60 + #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32 + #define MAX_FLIGHT_MODES 9 + #define MAX_MIXERS 64 + #define MAX_EXPOS 64 + #define MAX_LOGICAL_SWITCHES 64 + #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches + #define MAX_SCRIPTS 9 + #define MAX_INPUTS 32 + #define MIN_TRAINER_CHANNELS 4 + #define DEF_TRAINER_CHANNELS 8 + #define MAX_TRAINER_CHANNELS 16 + #define MAX_TELEMETRY_SENSORS 60 + #define MAX_CUSTOM_SCREENS 5 +#elif defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) + #define MAX_MODELS 60 + #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32 + #define MAX_FLIGHT_MODES 9 + #define MAX_MIXERS 64 + #define MAX_EXPOS 64 + #define MAX_LOGICAL_SWITCHES 64 + #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches + #define MAX_SCRIPTS 7 + #define MAX_INPUTS 32 + #define MIN_TRAINER_CHANNELS 4 + #define DEF_TRAINER_CHANNELS 8 + #define MAX_TRAINER_CHANNELS 16 + #define MAX_TELEMETRY_SENSORS 60 +#elif defined(PCBTARANIS) + #define MAX_MODELS 60 + #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32 + #define MAX_FLIGHT_MODES 9 + #define MAX_MIXERS 64 + #define MAX_EXPOS 64 + #define MAX_LOGICAL_SWITCHES 64 + #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches + #define MAX_SCRIPTS 7 + #define MAX_INPUTS 32 + #define MIN_TRAINER_CHANNELS 4 + #define DEF_TRAINER_CHANNELS 8 + #define MAX_TRAINER_CHANNELS 16 + #define MAX_TELEMETRY_SENSORS 40 +#else + #warning "Unknown board!" +#endif + +#define MAX_TIMERS 3 +#define NUM_CAL_PPM 4 + +enum CurveType { + CURVE_TYPE_STANDARD, + CURVE_TYPE_CUSTOM, + CURVE_TYPE_LAST = CURVE_TYPE_CUSTOM +}; + +#define MIN_POINTS_PER_CURVE 3 +#define MAX_POINTS_PER_CURVE 17 + +#if defined(PCBHORUS) || defined(PCBNV14) + #define LEN_MODEL_NAME 15 + #define LEN_TIMER_NAME 8 + #define LEN_FLIGHT_MODE_NAME 10 + #define LEN_BITMAP_NAME 14 + #define LEN_EXPOMIX_NAME 6 + #define LEN_CHANNEL_NAME 6 + #define LEN_INPUT_NAME 4 + #define LEN_CURVE_NAME 3 + #define LEN_FUNCTION_NAME 6 + #define MAX_CURVES 32 + #define MAX_CURVE_POINTS 512 +#elif LCD_W == 212 + #define LEN_MODEL_NAME 12 + #define LEN_TIMER_NAME 8 + #define LEN_FLIGHT_MODE_NAME 10 + #define LEN_BITMAP_NAME 10 + #define LEN_EXPOMIX_NAME 6 + #define LEN_CHANNEL_NAME 6 + #define LEN_INPUT_NAME 4 + #define LEN_CURVE_NAME 3 + #define LEN_FUNCTION_NAME 8 + #define MAX_CURVES 32 + #define MAX_CURVE_POINTS 512 +#else + #define LEN_MODEL_NAME 10 + #define LEN_TIMER_NAME 3 + #define LEN_FLIGHT_MODE_NAME 6 + #define LEN_EXPOMIX_NAME 6 + #define LEN_CHANNEL_NAME 4 + #define LEN_INPUT_NAME 3 + #define LEN_CURVE_NAME 3 + #define LEN_FUNCTION_NAME 6 + #define MAX_CURVES 32 + #define MAX_CURVE_POINTS 512 +#endif + +#if defined(PCBFRSKY) || defined(PCBNV14) + #define NUM_MODULES 2 +#else + #define NUM_MODULES 1 +#endif + +#define XPOTS_MULTIPOS_COUNT 6 + +#if defined(COLORLCD) +enum MainViews { + VIEW_BLANK, + VIEW_TIMERS_ALTITUDE, + VIEW_CHANNELS, + VIEW_TELEM1, + VIEW_TELEM2, + VIEW_TELEM3, + VIEW_TELEM4, + VIEW_COUNT +}; +#elif LCD_W >= 212 +enum MainViews { + VIEW_TIMERS, + VIEW_INPUTS, + VIEW_SWITCHES, + VIEW_COUNT +}; +#else +enum MainViews { + VIEW_OUTPUTS_VALUES, + VIEW_OUTPUTS_BARS, + VIEW_INPUTS, + VIEW_TIMER2, + VIEW_CHAN_MONITOR, + VIEW_COUNT +}; +#endif + +enum BeeperMode { + e_mode_quiet = -2, + e_mode_alarms, + e_mode_nokeys, + e_mode_all +}; + +#if defined(PCBFRSKY) || defined(PCBNV14) +enum ModuleIndex { + INTERNAL_MODULE, + EXTERNAL_MODULE, + SPORT_MODULE +}; + +enum TrainerMode { +#if defined(PCBNV14) + TRAINER_MODE_OFF, +#endif + TRAINER_MODE_MASTER_TRAINER_JACK, + TRAINER_MODE_SLAVE, +#if defined(PCBTARANIS) || defined(PCBNV14) + TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE, + TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE, +#endif +#if defined(PCBTARANIS) || defined(AUX_SERIAL) || defined(AUX2_SERIAL) + TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, +#endif + TRAINER_MODE_MASTER_BLUETOOTH, + TRAINER_MODE_SLAVE_BLUETOOTH, + TRAINER_MODE_MULTI, +}; +#endif + +#define TRAINER_MODE_MIN() TRAINER_MODE_MASTER_TRAINER_JACK + +#if !defined(HARDWARE_EXTERNAL_MODULE) + #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE +#elif defined(RADIO_T16) && !defined(INTERNAL_MODULE_MULTI) +#if defined(BLUETOOTH) + #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH +#else + #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE +#endif +#elif defined(INTERNAL_MODULE_MULTI) || defined(ALLOW_TRAINER_MULTI) + #define TRAINER_MODE_MAX() TRAINER_MODE_MULTI +#elif defined(BLUETOOTH) + #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH +#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBNV14) + #define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE +#elif defined(PCBTARANIS) + #define TRAINER_MODE_MAX() (IS_TRAINER_AUX_SERIAL() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE) +#else + #define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_BATTERY_COMPARTMENT +#endif + +#if defined(HARDWARE_INTERNAL_MODULE) + #define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE) +#else + #define IS_INTERNAL_MODULE_ENABLED() (false) +#endif + +#define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE) + +#if defined(HARDWARE_INTERNAL_MODULE) + #define IS_MODULE_ENABLED(moduleIdx) (moduleIdx==INTERNAL_MODULE ? IS_INTERNAL_MODULE_ENABLED() : moduleIdx==EXTERNAL_MODULE ? IS_EXTERNAL_MODULE_ENABLED() : false) +#else + #define IS_MODULE_ENABLED(moduleIdx) (moduleIdx==EXTERNAL_MODULE ? IS_EXTERNAL_MODULE_ENABLED() : false) +#endif + +enum UartModes { +#if defined(CLI) || defined(DEBUG) + UART_MODE_DEBUG, +#else + UART_MODE_NONE, +#endif + UART_MODE_TELEMETRY_MIRROR, + UART_MODE_TELEMETRY, + UART_MODE_SBUS_TRAINER, + UART_MODE_LUA, + UART_MODE_COUNT, + UART_MODE_MAX = UART_MODE_COUNT-1 +}; + +#define LEN_SWITCH_NAME 3 +#define LEN_ANA_NAME 3 +#define LEN_MODEL_FILENAME 16 +#define LEN_BLUETOOTH_NAME 10 + +enum TelemetryProtocol +{ + PROTOCOL_TELEMETRY_FIRST, + PROTOCOL_TELEMETRY_FRSKY_SPORT = PROTOCOL_TELEMETRY_FIRST, + PROTOCOL_TELEMETRY_FRSKY_D, + PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY, + PROTOCOL_TELEMETRY_CROSSFIRE, + PROTOCOL_TELEMETRY_SPEKTRUM, + PROTOCOL_TELEMETRY_FLYSKY_IBUS, + PROTOCOL_TELEMETRY_HITEC, + PROTOCOL_TELEMETRY_HOTT, + PROTOCOL_TELEMETRY_MLINK, + PROTOCOL_TELEMETRY_MULTIMODULE, + PROTOCOL_TELEMETRY_AFHDS3, + PROTOCOL_TELEMETRY_GHOST, + PROTOCOL_TELEMETRY_FLYSKY_NV14, + PROTOCOL_TELEMETRY_LAST=PROTOCOL_TELEMETRY_FLYSKY_NV14, + PROTOCOL_TELEMETRY_LUA +}; + +#define TELEM_LABEL_LEN 4 +enum TelemetryUnit { + UNIT_RAW, + UNIT_VOLTS, + UNIT_AMPS, + UNIT_MILLIAMPS, + UNIT_KTS, + UNIT_METERS_PER_SECOND, + UNIT_FEET_PER_SECOND, + UNIT_KMH, + UNIT_SPEED = UNIT_KMH, + UNIT_MPH, + UNIT_METERS, + UNIT_DIST = UNIT_METERS, + UNIT_FEET, + UNIT_CELSIUS, + UNIT_TEMPERATURE = UNIT_CELSIUS, + UNIT_FAHRENHEIT, + UNIT_PERCENT, + UNIT_MAH, + UNIT_WATTS, + UNIT_MILLIWATTS, + UNIT_DB, + UNIT_RPMS, + UNIT_G, + UNIT_DEGREE, + UNIT_RADIANS, + UNIT_MILLILITERS, + UNIT_FLOZ, + UNIT_MILLILITERS_PER_MINUTE, + UNIT_HERTZ, + UNIT_MS, + UNIT_US, + UNIT_KM, + UNIT_MAX = UNIT_KM, + UNIT_SPARE5, + UNIT_SPARE6, + UNIT_SPARE7, + UNIT_SPARE8, + UNIT_SPARE9, + UNIT_SPARE10, + UNIT_HOURS, + UNIT_MINUTES, + UNIT_SECONDS, + // FrSky format used for these fields, could be another format in the future + UNIT_FIRST_VIRTUAL, + UNIT_CELLS = UNIT_FIRST_VIRTUAL, + UNIT_DATETIME, + UNIT_GPS, + UNIT_BITFIELD, + UNIT_TEXT, + // Internal units (not stored in sensor unit) + UNIT_GPS_LONGITUDE, + UNIT_GPS_LATITUDE, + UNIT_DATETIME_YEAR, + UNIT_DATETIME_DAY_MONTH, + UNIT_DATETIME_HOUR_MIN, + UNIT_DATETIME_SEC +}; + +#if LCD_W >= 212 + #define NUM_LINE_ITEMS 3 +#else + #define NUM_LINE_ITEMS 2 +#endif + +#if defined(PCBTARANIS) + #define MAX_TELEM_SCRIPT_INPUTS 8 +#endif + +enum TelemetryScreenType { + TELEMETRY_SCREEN_TYPE_NONE, + TELEMETRY_SCREEN_TYPE_VALUES, + TELEMETRY_SCREEN_TYPE_BARS, + TELEMETRY_SCREEN_TYPE_SCRIPT, +#if defined(LUA) + TELEMETRY_SCREEN_TYPE_MAX = TELEMETRY_SCREEN_TYPE_SCRIPT +#else + TELEMETRY_SCREEN_TYPE_MAX = TELEMETRY_SCREEN_TYPE_BARS +#endif +}; +#define MAX_TELEMETRY_SCREENS 4 +#define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.screensType >> (2*(screenIndex))) & 0x03) +#define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_BARS) + +constexpr int16_t FAILSAFE_CHANNEL_HOLD = 2000; +constexpr int16_t FAILSAFE_CHANNEL_NOPULSE = 2001; + +#define LEN_SCRIPT_FILENAME 6 +#define LEN_SCRIPT_NAME 6 +#define MAX_SCRIPT_INPUTS 6 +#define MAX_SCRIPT_OUTPUTS 6 + +enum PotsWarnMode { + POTS_WARN_OFF, + POTS_WARN_MANUAL, + POTS_WARN_AUTO +}; + +#define LEN_GVAR_NAME 3 +#define GVAR_MAX 1024 +#define GVAR_MIN -GVAR_MAX + +#define RESERVE_RANGE_FOR_GVARS 10 +// even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc. + +#define MAX_GVARS 9 + +enum SwitchSources { + SWSRC_NONE = 0, + + SWSRC_FIRST_SWITCH SKIP, + +#if defined(STORAGE_SWITCH_A) + SWSRC_SA0 = SWSRC_FIRST_SWITCH, + SWSRC_SA1, + SWSRC_SA2, +#endif + +#if defined(STORAGE_SWITCH_B) + SWSRC_SB0, + SWSRC_SB1, + SWSRC_SB2, +#endif + +#if defined(STORAGE_SWITCH_C) + SWSRC_SC0, + SWSRC_SC1, + SWSRC_SC2, +#endif + +#if defined(STORAGE_SWITCH_D) + SWSRC_SD0, + SWSRC_SD1, + SWSRC_SD2, +#endif + +#if defined(STORAGE_SWITCH_E) + SWSRC_SE0, + SWSRC_SE1, + SWSRC_SE2, +#endif + +#if defined(STORAGE_SWITCH_F) + SWSRC_SF0, + SWSRC_SF1, + SWSRC_SF2, +#endif + +#if defined(STORAGE_SWITCH_G) + SWSRC_SG0, + SWSRC_SG1, + SWSRC_SG2, +#endif + +#if defined(STORAGE_SWITCH_H) + SWSRC_SH0, + SWSRC_SH1, + SWSRC_SH2, +#endif + +#if defined(STORAGE_SWITCH_I) + SWSRC_SI0, + SWSRC_SI1, + SWSRC_SI2, +#endif + +#if defined(STORAGE_SWITCH_J) + SWSRC_SJ0, + SWSRC_SJ1, + SWSRC_SJ2, +#endif + +#if defined(STORAGE_SWITCH_K) + SWSRC_SK0, + SWSRC_SK1, + SWSRC_SK2, +#endif + +#if defined(STORAGE_SWITCH_L) + SWSRC_SL0, + SWSRC_SL1, + SWSRC_SL2, +#endif + +#if defined(STORAGE_SWITCH_M) + SWSRC_SM0, + SWSRC_SM1, + SWSRC_SM2, +#endif + +#if defined(STORAGE_SWITCH_N) + SWSRC_SN0, + SWSRC_SN1, + SWSRC_SN2, +#endif + +#if defined(STORAGE_SWITCH_O) + SWSRC_SO0, + SWSRC_SO1, + SWSRC_SO2, +#endif + +#if defined(STORAGE_SWITCH_P) + SWSRC_SP0, + SWSRC_SP1, + SWSRC_SP2, +#endif + +#if defined(STORAGE_SWITCH_Q) + SWSRC_SQ0, + SWSRC_SQ1, + SWSRC_SQ2, +#endif + +#if defined(STORAGE_SWITCH_R) + SWSRC_SR0, + SWSRC_SR1, + SWSRC_SR2, +#endif + + SWSRC_LAST_SWITCH SKIP = SWSRC_FIRST_SWITCH + STORAGE_NUM_SWITCHES_POSITIONS - 1, + +#if NUM_XPOTS > 0 + SWSRC_FIRST_MULTIPOS_SWITCH SKIP, + SWSRC_LAST_MULTIPOS_SWITCH SKIP = SWSRC_FIRST_MULTIPOS_SWITCH + (NUM_XPOTS * XPOTS_MULTIPOS_COUNT) - 1, +#endif + + SWSRC_FIRST_TRIM SKIP, + SWSRC_TrimRudLeft = SWSRC_FIRST_TRIM, + SWSRC_TrimRudRight, + SWSRC_TrimEleDown, + SWSRC_TrimEleUp, + +#if NUM_TRIMS > 2 + SWSRC_TrimThrDown, + SWSRC_TrimThrUp, + SWSRC_TrimAilLeft, + SWSRC_TrimAilRight, +#endif + +#if NUM_TRIMS > 4 + SWSRC_TrimT5Down, + SWSRC_TrimT5Up, + SWSRC_TrimT6Down, + SWSRC_TrimT6Up, +#endif + + SWSRC_FIRST_LOGICAL_SWITCH SKIP, + SWSRC_SW1 = SWSRC_FIRST_LOGICAL_SWITCH, + SWSRC_SW2, + // ... + SWSRC_LAST_LOGICAL_SWITCH SKIP = SWSRC_FIRST_LOGICAL_SWITCH+MAX_LOGICAL_SWITCHES-1, + + SWSRC_ON, + SWSRC_ONE, + + SWSRC_FIRST_FLIGHT_MODE SKIP, + SWSRC_LAST_FLIGHT_MODE SKIP = SWSRC_FIRST_FLIGHT_MODE+MAX_FLIGHT_MODES-1, + + SWSRC_TELEMETRY_STREAMING, + + SWSRC_FIRST_SENSOR SKIP, + SWSRC_LAST_SENSOR SKIP = SWSRC_FIRST_SENSOR+MAX_TELEMETRY_SENSORS-1, + + SWSRC_RADIO_ACTIVITY, + +#if defined(DEBUG_LATENCY) + SWSRC_LATENCY_TOGGLE, +#endif + + SWSRC_COUNT SKIP, + + SWSRC_OFF = -SWSRC_ON, + + SWSRC_LAST SKIP = SWSRC_COUNT-1, + SWSRC_FIRST SKIP = -SWSRC_LAST, + + SWSRC_LAST_IN_LOGICAL_SWITCHES SKIP = SWSRC_COUNT-1, + SWSRC_LAST_IN_MIXES SKIP = SWSRC_COUNT-1, + + SWSRC_FIRST_IN_LOGICAL_SWITCHES SKIP = -SWSRC_LAST_IN_LOGICAL_SWITCHES, + SWSRC_FIRST_IN_MIXES SKIP = -SWSRC_LAST_IN_MIXES, + + SWSRC_INVERT SKIP = SWSRC_COUNT+1, +}; + +#if NUM_SWITCHES >= 8 + #define SWSRC_TRAINER SWSRC_SH2 +#else + #define SWSRC_TRAINER SWSRC_LAST_SWITCH, +#endif + +#define SWSRC_LAST_TRIM (SWSRC_FIRST_TRIM + 2 * NUM_TRIMS - 1) + +enum MixSources { + MIXSRC_NONE, + + MIXSRC_FIRST_INPUT SKIP, LUA_EXPORT_MULTIPLE("input", "Input [I%d]", MAX_INPUTS) + MIXSRC_LAST_INPUT SKIP = MIXSRC_FIRST_INPUT+MAX_INPUTS-1, + +#if defined(LUA_INPUTS) + MIXSRC_FIRST_LUA SKIP, LUA_EXPORT_MULTIPLE("lua", "Lua mix output %d", MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS) + MIXSRC_LAST_LUA SKIP = MIXSRC_FIRST_LUA+(MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS)-1, +#endif + + MIXSRC_FIRST_STICK SKIP, + MIXSRC_Rud = MIXSRC_FIRST_STICK, LUA_EXPORT("rud", "Rudder") + MIXSRC_Ele, LUA_EXPORT("ele", "Elevator") + MIXSRC_Thr, LUA_EXPORT("thr", "Throttle") + MIXSRC_Ail, LUA_EXPORT("ail", "Aileron") + + MIXSRC_LAST_STICK SKIP = MIXSRC_Ail, + MIXSRC_FIRST_POT SKIP, +#if defined(PCBHORUS) + MIXSRC_S1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer S1") + MIXSRC_6POS, LUA_EXPORT("6pos", "Multipos Switch") + MIXSRC_S2, LUA_EXPORT("s2", "Potentiometer S2") +#if defined(PCBX10) + MIXSRC_EXT1, LUA_EXPORT("ext1", "Ext 1") + MIXSRC_EXT2, LUA_EXPORT("ext2", "Ext 2") +#if defined(FLYSKY_HALL_STICKS) && defined(FLYSKY_HALL_STICKS_EXT3_EXT4) + MIXSRC_EXT3, LUA_EXPORT("ext3", "Ext 3") + MIXSRC_EXT4, LUA_EXPORT("ext4", "Ext 4") +#endif +#endif + MIXSRC_FIRST_SLIDER SKIP, +#if defined(PCBX12S) + MIXSRC_S3 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("s3", "Slider S3") + MIXSRC_S4, LUA_EXPORT("s4", "Slider S4") + MIXSRC_LS, LUA_EXPORT("ls", "Left rear slider") + MIXSRC_RS, LUA_EXPORT("rs", "Right rear slider") +#else + MIXSRC_LS = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider") + MIXSRC_RS, LUA_EXPORT("rs", "Right slider") +#endif + MIXSRC_LAST_POT SKIP = MIXSRC_RS, +#elif defined(PCBX9E) + MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1") + MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2") + MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3") + MIXSRC_POT4, LUA_EXPORT("s4", "Potentiometer 4 (X9E only)") + MIXSRC_FIRST_SLIDER SKIP, + MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider") + MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider") + MIXSRC_SLIDER3, LUA_EXPORT("lcs", "Left center slider (X9E only)") + MIXSRC_SLIDER4, LUA_EXPORT("rcs", "Right center slider (X9E only)") + MIXSRC_LAST_POT SKIP = MIXSRC_SLIDER4, +#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBNV14) + MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1") + MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2") + MIXSRC_FIRST_SLIDER SKIP = MIXSRC_POT2, + MIXSRC_LAST_POT SKIP = MIXSRC_POT2, +#elif defined(PCBX9LITE) + MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1") + MIXSRC_FIRST_SLIDER SKIP = MIXSRC_POT1, + MIXSRC_LAST_POT SKIP = MIXSRC_POT1, +#elif defined(PCBTARANIS) + MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1") + MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2") + MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3") + MIXSRC_FIRST_SLIDER SKIP, + MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider") + MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider") + MIXSRC_LAST_POT SKIP = MIXSRC_SLIDER2, +#else + MIXSRC_P1 = MIXSRC_FIRST_POT, + MIXSRC_P2, + MIXSRC_P3, + MIXSRC_LAST_POT SKIP = MIXSRC_P3, +#endif + +#if defined(PCBHORUS) + MIXSRC_MOUSE1, LUA_EXPORT("jsx", "Joystick X") + MIXSRC_MOUSE2, LUA_EXPORT("jsy", "Joystick Y") +#endif + +#if defined(GYRO) + MIXSRC_GYRO1, LUA_EXPORT("gyrx", "Gyro X") + MIXSRC_GYRO2, LUA_EXPORT("gyry", "Gyro Y") +#endif + + MIXSRC_MAX, LUA_EXPORT("max", "MAX") + + MIXSRC_FIRST_HELI SKIP, + MIXSRC_CYC1 = MIXSRC_FIRST_HELI, LUA_EXPORT("cyc1", "Cyclic 1") + MIXSRC_CYC2, LUA_EXPORT("cyc2", "Cyclic 2") + MIXSRC_CYC3, LUA_EXPORT("cyc3", "Cyclic 3") + MIXSRC_LAST_HELI SKIP = MIXSRC_CYC3, + + MIXSRC_FIRST_TRIM SKIP, + MIXSRC_TrimRud = MIXSRC_FIRST_TRIM, LUA_EXPORT("trim-rud", "Rudder trim") + MIXSRC_TrimEle, LUA_EXPORT("trim-ele", "Elevator trim") + MIXSRC_TrimThr, LUA_EXPORT("trim-thr", "Throttle trim") + MIXSRC_TrimAil, LUA_EXPORT("trim-ail", "Aileron trim") +#if defined(PCBHORUS) + MIXSRC_TrimT5, LUA_EXPORT("trim-t5", "Aux trim T5") + MIXSRC_TrimT6, LUA_EXPORT("trim-t6", "Aux trim T6") + MIXSRC_LAST_TRIM SKIP = MIXSRC_TrimT6, +#else + MIXSRC_LAST_TRIM SKIP = MIXSRC_TrimAil, +#endif + + MIXSRC_FIRST_SWITCH SKIP, + +#if defined(HARDWARE_SWITCH_A) + MIXSRC_SA = MIXSRC_FIRST_SWITCH, LUA_EXPORT("sa", "Switch A") + MIXSRC_SB, LUA_EXPORT("sb", "Switch B") + MIXSRC_SC, LUA_EXPORT("sc", "Switch C") +#endif +#if defined(HARDWARE_SWITCH_D) + MIXSRC_SD, LUA_EXPORT("sd", "Switch D") +#elif defined(STORAGE_SWITCH_D) + MIXSRC_SD, +#endif +#if defined(HARDWARE_SWITCH_E) + MIXSRC_SE, LUA_EXPORT("se", "Switch E") +#elif defined(STORAGE_SWITCH_E) + MIXSRC_SE, +#endif +#if defined(HARDWARE_SWITCH_F) + MIXSRC_SF, LUA_EXPORT("sf", "Switch F") +#elif defined(STORAGE_SWITCH_F) + MIXSRC_SF, +#endif +#if defined(HARDWARE_SWITCH_G) + MIXSRC_SG, LUA_EXPORT("sg", "Switch G") +#elif defined(STORAGE_SWITCH_G) + MIXSRC_SG, +#endif +#if defined(HARDWARE_SWITCH_H) + MIXSRC_SH, LUA_EXPORT("sh", "Switch H") +#elif defined(STORAGE_SWITCH_H) + MIXSRC_SH, +#endif +#if defined(HARDWARE_SWITCH_I) + MIXSRC_SI, LUA_EXPORT("si", "Switch I") +#elif defined(STORAGE_SWITCH_I) + MIXSRC_SI, +#endif +#if defined(HARDWARE_SWITCH_J) + MIXSRC_SJ, LUA_EXPORT("sj", "Switch J") +#elif defined(STORAGE_SWITCH_J) + MIXSRC_SJ, +#endif +#if defined(HARDWARE_SWITCH_K) + MIXSRC_SK, LUA_EXPORT("sk", "Switch K") + MIXSRC_SL, LUA_EXPORT("sl", "Switch L") + MIXSRC_SM, LUA_EXPORT("sm", "Switch M") + MIXSRC_SN, LUA_EXPORT("sn", "Switch N") + MIXSRC_SO, LUA_EXPORT("so", "Switch O") + MIXSRC_SP, LUA_EXPORT("sp", "Switch P") + MIXSRC_SQ, LUA_EXPORT("sq", "Switch Q") + MIXSRC_SR, LUA_EXPORT("sr", "Switch R") +#endif + MIXSRC_FIRST_LOGICAL_SWITCH SKIP, + MIXSRC_SW1 = MIXSRC_FIRST_LOGICAL_SWITCH, LUA_EXPORT_MULTIPLE("ls", "Logical switch L%d", MAX_LOGICAL_SWITCHES) + MIXSRC_LAST_LOGICAL_SWITCH SKIP = MIXSRC_FIRST_LOGICAL_SWITCH+MAX_LOGICAL_SWITCHES-1, + + MIXSRC_FIRST_TRAINER SKIP, LUA_EXPORT_MULTIPLE("trn", "Trainer input %d", MAX_TRAINER_CHANNELS) + MIXSRC_LAST_TRAINER SKIP = MIXSRC_FIRST_TRAINER+MAX_TRAINER_CHANNELS-1, + + MIXSRC_FIRST_CH SKIP, + MIXSRC_CH1 = MIXSRC_FIRST_CH, LUA_EXPORT_MULTIPLE("ch", "Channel CH%d", MAX_OUTPUT_CHANNELS) + MIXSRC_CH2, + MIXSRC_CH3, + MIXSRC_CH4, + MIXSRC_CH5, + MIXSRC_CH6, + MIXSRC_CH7, + MIXSRC_CH8, + MIXSRC_CH9, + MIXSRC_CH10, + MIXSRC_CH11, + MIXSRC_CH12, + MIXSRC_CH13, + MIXSRC_CH14, + MIXSRC_CH15, + MIXSRC_CH16, + MIXSRC_LAST_CH SKIP = MIXSRC_CH1+MAX_OUTPUT_CHANNELS-1, + + MIXSRC_FIRST_GVAR SKIP, + MIXSRC_GVAR1 = MIXSRC_FIRST_GVAR, LUA_EXPORT_MULTIPLE("gvar", "Global variable %d", MAX_GVARS) + MIXSRC_LAST_GVAR SKIP = MIXSRC_FIRST_GVAR+MAX_GVARS-1, + + MIXSRC_TX_VOLTAGE, LUA_EXPORT("tx-voltage", "Transmitter battery voltage [volts]") + MIXSRC_TX_TIME, LUA_EXPORT("clock", "RTC clock [minutes from midnight]") + MIXSRC_TX_GPS, + MIXSRC_FIRST_RESERVE SKIP, + MIXSRC_RESERVE3 SKIP, + MIXSRC_RESERVE4 SKIP, + MIXSRC_LAST_RESERVE SKIP, + MIXSRC_FIRST_TIMER SKIP, + MIXSRC_TIMER1 = MIXSRC_FIRST_TIMER, LUA_EXPORT("timer1", "Timer 1 value [seconds]") + MIXSRC_TIMER2, LUA_EXPORT("timer2", "Timer 2 value [seconds]") + MIXSRC_TIMER3, LUA_EXPORT("timer3", "Timer 3 value [seconds]") + MIXSRC_LAST_TIMER SKIP = MIXSRC_TIMER3, + + MIXSRC_FIRST_TELEM SKIP, LUA_EXPORT_MULTIPLE("telem", "Telemetry sensor %d", MAX_TELEMETRY_SENSORS) + MIXSRC_LAST_TELEM SKIP = MIXSRC_FIRST_TELEM+3*MAX_TELEMETRY_SENSORS-1 +}; + +#if defined(__cplusplus) +static_assert(MIXSRC_FIRST_LOGICAL_SWITCH == MIXSRC_FIRST_SWITCH + STORAGE_NUM_SWITCHES, "Wrong switches definition in MIXSRC list"); +#endif + +#define MIXSRC_FIRST (MIXSRC_NONE + 1) +#define MIXSRC_LAST MIXSRC_LAST_CH +#define MIXSRC_LAST_SWITCH (MIXSRC_FIRST_SWITCH + STORAGE_NUM_SWITCHES - 1) +#define INPUTSRC_FIRST MIXSRC_Rud +#define INPUTSRC_LAST MIXSRC_LAST_TELEM + +enum BacklightMode { + e_backlight_mode_off = 0, + e_backlight_mode_keys = 1, + e_backlight_mode_sticks = 2, + e_backlight_mode_all = e_backlight_mode_keys+e_backlight_mode_sticks, + e_backlight_mode_on +}; + +enum Functions { + // first the functions which need a checkbox + FUNC_OVERRIDE_CHANNEL, + FUNC_TRAINER, + FUNC_INSTANT_TRIM, + FUNC_RESET, + FUNC_SET_TIMER, + FUNC_ADJUST_GVAR, + FUNC_VOLUME, + FUNC_SET_FAILSAFE, + FUNC_RANGECHECK, + FUNC_BIND, + // then the other functions + FUNC_FIRST_WITHOUT_ENABLE, + FUNC_PLAY_SOUND = FUNC_FIRST_WITHOUT_ENABLE, + FUNC_PLAY_TRACK, + FUNC_PLAY_VALUE, + FUNC_RESERVE4, + FUNC_PLAY_SCRIPT, + FUNC_RESERVE5, + FUNC_BACKGND_MUSIC, + FUNC_BACKGND_MUSIC_PAUSE, + FUNC_VARIO, + FUNC_HAPTIC, + FUNC_LOGS, + FUNC_BACKLIGHT, + FUNC_SCREENSHOT, + FUNC_RACING_MODE, +#if defined(DEBUG) + FUNC_TEST, // should remain the last before MAX as not added in Companion +#endif + FUNC_MAX +}; + +enum TimerModes { + TMRMODE_OFF, + TMRMODE_ON, + TMRMODE_START, + TMRMODE_THR, + TMRMODE_THR_REL, + TMRMODE_THR_START, + TMRMODE_COUNT, + TMRMODE_MAX = TMRMODE_COUNT - 1 +}; + +enum CountDownModes { + COUNTDOWN_SILENT, + COUNTDOWN_BEEPS, + COUNTDOWN_VOICE, +#if defined(HAPTIC) + COUNTDOWN_HAPTIC, +#endif + COUNTDOWN_COUNT +}; + +enum ResetFunctionParam { + FUNC_RESET_TIMER1, + FUNC_RESET_TIMER2, + FUNC_RESET_TIMER3, + FUNC_RESET_FLIGHT, + FUNC_RESET_TELEMETRY, + FUNC_RESET_PARAM_FIRST_TELEM, + FUNC_RESET_PARAM_LAST_TELEM = FUNC_RESET_PARAM_FIRST_TELEM + MAX_TELEMETRY_SENSORS, + FUNC_RESET_PARAMS_COUNT, + FUNC_RESET_PARAM_LAST = FUNC_RESET_PARAMS_COUNT-1, +}; + +enum AdjustGvarFunctionParam { + FUNC_ADJUST_GVAR_CONSTANT, + FUNC_ADJUST_GVAR_SOURCE, + FUNC_ADJUST_GVAR_GVAR, + FUNC_ADJUST_GVAR_INCDEC, +}; + +enum BluetoothModes { + BLUETOOTH_OFF, + BLUETOOTH_TELEMETRY, + BLUETOOTH_TRAINER, +#if defined(PCBX9E) + BLUETOOTH_MAX=BLUETOOTH_TELEMETRY +#else + BLUETOOTH_MAX=BLUETOOTH_TRAINER +#endif +}; + +enum UartSampleModes { + UART_SAMPLE_MODE_NORMAL = 0, + UART_SAMPLE_MODE_ONEBIT, + + UART_SAMPLE_MODE_MAX = UART_SAMPLE_MODE_ONEBIT +}; + +// PXX2 constants +#define PXX2_LEN_REGISTRATION_ID 8 +#define PXX2_LEN_RX_NAME 8 +#define PXX2_MAX_RECEIVERS_PER_MODULE 3 + +// from module_constants.h +enum ModuleType { + MODULE_TYPE_NONE = 0, + MODULE_TYPE_PPM, + MODULE_TYPE_XJT_PXX1, + MODULE_TYPE_ISRM_PXX2, + MODULE_TYPE_DSM2, + MODULE_TYPE_CROSSFIRE, + MODULE_TYPE_MULTIMODULE, + MODULE_TYPE_R9M_PXX1, // R9M + MODULE_TYPE_R9M_PXX2, // R9M ACCESS + MODULE_TYPE_R9M_LITE_PXX1, //R9MLite + MODULE_TYPE_R9M_LITE_PXX2, //R9MLP + MODULE_TYPE_GHOST, // Replaces MODULE_TYPE_R9M_LITE_PRO_PXX1 which doesn't exist + MODULE_TYPE_R9M_LITE_PRO_PXX2, + MODULE_TYPE_SBUS, + MODULE_TYPE_XJT_LITE_PXX2, + MODULE_TYPE_FLYSKY, //no more protocols possible because of 4 bits value + MODULE_TYPE_COUNT, + MODULE_TYPE_MAX = MODULE_TYPE_COUNT - 1 +}; + +enum AntennaModes { + ANTENNA_MODE_INTERNAL = -2, + ANTENNA_MODE_ASK = -1, + ANTENNA_MODE_PER_MODEL = 0, + ANTENNA_MODE_EXTERNAL = 1, + ANTENNA_MODE_FIRST = ANTENNA_MODE_INTERNAL, + ANTENNA_MODE_LAST = ANTENNA_MODE_EXTERNAL +}; + +// from opentx_constants.h +enum ModuleSubtypeFlysky { + FLYSKY_SUBTYPE_AFHDS3=0, + FLYSKY_SUBTYPE_AFHDS2A +}; + +enum SwitchConfig { + SWITCH_NONE, + SWITCH_TOGGLE, + SWITCH_2POS, + SWITCH_3POS, +}; + +enum PotConfig { + POT_NONE, + POT_WITH_DETENT, + POT_MULTIPOS_SWITCH, + POT_WITHOUT_DETENT +}; + +enum SliderConfig { + SLIDER_NONE, + SLIDER_WITH_DETENT, +}; + +enum CalibrationState { + CALIB_START, + CALIB_SET_MIDPOINT, + CALIB_MOVE_STICKS, + CALIB_STORE, + CALIB_FINISHED +}; + +#endif // _DATACONSTANTS_H_ diff --git a/radio/src/storage/conversions/yaml/datastructs_220.h b/radio/src/storage/conversions/yaml/datastructs_220.h new file mode 100644 index 000000000..4b92466a9 --- /dev/null +++ b/radio/src/storage/conversions/yaml/datastructs_220.h @@ -0,0 +1,1021 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +// No include guards here, this file may be included many times in different namespaces +// i.e. BACKUP RAM Backup/Restore functions + +#pragma once + +#include + +// from opentx_types.h +typedef uint32_t tmr10ms_t; +typedef int32_t rotenc_t; +typedef int32_t getvalue_t; +typedef uint32_t mixsrc_t; +typedef int32_t swsrc_t; +typedef int16_t safetych_t; +typedef int16_t gvar_t; +typedef uint32_t bitfield_channels_t; +typedef uint16_t FlightModesType; +typedef uint16_t source_t; + +// from globals.h +typedef uint16_t BeepANACenter; + +#include "definitions.h" + +#if defined(PCBTARANIS) + #define N_TARANIS_FIELD(x) + #define TARANIS_FIELD(x) x; +#else + #define N_TARANIS_FIELD(x) x; + #define TARANIS_FIELD(x) +#endif + +#if defined(PCBX9E) + #define TARANIS_PCBX9E_FIELD(x) x; +#else + #define TARANIS_PCBX9E_FIELD(x) +#endif + +#if defined(PCBHORUS) + #define N_HORUS_FIELD(x) + #define HORUS_FIELD(x) x; +#else + #define N_HORUS_FIELD(x) x; + #define HORUS_FIELD(x) +#endif + +#if defined(BACKUP) + #define NOBACKUP(...) +#else + #define NOBACKUP(...) __VA_ARGS__ +#endif + +#include "storage/yaml/yaml_defs.h" + +/* + * Mixer structure + */ + +PACK(struct CurveRef { + uint8_t type; + int8_t value; +}); + +PACK(struct MixData { + int16_t weight:11 CUST(in_read_weight,in_write_weight); // GV1=-1024, -GV1=1023 + uint16_t destCh:5; + uint16_t srcRaw:10 CUST(r_mixSrcRaw,w_mixSrcRaw); // srcRaw=0 means not used + uint16_t carryTrim:1; + uint16_t mixWarn:2; // mixer warning + uint16_t mltpx:2 ENUM(MixerMultiplex); + uint16_t spare:1 SKIP; + int32_t offset:14; + int32_t swtch:9 CUST(r_swtchSrc,w_swtchSrc); + uint32_t flightModes:9; //TODO ?? + CurveRef curve; + uint8_t delayUp; + uint8_t delayDown; + uint8_t speedUp; + uint8_t speedDown; + NOBACKUP(char name[LEN_EXPOMIX_NAME]); +}); + +/* + * Expo/Input structure + */ + +PACK(struct ExpoData { + uint16_t mode:2; + uint16_t scale:14; + uint16_t srcRaw:10 ENUM(MixSources) CUST(r_mixSrcRaw,w_mixSrcRaw); + int16_t carryTrim:6; + uint32_t chn:5; + int32_t swtch:9 CUST(r_swtchSrc,w_swtchSrc); + uint32_t flightModes:9; //TODO ?? + int32_t weight:8 CUST(in_read_weight,in_write_weight); + int32_t spare:1 SKIP; + NOBACKUP(char name[LEN_EXPOMIX_NAME]); + int8_t offset; + CurveRef curve; +}); + +/* + * Limit structure + */ + +PACK(struct LimitData { + int32_t min:11; + int32_t max:11; + int32_t ppmCenter:10; // TODO can be reduced to 8 bits + int16_t offset:11; + uint16_t symetrical:1; + uint16_t revert:1; + uint16_t spare:3 SKIP; + int8_t curve; + NOBACKUP(char name[LEN_CHANNEL_NAME]); +}); + +/* + * LogicalSwitch structure + */ + +PACK(struct LogicalSwitchData { + uint8_t func ENUM(LogicalSwitchesFunctions); + int32_t v1:10; + int32_t v3:10; + int32_t andsw:9; // TODO rename to xswtch + uint32_t andswtype:1; // TODO rename to xswtchType (AND / OR) + uint32_t spare:2 SKIP; // anything else needed? + int16_t v2; + uint8_t delay; + uint8_t duration; +}); + +/* + * SpecialFunction structure + */ + + +#if defined(PCBTARANIS) + #define CFN_SPARE_TYPE int32_t +#else + #define CFN_SPARE_TYPE int16_t +#endif + +PACK(struct CustomFunctionData { + int16_t swtch:9 CUST(r_swtchSrc,w_swtchSrc); + uint16_t func:7 ENUM(Functions); + PACK(union { + NOBACKUP(PACK(struct { + char name[LEN_FUNCTION_NAME]; + }) play); + + PACK(struct { + int16_t val; + uint8_t mode; + uint8_t param; + NOBACKUP(CFN_SPARE_TYPE spare SKIP); + }) all; + + NOBACKUP(PACK(struct { + int32_t val1; + NOBACKUP(CFN_SPARE_TYPE val2 SKIP); + }) clear); + }) NAME(fp) FUNC(select_custom_fn); + uint8_t active; + + bool isEmpty() const + { + return swtch == 0; + } +}); + +/* + * FlightMode structure + */ + +PACK(struct trim_t { + int16_t value:11; + uint16_t mode:5; +}); + +PACK(struct FlightModeData { + trim_t trim[NUM_TRIMS]; + NOBACKUP(char name[LEN_FLIGHT_MODE_NAME]); + int16_t swtch:9 ENUM(SwitchSources) CUST(r_swtchSrc,w_swtchSrc); // swtch of phase[0] is not used + int16_t spare:7 SKIP; + uint8_t fadeIn; + uint8_t fadeOut; + gvar_t gvars[MAX_GVARS] FUNC(gvar_is_active); +}); + +/* + * Curve structure + */ + +PACK(struct CurveHeader { + uint8_t type:1; + uint8_t smooth:1; + int8_t points:6; // describes number of points - 5 + NOBACKUP(char name[LEN_CURVE_NAME]); +}); + +/* + * GVar structure + */ + +PACK(struct GVarData { + NOBACKUP(char name[LEN_GVAR_NAME]); + uint32_t min:12; + uint32_t max:12; + uint32_t popup:1; + uint32_t prec:1; + uint32_t unit:2; + uint32_t spare:4 SKIP; +}); + +/* + * Timer structure + */ + +PACK(struct TimerData { + uint32_t start:22; + int32_t swtch:10 CUST(r_swtchSrc,w_swtchSrc); + int32_t value:22; + uint32_t mode:3 ENUM(TimerModes); + uint32_t countdownBeep:2; + uint32_t minuteBeep:1; + uint32_t persistent:2; + int32_t countdownStart:2; + NOBACKUP(char name[LEN_TIMER_NAME]); +}); + +/* + * Swash Ring structure + */ + +PACK(struct SwashRingData { + uint8_t type; + uint8_t value; + uint8_t collectiveSource; + uint8_t aileronSource; + uint8_t elevatorSource; + int8_t collectiveWeight; + int8_t aileronWeight; + int8_t elevatorWeight; +}); + +#if MAX_SCRIPTS > 0 +union ScriptDataInput { + int16_t value; + source_t source; +} FUNC(select_script_input); + +PACK(struct ScriptData { + char file[LEN_SCRIPT_FILENAME]; + char name[LEN_SCRIPT_NAME]; + ScriptDataInput inputs[MAX_SCRIPT_INPUTS]; +}); +#endif + +/* + * Frsky Telemetry structure + */ +PACK(struct RssiAlarmData { + int8_t disabled:1; +#if defined (PCBNV14) + uint8_t flysky_telemetry:1; // if set for FlySky receivers use native RSSI values instead of rescaled ones +#else + int8_t spare:1 SKIP; +#endif + int8_t warning:6; + int8_t spare2:2 SKIP; + int8_t critical:6; + inline int8_t getWarningRssi() {return 45 + warning;} + inline int8_t getCriticalRssi() {return 42 + critical;} + }); + +typedef int16_t ls_telemetry_value_t; + +#if !defined(COLORLCD) +PACK(struct FrSkyBarData { + source_t source; + ls_telemetry_value_t barMin; // minimum for bar display + ls_telemetry_value_t barMax; // ditto for max display (would usually = ratio) +}); + +PACK(struct FrSkyLineData { + source_t sources[NUM_LINE_ITEMS]; +}); + +#if defined(PCBTARANIS) +PACK(struct TelemetryScriptData { + char file[LEN_SCRIPT_FILENAME]; + int16_t inputs[MAX_TELEM_SCRIPT_INPUTS]; +}); +#endif + +union TelemetryScreenData { + FrSkyBarData bars[4]; + FrSkyLineData lines[4]; +#if defined(PCBTARANIS) + TelemetryScriptData script; +#endif +}; +#endif + +PACK(struct VarioData { + uint8_t source:7; + uint8_t centerSilent:1; + int8_t centerMax; + int8_t centerMin; + int8_t min; + int8_t max; +}); + +/* + * Telemetry Sensor structure + */ + +#define TELEMETRY_ENDPOINT_NONE 0xFF +#define TELEMETRY_ENDPOINT_SPORT 0x07 + +PACK(struct TelemetrySensor { + union { + uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type. + NOBACKUP(uint16_t persistentValue); + } NAME(id1) FUNC(select_id1); + union { + NOBACKUP(PACK(struct { + uint8_t physID:5; + uint8_t rxIndex:3; // 1 bit for module index, 2 bits for receiver index + }) frskyInstance); + uint8_t instance; + NOBACKUP(uint8_t formula); + } NAME(id2) FUNC(select_id2); + char label[TELEM_LABEL_LEN]; // user defined label + uint8_t subId; + uint8_t type:1; // 0=custom / 1=calculated // user can choose what unit to display each value in + uint8_t spare1:1 SKIP; + uint8_t unit:6; + uint8_t prec:2; + uint8_t autoOffset:1; + uint8_t filter:1; + uint8_t logs:1; + uint8_t persistent:1; + uint8_t onlyPositive:1; + uint8_t spare2:1 SKIP; + union { + NOBACKUP(PACK(struct { + uint16_t ratio; + int16_t offset; + }) custom); + NOBACKUP(PACK(struct { + uint8_t source; + uint8_t index; + uint16_t spare SKIP; + }) cell); + NOBACKUP(PACK(struct { + int8_t sources[4]; + }) calc); + NOBACKUP(PACK(struct { + uint8_t source; + uint8_t spare[3] SKIP; + }) consumption); + NOBACKUP(PACK(struct { + uint8_t gps; + uint8_t alt; + uint16_t spare SKIP; + }) dist); + uint32_t param; + } NAME(cfg) FUNC(select_sensor_cfg); + NOBACKUP( + void init(const char *label, uint8_t unit=UNIT_RAW, uint8_t prec=0); + void init(uint16_t id); + bool isAvailable() const; + int32_t getValue(int32_t value, uint8_t unit, uint8_t prec) const; + bool isConfigurable() const; + bool isPrecConfigurable() const; + int32_t getPrecMultiplier() const; + int32_t getPrecDivisor() const; + bool isSameInstance(TelemetryProtocol protocol, uint8_t instance); + ); +}); + +/* + * Trainer module structure + */ + +PACK(struct TrainerModuleData { + uint8_t mode CUST(r_trainerMode,w_trainerMode); + uint8_t channelsStart; + int8_t channelsCount; // 0=8 channels + int8_t frameLength; + int8_t delay:6; + uint8_t pulsePol:1; + uint8_t spare2:1 SKIP; +}); + +/* + * Module structure + */ + +// Only used in case switch and if statements as "virtual" protocol +#define MM_RF_CUSTOM_SELECTED 0xff +#define MULTI_MAX_PROTOCOLS 127 // rfProtocol:4 + rfProtocolExtra:3 +PACK(struct ModuleData { + uint8_t type:4 ENUM(ModuleType); + // TODO some refactoring is needed, rfProtocol is only used by DSM2 and MULTI, it could be merged with subType + int8_t rfProtocol:4; + uint8_t channelsStart; + int8_t channelsCount; // 0=8 channels + uint8_t failsafeMode:4; // only 3 bits used + uint8_t subType:3; + uint8_t invertedSerial:1; // telemetry serial inverted from standard + + union { + uint8_t raw[PXX2_MAX_RECEIVERS_PER_MODULE * PXX2_LEN_RX_NAME + 1]; + NOBACKUP(struct { + int8_t delay:6; + uint8_t pulsePol:1; + uint8_t outputType:1; // false = open drain, true = push pull + int8_t frameLength; + } ppm); + NOBACKUP(struct { + uint8_t rfProtocolExtra:3; + uint8_t disableTelemetry:1; + uint8_t disableMapping:1; + uint8_t customProto:1; + uint8_t autoBindMode:1; + uint8_t lowPowerMode:1; + int8_t optionValue; + uint8_t receiverTelemetryOff:1; + uint8_t receiverHigherChannels:1; + uint8_t spare:6 SKIP; + } multi); + NOBACKUP(struct { + uint8_t power:2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W + uint8_t spare1:2 SKIP; + uint8_t receiverTelemetryOff:1; // false = receiver telem enabled + uint8_t receiverHigherChannels:1; // false = pwm out 1-8, true 9-16 + int8_t antennaMode:2; + uint8_t spare2 SKIP; + } pxx); + NOBACKUP(struct { + uint8_t spare1:6 SKIP; + uint8_t noninverted:1; + uint8_t spare2:1 SKIP; + int8_t refreshRate; // definition as framelength for ppm (* 5 + 225 = time in 1/10 ms) + } sbus); + NOBACKUP(struct { + uint8_t receivers:7; // 4 bits spare + uint8_t racingMode:1; + char receiverName[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME]; + } pxx2); + NOBACKUP(struct { + uint8_t rx_id[4]; + uint8_t mode:3; + uint8_t rfPower:1; + uint8_t reserved:4; + uint8_t rx_freq[2]; + + void setDefault() { + rx_id[0] = rx_id[1] = rx_id[2] = rx_id[3] = 0; + mode = 0; + rfPower = 0; + rx_freq[0] = 50; + rx_freq[1] = 0; + } + } flysky); + NOBACKUP(PACK(struct { + uint8_t bindPower:3; + uint8_t runPower:3; + uint8_t emi:1; + uint8_t telemetry:1; + uint16_t failsafeTimeout; + uint8_t rx_freq[2]; + uint8_t mode:2; + uint8_t reserved:6; + uint16_t rxFreq() + { + return (uint16_t)rx_freq[0] | (((uint16_t)rx_freq[1]) << 8); + } + + void setRxFreq(uint16_t value) + { + rx_freq[0] = value & 0xFF; + rx_freq[1] = value >> 8; + } + } afhds3)); + } NAME(mod) FUNC(select_mod_type); + + // Helper functions to set both of the rfProto protocol at the same time + NOBACKUP(inline uint8_t getMultiProtocol() const + { + return ((uint8_t) (rfProtocol & 0x0F)) + (multi.rfProtocolExtra << 4); + }) + + NOBACKUP(inline void setMultiProtocol(uint8_t proto) + { + rfProtocol = (uint8_t) (proto & 0x0F); + multi.rfProtocolExtra = (proto & 0x70) >> 4; + }) + + NOBACKUP(inline uint8_t getChannelsCount() const + { + return channelsCount + 8; + }) +}); + +/* + * Model structure + */ + +#if LEN_BITMAP_NAME > 0 +#define MODEL_HEADER_BITMAP_FIELD NOBACKUP(char bitmap[LEN_BITMAP_NAME]); +#else +#define MODEL_HEADER_BITMAP_FIELD +#endif + + +PACK(struct ModelHeader { + char name[LEN_MODEL_NAME]; // must be first for eeLoadModelName + uint8_t modelId[NUM_MODULES]; + MODEL_HEADER_BITMAP_FIELD +}); + +#if defined(COLORLCD) +typedef uint32_t swconfig_t; +typedef uint32_t swarnstate_t; +#elif defined(PCBX9E) +typedef uint64_t swconfig_t; +typedef uint64_t swarnstate_t; +typedef uint32_t swarnenable_t; +#elif defined(PCBX9D) || defined(PCBX9DP) +typedef uint32_t swconfig_t; +typedef uint32_t swarnstate_t; +typedef uint16_t swarnenable_t; // TODO remove it in 2.4 +#elif defined(PCBTARANIS) +typedef uint16_t swconfig_t; +typedef uint16_t swarnstate_t; +typedef uint8_t swarnenable_t; // TODO remove it in 2.4 +#else +typedef uint8_t swarnstate_t; +typedef uint8_t swarnenable_t; +#endif + +#if defined(COLORLCD) + #define SWITCHES_WARNING_DATA \ + NOBACKUP(swarnstate_t switchWarningState CUST(r_swtchWarn,w_swtchWarn)); +#else + #define SWITCHES_WARNING_DATA \ + swarnstate_t switchWarningState CUST(r_swtchWarn,w_swtchWarn); \ + swarnenable_t switchWarningEnable; // TODO remove it in 2.4 +#endif + +#if defined(COLORLCD) && defined(BACKUP) +#define CUSTOM_SCREENS_DATA +#elif defined(COLORLCD) +#include "layout_220.h" +PACK(struct CustomScreenData { + char LayoutId[LAYOUT_ID_LEN]; + LayoutPersistentData layoutData; +}); +#define CUSTOM_SCREENS_DATA \ + NOBACKUP(CustomScreenData screenData[MAX_CUSTOM_SCREENS]); \ + NOBACKUP(TopBarPersistentData topbarData); \ + NOBACKUP(uint8_t view); +#else +#define CUSTOM_SCREENS_DATA \ + uint8_t screensType; /* 2bits per screen (None/Gauges/Numbers/Script) */ \ + TelemetryScreenData screens[MAX_TELEMETRY_SCREENS]; \ + uint8_t view; +#endif + +#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) + #define TOPBAR_DATA \ + NOBACKUP(uint8_t voltsSource); \ + NOBACKUP(uint8_t altitudeSource); +#else + #define TOPBAR_DATA +#endif + +#if defined(PCBHORUS) || defined(PCBTARANIS) || defined(PCBNV14) + #define SCRIPT_DATA \ + NOBACKUP(ScriptData scriptsData[MAX_SCRIPTS]); +#else + #define SCRIPT_DATA +#endif + +PACK(struct PartialModel { + ModelHeader header; + TimerData timers[MAX_TIMERS]; +}); + +PACK(struct ModelData { + ModelHeader header; + TimerData timers[MAX_TIMERS]; + uint8_t telemetryProtocol:3; + uint8_t thrTrim:1; // Enable Throttle Trim + uint8_t noGlobalFunctions:1; + uint8_t displayTrims:2; + uint8_t ignoreSensorIds:1; + int8_t trimInc:3; // Trim Increments + uint8_t disableThrottleWarning:1; + uint8_t displayChecklist:1; + uint8_t extendedLimits:1; + uint8_t extendedTrims:1; + uint8_t throttleReversed:1; + BeepANACenter beepANACenter; + MixData mixData[MAX_MIXERS] NO_IDX; + LimitData limitData[MAX_OUTPUT_CHANNELS]; + ExpoData expoData[MAX_EXPOS] NO_IDX; + + CurveHeader curves[MAX_CURVES]; + int8_t points[MAX_CURVE_POINTS]; + + LogicalSwitchData logicalSw[MAX_LOGICAL_SWITCHES]; + CustomFunctionData customFn[MAX_SPECIAL_FUNCTIONS] FUNC(cfn_is_active); + SwashRingData swashR; + FlightModeData flightModeData[MAX_FLIGHT_MODES] FUNC(fmd_is_active); + + NOBACKUP(uint8_t thrTraceSrc); + + SWITCHES_WARNING_DATA + + GVarData gvars[MAX_GVARS]; + + NOBACKUP(VarioData varioData); + NOBACKUP(uint8_t rssiSource); + + TOPBAR_DATA + + NOBACKUP(RssiAlarmData rssiAlarms); + + uint8_t spare1:3 SKIP; + uint8_t thrTrimSw:3; + uint8_t potsWarnMode:2; + + ModuleData moduleData[NUM_MODULES]; + int16_t failsafeChannels[MAX_OUTPUT_CHANNELS]; + TrainerModuleData trainerData; + + SCRIPT_DATA + + NOBACKUP(char inputNames[MAX_INPUTS][LEN_INPUT_NAME]); + NOBACKUP(uint8_t potsWarnEnabled); + NOBACKUP(int8_t potsWarnPosition[STORAGE_NUM_POTS+STORAGE_NUM_SLIDERS]); + + NOBACKUP(TelemetrySensor telemetrySensors[MAX_TELEMETRY_SENSORS];) + + TARANIS_PCBX9E_FIELD(uint8_t toplcdTimer) + + CUSTOM_SCREENS_DATA + + char modelRegistrationID[PXX2_LEN_REGISTRATION_ID]; + + bool isTrainerTraineeEnable() const + { +#if defined(PCBNV14) + return trainerData.mode >= TRAINER_MODE_MASTER_TRAINER_JACK; +#else + return true; +#endif + } + + uint8_t getThrottleStickTrimSource() const + { + // The order here is TERA, so that 0 (default) means Throttle + switch (thrTrimSw) { + case 0: + return MIXSRC_TrimThr; + case 2: + return MIXSRC_TrimRud; + default: + return thrTrimSw + MIXSRC_FIRST_TRIM; + } + } + + void setThrottleStickTrimSource(int16_t src) + { + // The order here is TERA, so that 0 (default) means Throttle + switch (src) { + case MIXSRC_TrimThr: + thrTrimSw = 0; + break; + case MIXSRC_TrimRud: + thrTrimSw = 2; + break; + default: + thrTrimSw = src - MIXSRC_FIRST_TRIM; + break; + } + } +}); + +/* + * Radio structure + */ + +#if XPOTS_MULTIPOS_COUNT > 0 +PACK(struct StepsCalibData { + uint8_t count; + uint8_t steps[XPOTS_MULTIPOS_COUNT-1]; +}); +#endif + +PACK(struct CalibData { + int16_t mid; + int16_t spanNeg; + int16_t spanPos; +}); + +PACK(struct TrainerMix { + uint8_t srcChn:6; // 0-7 = ch1-8 + uint8_t mode:2 ENUM(TrainerMultiplex); // off,add-mode,subst-mode + int8_t studWeight; +}); + +PACK(struct TrainerData { + int16_t calib[4]; + NOBACKUP(TrainerMix mix[4]); +}); + +#if defined(COLORLCD) + #define SPLASH_MODE uint8_t splashSpares:3 SKIP +#else + #define SPLASH_MODE int8_t splashMode:3 +#endif + +#if defined(PCBXLITES) + #define GYRO_FIELDS \ + int8_t gyroMax; \ + int8_t gyroOffset; +#else + #define GYRO_FIELDS +#endif + +#if defined(PCBHORUS) || defined(PCBNV14) + #define EXTRA_GENERAL_FIELDS \ + NOBACKUP(uint8_t auxSerialMode:4 ENUM(UartModes)); \ + NOBACKUP(uint8_t aux2SerialMode:4 ENUM(UartModes)); \ + CUST_ARRAY(sticksConfig, struct_sticksConfig, stick_name_valid); \ + swconfig_t switchConfig ARRAY(2,struct_switchConfig,nullptr); \ + uint16_t potsConfig ARRAY(2,struct_potConfig,nullptr); /* two bits per pot */ \ + uint8_t slidersConfig ARRAY(1,struct_sliderConfig,nullptr); /* 1 bit per slider */ \ + NOBACKUP(char switchNames[STORAGE_NUM_SWITCHES][LEN_SWITCH_NAME] SKIP); \ + NOBACKUP(char anaNames[NUM_STICKS + STORAGE_NUM_POTS + STORAGE_NUM_SLIDERS][LEN_ANA_NAME] SKIP); \ + NOBACKUP(char currModelFilename[LEN_MODEL_FILENAME+1]); \ + NOBACKUP(uint8_t spare5:1 SKIP); \ + NOBACKUP(uint8_t blOffBright:7); \ + NOBACKUP(char bluetoothName[LEN_BLUETOOTH_NAME]); +#elif defined(PCBTARANIS) + #if defined(STORAGE_BLUETOOTH) + #define BLUETOOTH_FIELDS \ + uint8_t spare5 SKIP; \ + char bluetoothName[LEN_BLUETOOTH_NAME]; + #else + #define BLUETOOTH_FIELDS + #endif + #define EXTRA_GENERAL_FIELDS \ + uint8_t auxSerialMode:4 ENUM(UartModes); \ + uint8_t slidersConfig:4 ARRAY(1,struct_sliderConfig,nullptr); \ + uint8_t potsConfig ARRAY(2,struct_potConfig,nullptr); /* two bits per pot */\ + uint8_t backlightColor; \ + swarnstate_t switchUnlockStates; \ + CUST_ARRAY(sticksConfig, struct_sticksConfig, stick_name_valid); \ + swconfig_t switchConfig ARRAY(2,struct_switchConfig,nullptr); \ + char switchNames[STORAGE_NUM_SWITCHES][LEN_SWITCH_NAME] SKIP; \ + char anaNames[NUM_STICKS+STORAGE_NUM_POTS+STORAGE_NUM_SLIDERS][LEN_ANA_NAME] SKIP; \ + BLUETOOTH_FIELDS +#else + #define EXTRA_GENERAL_FIELDS +#endif + +#if defined(COLORLCD) && !defined(BACKUP) + #define MAX_THEME_OPTIONS 5 + struct OpenTxTheme__PersistentData { + ZoneOptionValueTyped options[MAX_THEME_OPTIONS]; + }; + #define THEME_NAME_LEN 8 + #define THEME_DATA \ + NOBACKUP(char themeName[THEME_NAME_LEN]); \ + NOBACKUP(OpenTxTheme__PersistentData themeData); +#else + #define THEME_DATA +#endif + +#if defined(BUZZER) + #define BUZZER_FIELD int8_t buzzerMode:2 // -2=quiet, -1=only alarms, 0=no keys, 1=all (only used on AVR radios without audio hardware) +#else + #define BUZZER_FIELD int8_t spare4:2 SKIP +#endif + +PACK(struct RadioData { + + // Real attributes + NOBACKUP(uint8_t version); + NOBACKUP(uint16_t variant SKIP); + CalibData calib[NUM_STICKS + STORAGE_NUM_POTS + STORAGE_NUM_SLIDERS + STORAGE_NUM_MOUSE_ANALOGS]; + NOBACKUP(uint16_t chkSum SKIP); + N_HORUS_FIELD(int8_t currModel); + N_HORUS_FIELD(uint8_t contrast); + NOBACKUP(uint8_t vBatWarn); + NOBACKUP(int8_t txVoltageCalibration); + uint8_t backlightMode:3 ENUM(BacklightMode); + int8_t antennaMode:2 ENUM(AntennaModes); + uint8_t disableRtcWarning:1; + uint8_t keysBacklight:1; + int8_t spare1:1 SKIP; + NOBACKUP(TrainerData trainer); + NOBACKUP(uint8_t view); // index of view in main screen + NOBACKUP(BUZZER_FIELD); /* 2bits */ + NOBACKUP(uint8_t fai:1); + NOBACKUP(int8_t beepMode:2 ENUM(BeeperMode) CUST(r_beeperMode,w_beeperMode)); + NOBACKUP(uint8_t alarmsFlash:1); + NOBACKUP(uint8_t disableMemoryWarning:1); + NOBACKUP(uint8_t disableAlarmWarning:1); + uint8_t stickMode:2; + int8_t timezone:5; + uint8_t adjustRTC:1; + NOBACKUP(uint8_t inactivityTimer); + uint8_t telemetryBaudrate:3; + SPLASH_MODE; /* 3bits */ + int8_t hapticMode:2 CUST(r_beeperMode,w_beeperMode); + int8_t switchesDelay; + NOBACKUP(uint8_t lightAutoOff); + NOBACKUP(uint8_t templateSetup); // RETA order for receiver channels + NOBACKUP(int8_t PPM_Multiplier); + NOBACKUP(int8_t hapticLength CUST(r_5pos,w_5pos)); + N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t spare2 SKIP)); + N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t stickReverse)); + NOBACKUP(int8_t beepLength:3 CUST(r_5pos,w_5pos)); + NOBACKUP(int8_t hapticStrength:3 CUST(r_5pos,w_5pos)); + NOBACKUP(uint8_t gpsFormat:1); + NOBACKUP(uint8_t unexpectedShutdown:1); + NOBACKUP(uint8_t speakerPitch CUST(r_spPitch,w_spPitch)); + NOBACKUP(int8_t speakerVolume CUST(r_vol,w_vol)); + NOBACKUP(int8_t vBatMin CUST(r_vbat_min,w_vbat_min)); + NOBACKUP(int8_t vBatMax CUST(r_vbat_max,w_vbat_max)); + + NOBACKUP(uint8_t backlightBright); + NOBACKUP(uint32_t globalTimer); + NOBACKUP(uint8_t bluetoothBaudrate:4); + NOBACKUP(uint8_t bluetoothMode:4 ENUM(BluetoothModes)); + NOBACKUP(uint8_t countryCode:2); + NOBACKUP(int8_t pwrOnSpeed:3); + NOBACKUP(int8_t pwrOffSpeed:3); + NOBACKUP(uint8_t imperial:1); + NOBACKUP(uint8_t jitterFilter:1); /* 0 - active */ + NOBACKUP(uint8_t disableRssiPoweroffAlarm:1); + NOBACKUP(uint8_t USBMode:2); + NOBACKUP(uint8_t jackMode:2); + NOBACKUP(uint8_t sportUpdatePower:1 SKIP); + NOBACKUP(char ttsLanguage[2]); + NOBACKUP(int8_t beepVolume:4 CUST(r_5pos,w_5pos)); + NOBACKUP(int8_t wavVolume:4 CUST(r_5pos,w_5pos)); + NOBACKUP(int8_t varioVolume:4 CUST(r_5pos,w_5pos)); + NOBACKUP(int8_t backgroundVolume:4 CUST(r_5pos,w_5pos)); + NOBACKUP(int8_t varioPitch CUST(r_vPitch,w_vPitch)); + NOBACKUP(int8_t varioRange CUST(r_vPitch,w_vPitch)); + NOBACKUP(int8_t varioRepeat); + CustomFunctionData customFn[MAX_SPECIAL_FUNCTIONS] FUNC(cfn_is_active); + + EXTRA_GENERAL_FIELDS + + THEME_DATA + + char ownerRegistrationID[PXX2_LEN_REGISTRATION_ID]; + + GYRO_FIELDS + + NOBACKUP(int8_t uartSampleMode:2); // See UartSampleModes +}); + +#undef SWITCHES_WARNING_DATA +#undef MODEL_GVARS_DATA +#undef TELEMETRY_DATA +#undef SCRIPTS_DATA +#undef CUSTOM_SCREENS_DATA +#undef SPLASH_MODE +#undef EXTRA_GENERAL_FIELDS +#undef THEME_DATA +#undef NOBACKUP + + +#if !defined(BACKUP) +/* Compile time check to test structure size has not changed * + Changing the size of one of the eeprom structs may cause wrong data to + be loaded. Error out if the struct size changes. + This function tries not avoid checking or using the defines + other than the CPU arch and board type so changes in other + defines also trigger the struct size changes */ + +#include "chksize.h" + +#define CHKSIZE(x, y) check_size() +#define CHKTYPE(x, y) check_size() + +static inline void check_struct() +{ + + CHKSIZE(CurveRef, 2); + + /* Difference between Taranis/Horus is LEN_EXPOMIX_NAME */ + /* LEN_FUNCTION_NAME is the difference in CustomFunctionData */ + + CHKSIZE(VarioData, 5); + +#if defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE) + CHKSIZE(MixData, 20); + CHKSIZE(ExpoData, 17); + CHKSIZE(LimitData, 11); + CHKSIZE(LogicalSwitchData, 9); + CHKSIZE(CustomFunctionData, 11); + CHKSIZE(FlightModeData, 28 + 2*NUM_TRIMS); + CHKSIZE(TimerData, 11); + CHKSIZE(SwashRingData, 8); + CHKSIZE(FrSkyBarData, 6); + CHKSIZE(FrSkyLineData, 4); + CHKTYPE(union TelemetryScreenData, 24); + CHKSIZE(ModelHeader, 12); + CHKSIZE(CurveHeader, 4); +#elif defined(PCBTARANIS) + CHKSIZE(MixData, 20); + CHKSIZE(ExpoData, 17); + CHKSIZE(LimitData, 13); + CHKSIZE(LogicalSwitchData, 9); + CHKSIZE(CustomFunctionData, 11); + CHKSIZE(FlightModeData, 40); + CHKSIZE(TimerData, 16); + CHKSIZE(SwashRingData, 8); + CHKSIZE(FrSkyBarData, 6); + CHKSIZE(FrSkyLineData, 6); + CHKTYPE(union TelemetryScreenData, 24); + CHKSIZE(ModelHeader, 24); + CHKSIZE(CurveHeader, 4); +#elif defined(PCBHORUS) + CHKSIZE(MixData, 20); + CHKSIZE(ExpoData, 17); + CHKSIZE(LimitData, 13); + CHKSIZE(CustomFunctionData, 9); + CHKSIZE(FlightModeData, 44); + CHKSIZE(TimerData, 16); + CHKSIZE(SwashRingData, 8); + CHKSIZE(ModelHeader, 31); + CHKSIZE(CurveHeader, 4); + CHKSIZE(CustomScreenData, 850); + CHKTYPE(TopBarPersistentData, 300); +#elif defined(PCBNV14) + // TODO +#else + // Common for all variants + CHKSIZE(LimitData, 5); + CHKSIZE(SwashRingData, 3); + CHKSIZE(FrSkyBarData, 3); + CHKSIZE(FrSkyLineData, 2); + CHKSIZE(ModelHeader, 11); + CHKTYPE(CurveHeader, 1); + + CHKSIZE(MixData, 9); + CHKSIZE(ExpoData, 4); + + CHKSIZE(CustomFunctionData, 3); + CHKSIZE(TimerData, 3); + + CHKSIZE(FlightModeData, 30); + CHKSIZE(RadioData, 85); + +#endif /* board specific ifdefs*/ + + CHKSIZE(LogicalSwitchData, 9); + CHKSIZE(TelemetrySensor, 14); + CHKSIZE(ModuleData, 29); + CHKSIZE(GVarData, 7); + CHKSIZE(RssiAlarmData, 2); + CHKSIZE(TrainerData, 16); + +#if defined(PCBXLITES) + CHKSIZE(RadioData, 861); + CHKSIZE(ModelData, 6157); +#elif defined(PCBXLITE) + CHKSIZE(RadioData, 859); + CHKSIZE(ModelData, 6157); +#elif defined(PCBX7) + CHKSIZE(RadioData, 865); + CHKSIZE(ModelData, 6157); +#elif defined(PCBX9E) + CHKSIZE(RadioData, 961); + CHKSIZE(ModelData, 6614); +#elif defined(PCBX9D) || defined(PCBX9DP) + CHKSIZE(RadioData, 899); + CHKSIZE(ModelData, 6604); +#elif defined(PCBHORUS) + CHKSIZE(RadioData, 902); + CHKSIZE(ModelData, 11020); +#endif + +#undef CHKSIZE +} +#endif /* BACKUP */ diff --git a/radio/src/storage/conversions/yaml/layout_220.h b/radio/src/storage/conversions/yaml/layout_220.h new file mode 100644 index 000000000..6d2dff76d --- /dev/null +++ b/radio/src/storage/conversions/yaml/layout_220.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#pragma once + +#define MAX_LAYOUT_ZONES 10 +#define MAX_LAYOUT_OPTIONS 10 + +#if defined(PCBNV14) +#define MAX_TOPBAR_ZONES 2 +#else +#define MAX_TOPBAR_ZONES 4 +#endif + +#define WIDGET_NAME_LEN 10 +#define MAX_WIDGET_OPTIONS 5 +#define MAX_TOPBAR_OPTIONS 1 +#define LAYOUT_ID_LEN 10 + +#include "zone_220.h" + +struct WidgetPersistentData { + ZoneOptionValueTyped options[MAX_WIDGET_OPTIONS]; +}; + +struct ZonePersistentData { + char widgetName[WIDGET_NAME_LEN]; + WidgetPersistentData widgetData; +}; + +struct LayoutPersistentData { + ZonePersistentData zones[MAX_LAYOUT_ZONES]; + ZoneOptionValueTyped options[MAX_LAYOUT_OPTIONS]; +}; + +struct TopBarPersistentData { + ZonePersistentData zones[MAX_TOPBAR_ZONES]; + ZoneOptionValueTyped options[MAX_TOPBAR_OPTIONS]; +}; diff --git a/radio/src/storage/conversions/yaml/myeeprom_220.h b/radio/src/storage/conversions/yaml/myeeprom_220.h new file mode 100644 index 000000000..eb185d963 --- /dev/null +++ b/radio/src/storage/conversions/yaml/myeeprom_220.h @@ -0,0 +1,282 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _MYEEPROM_H_ +#define _MYEEPROM_H_ + +// #include "datastructs.h" +// #include "libopenui/src/bitfield.h" + +#if defined(SDCARD_YAML) + #define EEPROM_VER 221 +#else + #define EEPROM_VER 220 +#endif +#define FIRST_CONV_EEPROM_VER 219 + +#define GET_MODULE_PPM_POLARITY(idx) g_model.moduleData[idx].ppm.pulsePol +#define GET_TRAINER_PPM_POLARITY() g_model.trainerData.pulsePol +#define GET_SBUS_POLARITY(idx) g_model.moduleData[idx].sbus.noninverted +#define GET_MODULE_PPM_DELAY(idx) (g_model.moduleData[idx].ppm.delay * 50 + 300) +#define GET_TRAINER_PPM_DELAY() (g_model.trainerData.delay * 50 + 300) + +#if defined(HARDWARE_TRAINER_EXTERNAL_MODULE) + #define IS_TRAINER_EXTERNAL_MODULE() (g_model.trainerData.mode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE || g_model.trainerData.mode == TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE) +#else + #define IS_TRAINER_EXTERNAL_MODULE() false +#endif + +#define IS_TRAINER_AUX_SERIAL() (g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER) + +#define IS_PLAY_FUNC(func) ((func) >= FUNC_PLAY_SOUND && func <= FUNC_PLAY_VALUE) + +#if defined(GVARS) + #define IS_ADJUST_GV_FUNC(func) ((func) == FUNC_ADJUST_GVAR) +#else + #define IS_ADJUST_GV_FUNC(func) (0) +#endif + +#if defined(HAPTIC) + #define IS_HAPTIC_FUNC(func) ((func) == FUNC_HAPTIC) +#else + #define IS_HAPTIC_FUNC(func) (0) +#endif + +#define HAS_ENABLE_PARAM(func) ((func) < FUNC_FIRST_WITHOUT_ENABLE || (func == FUNC_BACKLIGHT)) +#define HAS_REPEAT_PARAM(func) (IS_PLAY_FUNC(func) || IS_HAPTIC_FUNC(func)) + +#define CFN_EMPTY(p) (!(p)->swtch) +#define CFN_SWITCH(p) ((p)->swtch) +#define CFN_FUNC(p) ((p)->func) +#define CFN_ACTIVE(p) ((p)->active) +#define CFN_CH_INDEX(p) ((p)->all.param) +#define CFN_GVAR_INDEX(p) ((p)->all.param) +#define CFN_TIMER_INDEX(p) ((p)->all.param) +#define CFN_PLAY_REPEAT(p) ((p)->active) +#define CFN_PLAY_REPEAT_MUL 1 +#define CFN_PLAY_REPEAT_NOSTART 0xFF +#define CFN_GVAR_MODE(p) ((p)->all.mode) +#define CFN_PARAM(p) ((p)->all.val) +#define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0) +#define CFN_GVAR_CST_MIN -GVAR_MAX +#define CFN_GVAR_CST_MAX GVAR_MAX +#define MODEL_GVAR_MIN(idx) (CFN_GVAR_CST_MIN + g_model.gvars[idx].min) +#define MODEL_GVAR_MAX(idx) (CFN_GVAR_CST_MAX - g_model.gvars[idx].max) + +#if defined(PCBFRSKY) || defined(PCBNV14) + #define SWITCH_CONFIG(x) (bfGet(g_eeGeneral.switchConfig, 2*(x), 2)) + #define SWITCH_EXISTS(x) (SWITCH_CONFIG(x) != SWITCH_NONE) + #define IS_CONFIG_3POS(x) (SWITCH_CONFIG(x) == SWITCH_3POS) + #define IS_CONFIG_TOGGLE(x) (SWITCH_CONFIG(x) == SWITCH_TOGGLE) + #define SWITCH_WARNING_ALLOWED(x) (SWITCH_EXISTS(x) && !IS_CONFIG_TOGGLE(x)) +#else + #define IS_CONFIG_3POS(x) IS_3POS(x) + #define IS_CONFIG_TOGGLE(x) IS_TOGGLE(x) + #define switchInfo(x) ((x) >= 3 ? (x)-2 : 0) + #define SWITCH_EXISTS(x) true +#endif + +#define ALTERNATE_VIEW 0x10 + +// #if defined(COLORLCD) +// #include "layout.h" +// #include "theme.h" +// #include "topbar.h" +// #endif + +#define SWITCHES_DELAY() uint8_t(15+g_eeGeneral.switchesDelay) +#define SWITCHES_DELAY_NONE (-15) +#define HAPTIC_STRENGTH() (3+g_eeGeneral.hapticStrength) + +enum CurveRefType { + CURVE_REF_DIFF, + CURVE_REF_EXPO, + CURVE_REF_FUNC, + CURVE_REF_CUSTOM +}; + +#define EXPO_VALID(ed) ((ed)->mode) +#define EXPO_MODE_ENABLE(ed, v) (((v)<0 && ((ed)->mode&1)) || ((v)>=0 && ((ed)->mode&2))) + +#define limit_min_max_t int16_t +#define LIMIT_EXT_PERCENT 150 +#define LIMIT_STD_PERCENT 100 +#define LIMIT_EXT_MAX (LIMIT_EXT_PERCENT*10) +#define LIMIT_STD_MAX (LIMIT_STD_PERCENT*10) +#define PPM_CENTER_MAX 500 +#define LIMIT_MAX(lim) \ + (GV_IS_GV_VALUE(lim->max, -GV_RANGELARGE, GV_RANGELARGE) \ + ? GET_GVAR_PREC1(lim->max, -LIMIT_EXT_MAX, +LIMIT_EXT_MAX, \ + mixerCurrentFlightMode) \ + : lim->max + LIMIT_STD_MAX) +#define LIMIT_MIN(lim) \ + (GV_IS_GV_VALUE(lim->min, -GV_RANGELARGE, GV_RANGELARGE) \ + ? GET_GVAR_PREC1(lim->min, -LIMIT_EXT_MAX, +LIMIT_EXT_MAX, \ + mixerCurrentFlightMode) \ + : lim->min - LIMIT_STD_MAX) +#define LIMIT_OFS(lim) \ + (GV_IS_GV_VALUE(lim->offset, -LIMIT_STD_MAX, LIMIT_STD_MAX) \ + ? GET_GVAR_PREC1(lim->offset, -LIMIT_STD_MAX, +LIMIT_STD_MAX, \ + mixerCurrentFlightMode) \ + : lim->offset) +#define LIMIT_MAX_RESX(lim) calc1000toRESX(LIMIT_MAX(lim)) +#define LIMIT_MIN_RESX(lim) calc1000toRESX(LIMIT_MIN(lim)) +#define LIMIT_OFS_RESX(lim) calc1000toRESX(LIMIT_OFS(lim)) + +#define LIMITS_MIN_MAX_OFFSET LIMIT_STD_MAX + +#define TRIM_OFF (1) +#define TRIM_ON (0) +#define TRIM_RUD (-1) +#define TRIM_ELE (-2) +#define TRIM_THR (-3) +#define TRIM_AIL (-4) +#if defined(PCBHORUS) + #define TRIM_T5 (-5) + #define TRIM_T6 (-6) + #define TRIM_LAST TRIM_T6 +#else + #define TRIM_LAST TRIM_AIL +#endif + +enum MixerMultiplex { + MLTPX_ADD = 0, + MLTPX_MUL = 1, + MLTPX_REPL = 2, +}; + +enum TrainerMultiplex { + TRAINER_OFF = 0, + TRAINER_ADD = 1, + TRAINER_REPL = 2, +}; + +#define GV1_SMALL 128 +#define GV1_LARGE 1024 +#define GV_RANGE_OFFSET 500 +#define DELAY_MAX 250 /* 25 seconds */ +#define SLOW_MAX 250 /* 25 seconds */ + +#define MD_WEIGHT(md) (md->weight) +#define MD_WEIGHT_TO_UNION(md, var) var.word = md->weight +#define MD_UNION_TO_WEIGHT(var, md) md->weight = var.word + +#define MD_OFFSET(md) (md->offset) +#define MD_OFFSET_TO_UNION(md, var) var.word = md->offset +#define MD_UNION_TO_OFFSET(var, md) md->offset = var.word + +enum LogicalSwitchesFunctions { + LS_FUNC_NONE, + LS_FUNC_VEQUAL, // v==offset + LS_FUNC_VALMOSTEQUAL, // v~=offset + LS_FUNC_VPOS, // v>offset + LS_FUNC_VNEG, // voffset + LS_FUNC_ANEG, // |v| +#include +#include + +#include + +namespace yaml_conv_220 { + +#include "yaml_datastructs_funcs.cpp" + +#if defined(PCBX12S) + #include "yaml_datastructs_x12s.cpp" +#elif defined(PCBX10) + #include "yaml_datastructs_x10.cpp" +#elif defined(PCBNV14) + #include "yaml_datastructs_nv14.cpp" +#elif defined(PCBX7) + #if defined(RADIO_T12) + #include "yaml_datastructs_t12.cpp" + #elif defined(RADIO_TLITE) + #include "yaml_datastructs_tlite.cpp" + #elif defined(RADIO_TX12) + #include "yaml_datastructs_tx12.cpp" + #elif defined(RADIO_T8) + #include "yaml_datastructs_t8.cpp" + #else + #include "yaml_datastructs_x7.cpp" + #endif +#elif defined(PCBX9LITE) + #include "yaml_datastructs_x9lite.cpp" +#elif defined(PCBX9LITES) + #include "yaml_datastructs_x9lites.cpp" +#elif defined(PCBXLITE) + #include "yaml_datastructs_xlite.cpp" +#elif defined(PCBXLITES) + #include "yaml_datastructs_xlites.cpp" +#elif defined(PCBX9E) + #include "yaml_datastructs_x9e.cpp" +#elif defined(PCBX9D) || defined(PCBX9DP) + #include "yaml_datastructs_x9d.cpp" +#else +#error "Board not supported by YAML storage" +#endif + +static_assert(MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN, + "MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN"); + +}; diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp new file mode 100644 index 000000000..c2117cf67 --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp @@ -0,0 +1,605 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include + +//#include "bitfield.h" +#include "dataconstants_220.h" +#include "datastructs_220.h" +#include "myeeprom_220.h" + +#define GVAR_SMALL 128 +#define VOLUME_LEVEL_DEF 12 + +#define in_read_weight nullptr + +static bool in_write_weight(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + int32_t sval = yaml_to_signed(val,node->size); + + if (sval > GVAR_SMALL-11 && sval < GVAR_SMALL-1) { + char n = GVAR_SMALL - sval + '0'; + return wf(opaque, "-GV", 3) && wf(opaque, &n, 1); + } + else if (sval < -GVAR_SMALL+11 && sval > -GVAR_SMALL+1) { + char n = val - GVAR_SMALL + '1'; + return wf(opaque, "GV", 2) && wf(opaque, &n, 1); + } + + char* s = yaml_signed2str(sval); + return wf(opaque, s, strlen(s)); +} + +extern const struct YamlIdStr enum_MixSources[]; + +#define r_mixSrcRaw nullptr + +static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + const char* str = nullptr; + + if (val >= MIXSRC_FIRST_INPUT + && val <= MIXSRC_LAST_INPUT) { + + if (!wf(opaque, "I", 1)) + return false; + + str = yaml_unsigned2str(val - MIXSRC_FIRST_INPUT); + } + else { + str = yaml_output_enum(val, enum_MixSources); + } + + if (str) { + return wf(opaque, str, strlen(str)); + } + + return true; +} + +#define r_vbat_min nullptr + +static bool w_vbat_min(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + char* s = yaml_signed2str(yaml_to_signed(val,node->size) + 90); + return wf(opaque, s, strlen(s)); +} + +#define r_vbat_max nullptr + +static bool w_vbat_max(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + char* s = yaml_signed2str(yaml_to_signed(val,node->size) + 120); + return wf(opaque, s, strlen(s)); +} + +#if defined(COLORLCD) +static uint8_t select_zov(uint8_t* data, uint32_t bitoffs) +{ + data += bitoffs >> 3UL; + data -= sizeof(ZoneOptionValueEnum); + ZoneOptionValueEnum* p_zovt = (ZoneOptionValueEnum*)data; + return *p_zovt; +} +#endif + +static uint8_t select_mod_type(uint8_t* data, uint32_t bitoffs) +{ + data += bitoffs >> 3UL; + data -= offsetof(ModuleData, ppm); + + ModuleData* mod_data = reinterpret_cast(data); + switch(mod_data->type) { + case MODULE_TYPE_NONE: + case MODULE_TYPE_PPM: + case MODULE_TYPE_DSM2: + case MODULE_TYPE_CROSSFIRE: + case MODULE_TYPE_GHOST: + return 1; + case MODULE_TYPE_MULTIMODULE: + return 2; + case MODULE_TYPE_XJT_PXX1: + case MODULE_TYPE_R9M_PXX1: + case MODULE_TYPE_R9M_LITE_PXX1: + return 3; + case MODULE_TYPE_SBUS: + return 4; + case MODULE_TYPE_ISRM_PXX2: + case MODULE_TYPE_R9M_PXX2: + case MODULE_TYPE_R9M_LITE_PXX2: + case MODULE_TYPE_R9M_LITE_PRO_PXX2: + case MODULE_TYPE_XJT_LITE_PXX2: + return 5; + case MODULE_TYPE_FLYSKY: + if (mod_data->subType == FLYSKY_SUBTYPE_AFHDS2A) + return 6; + if (mod_data->subType == FLYSKY_SUBTYPE_AFHDS3) + return 7; + } + return 0; +} + +static uint8_t select_custom_fn(uint8_t* data, uint32_t bitoffs) +{ + // always use 'all' + //TODO + return 1; +} + +static uint8_t select_script_input(uint8_t* data, uint32_t bitoffs) +{ + // always use 'value' + return 0; +} + +static uint8_t select_id1(uint8_t* data, uint32_t bitoffs) +{ + // always use 'id' + return 0; +} + +static uint8_t select_id2(uint8_t* data, uint32_t bitoffs) +{ + // always use 'instance' + return 0; +} + +static uint8_t select_sensor_cfg(uint8_t* data, uint32_t bitoffs) +{ + // always use 'param' + return 5; +} + +#if 0 +static uint32_t sw_read(const char* val, uint8_t val_len) +{ + uint32_t sw = yaml_parse_enum(enum_MixSources, val, val_len); + if (sw >= MIXSRC_FIRST_SWITCH) + return sw - MIXSRC_FIRST_SWITCH; + + return -1; +} +#endif + +static bool sw_write(uint32_t idx, yaml_writer_func wf, void* opaque) +{ + const char* str = yaml_output_enum(idx + MIXSRC_FIRST_SWITCH, enum_MixSources); + return str ? wf(opaque, str, strlen(str)) : true; +} + +#if 0 +static void r_stick_name(const YamlNode* node, uint8_t* data, + uint32_t bitoffs, uint16_t idx, + const char* val, uint8_t val_len) +{ + data -= offsetof(RadioData, switchConfig); + RadioData* rd = reinterpret_cast(data); + strncpy(rd->anaNames[idx], val, std::min(val_len, LEN_ANA_NAME)); +} +#endif + +static bool w_stick_name(const YamlNode* node, uint8_t* data, + uint32_t bitoffs, uint16_t idx, + yaml_writer_func wf, void* opaque) +{ + data -= offsetof(RadioData, switchConfig); + RadioData* rd = reinterpret_cast(data); + return wf(opaque, rd->anaNames[idx], strnlen(rd->anaNames[idx], LEN_ANA_NAME)); +} + +static bool stick_name_valid(uint8_t* data, uint32_t bitoffs, uint16_t idx) +{ + RadioData* rd = reinterpret_cast(data); + return rd->anaNames[idx][0] != '\0'; +} + +static const struct YamlNode struct_sticksConfig[] = { + YAML_IDX, + YAML_CUSTOM( "name", nullptr, w_stick_name), + YAML_END +}; + +#if 0 +static void sw_name_read(const YamlNode* node, uint8_t* data, uint32_t bitoffs, + uint16_t idx, const char* val, uint8_t val_len) +{ + // data / bitoffs already incremented + data -= ((idx + 1) * 2) / 8; + data -= offsetof(RadioData, switchConfig); + + RadioData* rd = reinterpret_cast(data); + strncpy(rd->switchNames[idx], val, std::min(val_len, LEN_SWITCH_NAME)); +} +#endif + +static bool sw_name_write(const YamlNode* node, uint8_t* data, uint32_t bitoffs, + uint16_t idx, yaml_writer_func wf, void* opaque) +{ + // data / bitoffs already incremented + data -= ((idx + 1) * 2) / 8; + data -= offsetof(RadioData, switchConfig); + + RadioData* rd = reinterpret_cast(data); + const char* str = rd->switchNames[idx]; + return wf(opaque, str, strnlen(str, LEN_SWITCH_NAME)); +} + +static const struct YamlIdStr enum_SwitchConfig[] = { + { SWITCH_NONE, "none" }, + { SWITCH_TOGGLE, "toggle" }, + { SWITCH_2POS, "2pos" }, + { SWITCH_3POS, "3pos" }, + { 0, NULL } +}; + +static const struct YamlNode struct_switchConfig[] = { + YAML_IDX_CUST( "sw", nullptr, sw_write ), + YAML_ENUM( "type", 2, enum_SwitchConfig), + YAML_CUSTOM( "name", nullptr, sw_name_write), + YAML_END +}; + +#if 0 +static uint32_t pot_read(const char* val, uint8_t val_len) +{ + uint32_t pot = yaml_parse_enum(enum_MixSources, val, val_len); + if (pot >= MIXSRC_FIRST_POT) + return pot - MIXSRC_FIRST_POT; + + return -1; +} +#endif + +static bool pot_write(uint32_t idx, yaml_writer_func wf, void* opaque) +{ + const char* str = yaml_output_enum(idx + MIXSRC_FIRST_POT, enum_MixSources); + return str ? wf(opaque, str, strlen(str)) : true; +} + +#if 0 +static void pot_name_read(const YamlNode* node, uint8_t* data, uint32_t bitoffs, + uint16_t idx, const char* val, uint8_t val_len) +{ + // data / bitoffs already incremented + data -= ((idx + 1) * 2) / 8; + data -= offsetof(RadioData, potsConfig); + + RadioData* rd = reinterpret_cast(data); + idx += NUM_STICKS; + strncpy(rd->anaNames[idx], val, std::min(val_len, LEN_ANA_NAME)); +} +#endif + +static bool pot_name_write(const YamlNode* node, uint8_t* data, uint32_t bitoffs, + uint16_t idx, yaml_writer_func wf, void* opaque) +{ + // data / bitoffs already incremented + data -= ((idx + 1) * 2) / 8; + data -= offsetof(RadioData, potsConfig); + + RadioData* rd = reinterpret_cast(data); + idx += NUM_STICKS; + const char* str = rd->anaNames[idx]; + return wf(opaque, str, strnlen(str, LEN_ANA_NAME)); +} + +static const struct YamlIdStr enum_PotConfig[] = { + { POT_NONE, "none" }, + { POT_WITH_DETENT, "with_detent" }, + { POT_MULTIPOS_SWITCH, "multipos_switch" }, + { POT_WITHOUT_DETENT, "without_detent" }, + { 0, NULL } +}; + +static const struct YamlNode struct_potConfig[] = { + YAML_IDX_CUST( "pot", nullptr, pot_write ), + YAML_ENUM( "type", 2, enum_PotConfig), + YAML_CUSTOM( "name", nullptr, pot_name_write), + YAML_END +}; + +#if 0 +static uint32_t slider_read(const char* val, uint8_t val_len) +{ + uint32_t sl = yaml_parse_enum(enum_MixSources, val, val_len); + if (sl >= MIXSRC_FIRST_SLIDER) + return sl - MIXSRC_FIRST_SLIDER; + + return -1; +} +#endif + +static bool slider_write(uint32_t idx, yaml_writer_func wf, void* opaque) +{ + const char* str = yaml_output_enum(idx + MIXSRC_FIRST_SLIDER, enum_MixSources); + return str ? wf(opaque, str, strlen(str)) : true; +} + +#if 0 +static void sl_name_read(const YamlNode* node, uint8_t* data, uint32_t bitoffs, + uint16_t idx, const char* val, uint8_t val_len) +{ + // data / bitoffs already incremented +#if defined(PCBTARANIS) + // Please note: + // slidersConfig is defined as a bit-field member, + // so let's take the next field and subtract 1 + // + data -= (idx + 4 /* bitsize previous field (auxSerialMode) */ + 1) / 8; + data -= offsetof(RadioData, potsConfig) - 1; +#else + data -= (idx + 1) / 8; + data -= offsetof(RadioData, slidersConfig); +#endif + + RadioData* rd = reinterpret_cast(data); + idx += NUM_STICKS + STORAGE_NUM_POTS; + strncpy(rd->anaNames[idx], val, std::min(val_len, LEN_ANA_NAME)); +} +#endif + +static bool sl_name_write(const YamlNode* node, uint8_t* data, uint32_t bitoffs, + uint16_t idx, yaml_writer_func wf, void* opaque) +{ + // data / bitoffs already incremented +#if defined(PCBTARANIS) + // Please note: + // slidersConfig is defined as a bit-field member, + // so let's take the next field and subtract 1 + // + data -= (idx + 4 /* bitsize previous field (auxSerialMode) */ + 1) / 8; + data -= offsetof(RadioData, potsConfig) - 1; +#else + data -= (idx + 1) / 8; + data -= offsetof(RadioData, slidersConfig); +#endif + + RadioData* rd = reinterpret_cast(data); + idx += NUM_STICKS + STORAGE_NUM_POTS; + const char* str = rd->anaNames[idx]; + return wf(opaque, str, strnlen(str, LEN_ANA_NAME)); +} + +static const struct YamlIdStr enum_SliderConfig[] = { + { SLIDER_NONE, "none" }, + { SLIDER_WITH_DETENT, "with_detent" }, + { 0, NULL } +}; + +static const struct YamlNode struct_sliderConfig[] = { + YAML_IDX_CUST( "sl", nullptr, slider_write ), + YAML_ENUM( "type", 1, enum_SliderConfig), + YAML_CUSTOM( "name", nullptr, sl_name_write), + YAML_END +}; + +extern const struct YamlIdStr enum_SwitchSources[]; + +#define r_swtchSrc nullptr + +static bool w_swtchSrc(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + int32_t sval = yaml_to_signed(val, node->size); + if (sval < 0) { + wf(opaque, "!", 1); + sval = abs(sval); + } + + const char* str = NULL; + if (sval >= SWSRC_FIRST_LOGICAL_SWITCH + && sval <= SWSRC_LAST_LOGICAL_SWITCH) { + + wf(opaque, "L", 1); + str = yaml_unsigned2str(sval - SWSRC_FIRST_LOGICAL_SWITCH + 1); + return wf(opaque,str, strlen(str)); + } +#if NUM_XPOTS > 0 + else if (sval >= SWSRC_FIRST_MULTIPOS_SWITCH + && sval <= SWSRC_LAST_MULTIPOS_SWITCH) { + + wf(opaque, "6P", 2); + + // pot #: start with 6P1 + sval -= SWSRC_FIRST_MULTIPOS_SWITCH; + str = yaml_unsigned2str(sval / XPOTS_MULTIPOS_COUNT); + wf(opaque,str, strlen(str)); + + // position + str = yaml_unsigned2str(sval % XPOTS_MULTIPOS_COUNT); + return wf(opaque,str, strlen(str)); + } +#endif + else if (sval >= SWSRC_FIRST_FLIGHT_MODE + && sval <= SWSRC_LAST_FLIGHT_MODE) { + + wf(opaque, "FM", 2); + str = yaml_unsigned2str(sval - SWSRC_FIRST_FLIGHT_MODE + 1); + return wf(opaque,str, strlen(str)); + } + else if (sval >= SWSRC_FIRST_SENSOR + && sval <= SWSRC_LAST_SENSOR) { + + wf(opaque, "T", 2); + str = yaml_unsigned2str(sval - SWSRC_FIRST_SENSOR + 1); + return wf(opaque,str, strlen(str)); + } + + str = yaml_output_enum(sval, enum_SwitchSources); + return wf(opaque, str, strlen(str)); +} + +static bool cfn_is_active(uint8_t* data, uint32_t bitoffs, uint16_t idx) +{ + data += bitoffs >> 3UL; + return ((CustomFunctionData*)data)->swtch; +} + +static bool gvar_is_active(uint8_t* data, uint32_t bitoffs, uint16_t idx) +{ + gvar_t* gvar = (gvar_t*)(data + (bitoffs>>3UL)); + return *gvar != GVAR_MAX+1; +} + +static bool fmd_is_active(uint8_t* data, uint32_t bitoffs, uint16_t idx) +{ + uint32_t data_ofs = bitoffs >> 3UL; + if (data_ofs == offsetof(ModelData, flightModeData)) { + return !yaml_is_zero(data, bitoffs, sizeof(FlightModeData)*8); + } + + bool is_active = !yaml_is_zero(data, bitoffs, + (sizeof(FlightModeData) + - sizeof(FlightModeData::gvars))*8); + + FlightModeData* fmd = (FlightModeData*)(data + data_ofs); + for (uint8_t i=0; igvars[i] != GVAR_MAX+1; + } + + return is_active; +} + +#define r_swtchWarn nullptr + +static bool w_swtchWarn(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + for (int i = 0; i < STORAGE_NUM_SWITCHES; i++) { + //if (SWITCH_EXISTS(i)) { + + // decode check state + // -> 3 bits per switch + auto state = (val >> (3*i)) & 0x07; + + // state == 0 -> no check + // state == 1 -> UP + // state == 2 -> MIDDLE + // state == 3 -> DOWN + char swtchWarn[2] = {(char)('A' + i), 0}; + + switch (state) { + case 0: + break; + case 1: + swtchWarn[1] = 'u'; + break; + case 2: + swtchWarn[1] = '-'; + break; + case 3: + swtchWarn[1] = 'd'; + break; + default: + // this should never happen + swtchWarn[1] = 'x'; + break; + } + + if (swtchWarn[1] != 0) { + if (!wf(opaque, swtchWarn, 2)) { + return false; + } + } + //} + } + + return true; +} + +extern const struct YamlIdStr enum_BeeperMode[]; + +#define r_beeperMode nullptr + +static bool w_beeperMode(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + int32_t sval = yaml_to_signed(val,node->size); + const char* str = yaml_output_enum(sval, enum_BeeperMode); + return wf(opaque, str, strlen(str)); +} + +#define r_5pos nullptr + +static bool w_5pos(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + int32_t sval = yaml_to_signed(val,node->size); + char* s = yaml_signed2str(sval + 2); + return wf(opaque, s, strlen(s)); +} + +#define r_vol nullptr + +static bool w_vol(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + int32_t sval = yaml_to_signed(val,node->size); + char* s = yaml_signed2str(sval + VOLUME_LEVEL_DEF); + return wf(opaque, s, strlen(s)); +} + +#define r_spPitch nullptr + +static bool w_spPitch(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + char* s = yaml_signed2str(val * 15); + return wf(opaque, s, strlen(s)); +} + +#define r_vPitch nullptr + +static bool w_vPitch(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque) +{ + int32_t sval = yaml_to_signed(val,node->size); + char* s = yaml_signed2str(sval * 10); + return wf(opaque, s, strlen(s)); +} + +const struct YamlIdStr enum_TrainerMode[] = { +#if defined(PCBNV14) + { TRAINER_MODE_OFF, "OFF" }, +#endif + { TRAINER_MODE_MASTER_TRAINER_JACK, "MASTER_TRAINER_JACK" }, + { TRAINER_MODE_SLAVE, "SLAVE" }, +#if defined(PCBTARANIS) || defined(PCBNV14) + { TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE, "MASTER_SBUS_EXT" }, + { TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE, "MASTER_CPPM_EXT" }, +#endif +#if defined(PCBTARANIS) || defined(AUX_SERIAL) || defined(AUX2_SERIAL) + { TRAINER_MODE_MASTER_BATTERY_COMPARTMENT, "MASTER_BATT_COMP" }, +#endif + { TRAINER_MODE_MASTER_BLUETOOTH, "MASTER_BT" }, + { TRAINER_MODE_SLAVE_BLUETOOTH, "SLAVE_BT" }, + { TRAINER_MODE_MULTI, "MASTER_MULTI" }, + { 0, NULL } +}; + +#define r_trainerMode nullptr + +static bool w_trainerMode(const YamlNode* node, uint32_t val, + yaml_writer_func wf, void* opaque) +{ + const char* str = nullptr; + str = yaml_output_enum(val, enum_TrainerMode); + + if (str) { + return wf(opaque, str, strlen(str)); + } + + return true; +} diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_nv14.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_nv14.cpp new file mode 100644 index 000000000..cf510201a --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_nv14.cpp @@ -0,0 +1,858 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ZoneOptionValueEnum[] = { + { ZOV_Unsigned, "Unsigned" }, + { ZOV_Signed, "Signed" }, + { ZOV_Bool, "Bool" }, + { ZOV_String, "String" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SG, "SG" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SG0, "SG0" }, + { SWSRC_SG1, "SG1" }, + { SWSRC_SG2, "SG2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 48, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 48, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 48, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode union_ZoneOptionValue_elmts[] = { + YAML_UNSIGNED( "unsignedValue", 32 ), + YAML_SIGNED( "signedValue", 32 ), + YAML_UNSIGNED( "boolValue", 32 ), + YAML_STRING("stringValue", 8), + YAML_END +}; +static const struct YamlNode struct_ZoneOptionValueTyped[] = { + YAML_IDX, + YAML_ENUM("type", 32, enum_ZoneOptionValueEnum), + YAML_UNION("value", 64, union_ZoneOptionValue_elmts, select_zov), + YAML_END +}; +static const struct YamlNode struct_OpenTxTheme__PersistentData[] = { + YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 9, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_PADDING( 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_PADDING( 8 ), + YAML_UNSIGNED( "stickReverse", 8 ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ENUM("aux2SerialMode", 4, enum_UartModes), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr), + YAML_ARRAY("slidersConfig", 1, 8, struct_sliderConfig, nullptr), + YAML_PADDING( 192 ), + YAML_PADDING( 216 ), + YAML_STRING("currModelFilename", 17), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "blOffBright", 7 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("themeName", 8), + YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 15), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_STRING("bitmap", 14), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 10), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_UNSIGNED( "flysky_telemetry", 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 8 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode struct_string_32[] = { + YAML_IDX, + YAML_STRING("val", 4), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_WidgetPersistentData[] = { + YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_ZonePersistentData[] = { + YAML_IDX, + YAML_STRING("widgetName", 10), + YAML_STRUCT("widgetData", 480, struct_WidgetPersistentData, NULL), + YAML_END +}; +static const struct YamlNode struct_LayoutPersistentData[] = { + YAML_ARRAY("zones", 576, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("options", 96, 10, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomScreenData[] = { + YAML_IDX, + YAML_STRING("LayoutId", 10), + YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL), + YAML_END +}; +static const struct YamlNode struct_TopBarPersistentData[] = { + YAML_ARRAY("zones", 576, 2, struct_ZonePersistentData, NULL), + YAML_ARRAY("options", 96, 1, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 248, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 9, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 5, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), + YAML_ARRAY("screenData", 6800, 5, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 1248, struct_TopBarPersistentData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 248, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_t12.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_t12.cpp new file mode 100644 index 000000000..433343d0f --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_t12.cpp @@ -0,0 +1,831 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 192 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_t8.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_t8.cpp new file mode 100644 index 000000000..433343d0f --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_t8.cpp @@ -0,0 +1,831 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 192 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_tlite.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_tlite.cpp new file mode 100644 index 000000000..433343d0f --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_tlite.cpp @@ -0,0 +1,831 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 192 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_tx12.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_tx12.cpp new file mode 100644 index 000000000..658bf57bc --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_tx12.cpp @@ -0,0 +1,831 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 192 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x10.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x10.cpp new file mode 100644 index 000000000..45482c63f --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x10.cpp @@ -0,0 +1,875 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ZoneOptionValueEnum[] = { + { ZOV_Unsigned, "Unsigned" }, + { ZOV_Signed, "Signed" }, + { ZOV_Bool, "Bool" }, + { ZOV_String, "String" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_S1, "S1" }, + { MIXSRC_6POS, "6POS" }, + { MIXSRC_S2, "S2" }, + { MIXSRC_EXT1, "EXT1" }, + { MIXSRC_EXT2, "EXT2" }, + { MIXSRC_LS, "LS" }, + { MIXSRC_RS, "RS" }, + { MIXSRC_MOUSE1, "MOUSE1" }, + { MIXSRC_MOUSE2, "MOUSE2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_TrimT5, "TrimT5" }, + { MIXSRC_TrimT6, "TrimT6" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SG, "SG" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SG0, "SG0" }, + { SWSRC_SG1, "SG1" }, + { SWSRC_SG2, "SG2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_TrimT5Down, "TrimT5Down" }, + { SWSRC_TrimT5Up, "TrimT5Up" }, + { SWSRC_TrimT6Down, "TrimT6Down" }, + { SWSRC_TrimT6Up, "TrimT6Up" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 48, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 48, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 48, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode union_ZoneOptionValue_elmts[] = { + YAML_UNSIGNED( "unsignedValue", 32 ), + YAML_SIGNED( "signedValue", 32 ), + YAML_UNSIGNED( "boolValue", 32 ), + YAML_STRING("stringValue", 8), + YAML_END +}; +static const struct YamlNode struct_ZoneOptionValueTyped[] = { + YAML_IDX, + YAML_ENUM("type", 32, enum_ZoneOptionValueEnum), + YAML_UNION("value", 64, union_ZoneOptionValue_elmts, select_zov), + YAML_END +}; +static const struct YamlNode struct_OpenTxTheme__PersistentData[] = { + YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 15, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_PADDING( 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ENUM("aux2SerialMode", 4, enum_UartModes), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr), + YAML_ARRAY("slidersConfig", 1, 8, struct_sliderConfig, nullptr), + YAML_PADDING( 240 ), + YAML_PADDING( 312 ), + YAML_STRING("currModelFilename", 17), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "blOffBright", 7 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("themeName", 8), + YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 15), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_STRING("bitmap", 14), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 6, struct_trim_t, NULL), + YAML_STRING("name", 10), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode struct_string_32[] = { + YAML_IDX, + YAML_STRING("val", 4), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_WidgetPersistentData[] = { + YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_ZonePersistentData[] = { + YAML_IDX, + YAML_STRING("widgetName", 10), + YAML_STRUCT("widgetData", 480, struct_WidgetPersistentData, NULL), + YAML_END +}; +static const struct YamlNode struct_LayoutPersistentData[] = { + YAML_ARRAY("zones", 576, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("options", 96, 10, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomScreenData[] = { + YAML_IDX, + YAML_STRING("LayoutId", 10), + YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL), + YAML_END +}; +static const struct YamlNode struct_TopBarPersistentData[] = { + YAML_ARRAY("zones", 576, 4, struct_ZonePersistentData, NULL), + YAML_ARRAY("options", 96, 1, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 248, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 9, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 9, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), + YAML_ARRAY("screenData", 6800, 5, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 2400, struct_TopBarPersistentData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 248, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x12s.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x12s.cpp new file mode 100644 index 000000000..027e6d428 --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x12s.cpp @@ -0,0 +1,875 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ZoneOptionValueEnum[] = { + { ZOV_Unsigned, "Unsigned" }, + { ZOV_Signed, "Signed" }, + { ZOV_Bool, "Bool" }, + { ZOV_String, "String" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_S1, "S1" }, + { MIXSRC_6POS, "6POS" }, + { MIXSRC_S2, "S2" }, + { MIXSRC_S3, "S3" }, + { MIXSRC_S4, "S4" }, + { MIXSRC_LS, "LS" }, + { MIXSRC_RS, "RS" }, + { MIXSRC_MOUSE1, "MOUSE1" }, + { MIXSRC_MOUSE2, "MOUSE2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_TrimT5, "TrimT5" }, + { MIXSRC_TrimT6, "TrimT6" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SG, "SG" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SG0, "SG0" }, + { SWSRC_SG1, "SG1" }, + { SWSRC_SG2, "SG2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_TrimT5Down, "TrimT5Down" }, + { SWSRC_TrimT5Up, "TrimT5Up" }, + { SWSRC_TrimT6Down, "TrimT6Down" }, + { SWSRC_TrimT6Up, "TrimT6Up" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 48, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 48, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 48, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode union_ZoneOptionValue_elmts[] = { + YAML_UNSIGNED( "unsignedValue", 32 ), + YAML_SIGNED( "signedValue", 32 ), + YAML_UNSIGNED( "boolValue", 32 ), + YAML_STRING("stringValue", 8), + YAML_END +}; +static const struct YamlNode struct_ZoneOptionValueTyped[] = { + YAML_IDX, + YAML_ENUM("type", 32, enum_ZoneOptionValueEnum), + YAML_UNION("value", 64, union_ZoneOptionValue_elmts, select_zov), + YAML_END +}; +static const struct YamlNode struct_OpenTxTheme__PersistentData[] = { + YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 15, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_PADDING( 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ENUM("aux2SerialMode", 4, enum_UartModes), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr), + YAML_ARRAY("slidersConfig", 1, 8, struct_sliderConfig, nullptr), + YAML_PADDING( 240 ), + YAML_PADDING( 312 ), + YAML_STRING("currModelFilename", 17), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "blOffBright", 7 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("themeName", 8), + YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 15), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_STRING("bitmap", 14), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 6, struct_trim_t, NULL), + YAML_STRING("name", 10), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode struct_string_32[] = { + YAML_IDX, + YAML_STRING("val", 4), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_WidgetPersistentData[] = { + YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_ZonePersistentData[] = { + YAML_IDX, + YAML_STRING("widgetName", 10), + YAML_STRUCT("widgetData", 480, struct_WidgetPersistentData, NULL), + YAML_END +}; +static const struct YamlNode struct_LayoutPersistentData[] = { + YAML_ARRAY("zones", 576, 10, struct_ZonePersistentData, NULL), + YAML_ARRAY("options", 96, 10, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomScreenData[] = { + YAML_IDX, + YAML_STRING("LayoutId", 10), + YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL), + YAML_END +}; +static const struct YamlNode struct_TopBarPersistentData[] = { + YAML_ARRAY("zones", 576, 4, struct_ZonePersistentData, NULL), + YAML_ARRAY("options", 96, 1, struct_ZoneOptionValueTyped, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 248, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 9, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 9, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), + YAML_ARRAY("screenData", 6800, 5, struct_CustomScreenData, NULL), + YAML_STRUCT("topbarData", 2400, struct_TopBarPersistentData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 248, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x7.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x7.cpp new file mode 100644 index 000000000..433343d0f --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x7.cpp @@ -0,0 +1,831 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 192 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x9d.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x9d.cpp new file mode 100644 index 000000000..4ecd1fcfb --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x9d.cpp @@ -0,0 +1,846 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_POT3, "POT3" }, + { MIXSRC_SLIDER1, "SLIDER1" }, + { MIXSRC_SLIDER2, "SLIDER2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SG, "SG" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SG0, "SG0" }, + { SWSRC_SG1, "SG1" }, + { SWSRC_SG2, "SG2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 64, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 9, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 32 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), + YAML_PADDING( 216 ), + YAML_PADDING( 216 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 12), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_STRING("bitmap", 10), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 10), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode struct_string_32[] = { + YAML_IDX, + YAML_STRING("val", 4), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 3, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 48, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 192, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 16 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_UNSIGNED( "voltsSource", 8 ), + YAML_UNSIGNED( "altitudeSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 5, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 192, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x9e.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x9e.cpp new file mode 100644 index 000000000..506ce0e76 --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x9e.cpp @@ -0,0 +1,886 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_POT3, "POT3" }, + { MIXSRC_POT4, "POT4" }, + { MIXSRC_SLIDER1, "SLIDER1" }, + { MIXSRC_SLIDER2, "SLIDER2" }, + { MIXSRC_SLIDER3, "SLIDER3" }, + { MIXSRC_SLIDER4, "SLIDER4" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SG, "SG" }, + { MIXSRC_SH, "SH" }, + { MIXSRC_SI, "SI" }, + { MIXSRC_SJ, "SJ" }, + { MIXSRC_SK, "SK" }, + { MIXSRC_SL, "SL" }, + { MIXSRC_SM, "SM" }, + { MIXSRC_SN, "SN" }, + { MIXSRC_SO, "SO" }, + { MIXSRC_SP, "SP" }, + { MIXSRC_SQ, "SQ" }, + { MIXSRC_SR, "SR" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SG0, "SG0" }, + { SWSRC_SG1, "SG1" }, + { SWSRC_SG2, "SG2" }, + { SWSRC_SH0, "SH0" }, + { SWSRC_SH1, "SH1" }, + { SWSRC_SH2, "SH2" }, + { SWSRC_SI0, "SI0" }, + { SWSRC_SI1, "SI1" }, + { SWSRC_SI2, "SI2" }, + { SWSRC_SJ0, "SJ0" }, + { SWSRC_SJ1, "SJ1" }, + { SWSRC_SJ2, "SJ2" }, + { SWSRC_SK0, "SK0" }, + { SWSRC_SK1, "SK1" }, + { SWSRC_SK2, "SK2" }, + { SWSRC_SL0, "SL0" }, + { SWSRC_SL1, "SL1" }, + { SWSRC_SL2, "SL2" }, + { SWSRC_SM0, "SM0" }, + { SWSRC_SM1, "SM1" }, + { SWSRC_SM2, "SM2" }, + { SWSRC_SN0, "SN0" }, + { SWSRC_SN1, "SN1" }, + { SWSRC_SN2, "SN2" }, + { SWSRC_SO0, "SO0" }, + { SWSRC_SO1, "SO1" }, + { SWSRC_SO2, "SO2" }, + { SWSRC_SP0, "SP0" }, + { SWSRC_SP1, "SP1" }, + { SWSRC_SP2, "SP2" }, + { SWSRC_SQ0, "SQ0" }, + { SWSRC_SQ1, "SQ1" }, + { SWSRC_SQ2, "SQ2" }, + { SWSRC_SR0, "SR0" }, + { SWSRC_SR1, "SR1" }, + { SWSRC_SR2, "SR2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 64, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 12, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 64 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 32, struct_switchConfig, nullptr), + YAML_PADDING( 432 ), + YAML_PADDING( 288 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 12), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_STRING("bitmap", 10), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 8), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 10), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode struct_string_32[] = { + YAML_IDX, + YAML_STRING("val", 4), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 3, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 48, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 192, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 64, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 32 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_UNSIGNED( "voltsSource", 8 ), + YAML_UNSIGNED( "altitudeSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 8, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "toplcdTimer", 8 ), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 192, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x9lite.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x9lite.cpp new file mode 100644 index 000000000..8a2b98dad --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x9lite.cpp @@ -0,0 +1,816 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 5, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 120 ), + YAML_PADDING( 120 ), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 1, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_x9lites.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_x9lites.cpp new file mode 100644 index 000000000..245a52698 --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_x9lites.cpp @@ -0,0 +1,826 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SG, "SG" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_SG0, "SG0" }, + { SWSRC_SG1, "SG1" }, + { SWSRC_SG2, "SG2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 5, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 168 ), + YAML_PADDING( 120 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 1, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_xlite.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_xlite.cpp new file mode 100644 index 000000000..0d4de5fd3 --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_xlite.cpp @@ -0,0 +1,823 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 144 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_xlites.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_xlites.cpp new file mode 100644 index 000000000..aea0501cb --- /dev/null +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_xlites.cpp @@ -0,0 +1,827 @@ +// generated by generate_yaml.py + +// +// Enums first +// + +const struct YamlIdStr enum_BacklightMode[] = { + { e_backlight_mode_off, "backlight_mode_off" }, + { e_backlight_mode_keys, "backlight_mode_keys" }, + { e_backlight_mode_sticks, "backlight_mode_sticks" }, + { e_backlight_mode_all, "backlight_mode_all" }, + { e_backlight_mode_on, "backlight_mode_on" }, + { 0, NULL } +}; +const struct YamlIdStr enum_AntennaModes[] = { + { ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" }, + { ANTENNA_MODE_ASK, "MODE_ASK" }, + { ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" }, + { ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" }, + { ANTENNA_MODE_FIRST, "MODE_FIRST" }, + { ANTENNA_MODE_LAST, "MODE_LAST" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TrainerMultiplex[] = { + { TRAINER_OFF, "OFF" }, + { TRAINER_ADD, "ADD" }, + { TRAINER_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BeeperMode[] = { + { e_mode_quiet, "mode_quiet" }, + { e_mode_alarms, "mode_alarms" }, + { e_mode_nokeys, "mode_nokeys" }, + { e_mode_all, "mode_all" }, + { 0, NULL } +}; +const struct YamlIdStr enum_BluetoothModes[] = { + { BLUETOOTH_OFF, "OFF" }, + { BLUETOOTH_TELEMETRY, "TELEMETRY" }, + { BLUETOOTH_TRAINER, "TRAINER" }, + { BLUETOOTH_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_Functions[] = { + { FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" }, + { FUNC_TRAINER, "TRAINER" }, + { FUNC_INSTANT_TRIM, "INSTANT_TRIM" }, + { FUNC_RESET, "RESET" }, + { FUNC_SET_TIMER, "SET_TIMER" }, + { FUNC_ADJUST_GVAR, "ADJUST_GVAR" }, + { FUNC_VOLUME, "VOLUME" }, + { FUNC_SET_FAILSAFE, "SET_FAILSAFE" }, + { FUNC_RANGECHECK, "RANGECHECK" }, + { FUNC_BIND, "BIND" }, + { FUNC_FIRST_WITHOUT_ENABLE, "FIRST_WITHOUT_ENABLE" }, + { FUNC_PLAY_SOUND, "PLAY_SOUND" }, + { FUNC_PLAY_TRACK, "PLAY_TRACK" }, + { FUNC_PLAY_VALUE, "PLAY_VALUE" }, + { FUNC_RESERVE4, "RESERVE4" }, + { FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" }, + { FUNC_RESERVE5, "RESERVE5" }, + { FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" }, + { FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" }, + { FUNC_VARIO, "VARIO" }, + { FUNC_HAPTIC, "HAPTIC" }, + { FUNC_LOGS, "LOGS" }, + { FUNC_BACKLIGHT, "BACKLIGHT" }, + { FUNC_SCREENSHOT, "SCREENSHOT" }, + { FUNC_RACING_MODE, "RACING_MODE" }, + { FUNC_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_UartModes[] = { + { UART_MODE_NONE, "MODE_NONE" }, + { UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" }, + { UART_MODE_TELEMETRY, "MODE_TELEMETRY" }, + { UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" }, + { UART_MODE_LUA, "MODE_LUA" }, + { UART_MODE_COUNT, "MODE_COUNT" }, + { UART_MODE_MAX, "MODE_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_TimerModes[] = { + { TMRMODE_OFF, "OFF" }, + { TMRMODE_ON, "ON" }, + { TMRMODE_START, "START" }, + { TMRMODE_THR, "THR" }, + { TMRMODE_THR_REL, "THR_REL" }, + { TMRMODE_THR_START, "THR_START" }, + { TMRMODE_COUNT, "COUNT" }, + { TMRMODE_MAX, "MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixerMultiplex[] = { + { MLTPX_ADD, "ADD" }, + { MLTPX_MUL, "MUL" }, + { MLTPX_REPL, "REPL" }, + { 0, NULL } +}; +const struct YamlIdStr enum_MixSources[] = { + { MIXSRC_NONE, "NONE" }, + { MIXSRC_Rud, "Rud" }, + { MIXSRC_Ele, "Ele" }, + { MIXSRC_Thr, "Thr" }, + { MIXSRC_Ail, "Ail" }, + { MIXSRC_POT1, "POT1" }, + { MIXSRC_POT2, "POT2" }, + { MIXSRC_GYRO1, "GYRO1" }, + { MIXSRC_GYRO2, "GYRO2" }, + { MIXSRC_MAX, "MAX" }, + { MIXSRC_CYC1, "CYC1" }, + { MIXSRC_CYC2, "CYC2" }, + { MIXSRC_CYC3, "CYC3" }, + { MIXSRC_TrimRud, "TrimRud" }, + { MIXSRC_TrimEle, "TrimEle" }, + { MIXSRC_TrimThr, "TrimThr" }, + { MIXSRC_TrimAil, "TrimAil" }, + { MIXSRC_SA, "SA" }, + { MIXSRC_SB, "SB" }, + { MIXSRC_SC, "SC" }, + { MIXSRC_SD, "SD" }, + { MIXSRC_SE, "SE" }, + { MIXSRC_SF, "SF" }, + { MIXSRC_SW1, "SW1" }, + { MIXSRC_CH1, "CH1" }, + { MIXSRC_CH2, "CH2" }, + { MIXSRC_CH3, "CH3" }, + { MIXSRC_CH4, "CH4" }, + { MIXSRC_CH5, "CH5" }, + { MIXSRC_CH6, "CH6" }, + { MIXSRC_CH7, "CH7" }, + { MIXSRC_CH8, "CH8" }, + { MIXSRC_CH9, "CH9" }, + { MIXSRC_CH10, "CH10" }, + { MIXSRC_CH11, "CH11" }, + { MIXSRC_CH12, "CH12" }, + { MIXSRC_CH13, "CH13" }, + { MIXSRC_CH14, "CH14" }, + { MIXSRC_CH15, "CH15" }, + { MIXSRC_CH16, "CH16" }, + { MIXSRC_GVAR1, "GVAR1" }, + { MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" }, + { MIXSRC_TX_TIME, "TX_TIME" }, + { MIXSRC_TX_GPS, "TX_GPS" }, + { MIXSRC_TIMER1, "TIMER1" }, + { MIXSRC_TIMER2, "TIMER2" }, + { MIXSRC_TIMER3, "TIMER3" }, + { 0, NULL } +}; +const struct YamlIdStr enum_LogicalSwitchesFunctions[] = { + { LS_FUNC_NONE, "FUNC_NONE" }, + { LS_FUNC_VEQUAL, "FUNC_VEQUAL" }, + { LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" }, + { LS_FUNC_VPOS, "FUNC_VPOS" }, + { LS_FUNC_VNEG, "FUNC_VNEG" }, + { LS_FUNC_RANGE, "FUNC_RANGE" }, + { LS_FUNC_APOS, "FUNC_APOS" }, + { LS_FUNC_ANEG, "FUNC_ANEG" }, + { LS_FUNC_AND, "FUNC_AND" }, + { LS_FUNC_OR, "FUNC_OR" }, + { LS_FUNC_XOR, "FUNC_XOR" }, + { LS_FUNC_EDGE, "FUNC_EDGE" }, + { LS_FUNC_EQUAL, "FUNC_EQUAL" }, + { LS_FUNC_GREATER, "FUNC_GREATER" }, + { LS_FUNC_LESS, "FUNC_LESS" }, + { LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" }, + { LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" }, + { LS_FUNC_TIMER, "FUNC_TIMER" }, + { LS_FUNC_STICKY, "FUNC_STICKY" }, + { LS_FUNC_COUNT, "FUNC_COUNT" }, + { LS_FUNC_MAX, "FUNC_MAX" }, + { 0, NULL } +}; +const struct YamlIdStr enum_SwitchSources[] = { + { SWSRC_NONE, "NONE" }, + { SWSRC_SA0, "SA0" }, + { SWSRC_SA1, "SA1" }, + { SWSRC_SA2, "SA2" }, + { SWSRC_SB0, "SB0" }, + { SWSRC_SB1, "SB1" }, + { SWSRC_SB2, "SB2" }, + { SWSRC_SC0, "SC0" }, + { SWSRC_SC1, "SC1" }, + { SWSRC_SC2, "SC2" }, + { SWSRC_SD0, "SD0" }, + { SWSRC_SD1, "SD1" }, + { SWSRC_SD2, "SD2" }, + { SWSRC_SE0, "SE0" }, + { SWSRC_SE1, "SE1" }, + { SWSRC_SE2, "SE2" }, + { SWSRC_SF0, "SF0" }, + { SWSRC_SF1, "SF1" }, + { SWSRC_SF2, "SF2" }, + { SWSRC_TrimRudLeft, "TrimRudLeft" }, + { SWSRC_TrimRudRight, "TrimRudRight" }, + { SWSRC_TrimEleDown, "TrimEleDown" }, + { SWSRC_TrimEleUp, "TrimEleUp" }, + { SWSRC_TrimThrDown, "TrimThrDown" }, + { SWSRC_TrimThrUp, "TrimThrUp" }, + { SWSRC_TrimAilLeft, "TrimAilLeft" }, + { SWSRC_TrimAilRight, "TrimAilRight" }, + { SWSRC_SW1, "SW1" }, + { SWSRC_SW2, "SW2" }, + { SWSRC_ON, "ON" }, + { SWSRC_ONE, "ONE" }, + { SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" }, + { SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" }, + { SWSRC_OFF, "OFF" }, + { 0, NULL } +}; +const struct YamlIdStr enum_ModuleType[] = { + { MODULE_TYPE_NONE, "TYPE_NONE" }, + { MODULE_TYPE_PPM, "TYPE_PPM" }, + { MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" }, + { MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" }, + { MODULE_TYPE_DSM2, "TYPE_DSM2" }, + { MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" }, + { MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" }, + { MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" }, + { MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" }, + { MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" }, + { MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" }, + { MODULE_TYPE_GHOST, "TYPE_GHOST" }, + { MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" }, + { MODULE_TYPE_SBUS, "TYPE_SBUS" }, + { MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" }, + { MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" }, + { MODULE_TYPE_COUNT, "TYPE_COUNT" }, + { MODULE_TYPE_MAX, "TYPE_MAX" }, + { 0, NULL } +}; + +// +// Structs last +// + +static const struct YamlNode struct_CalibData[] = { + YAML_IDX, + YAML_SIGNED( "mid", 16 ), + YAML_SIGNED( "spanNeg", 16 ), + YAML_SIGNED( "spanPos", 16 ), + YAML_END +}; +static const struct YamlNode struct_signed_16[] = { + YAML_IDX, + YAML_SIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_TrainerMix[] = { + YAML_IDX, + YAML_UNSIGNED( "srcChn", 6 ), + YAML_ENUM("mode", 2, enum_TrainerMultiplex), + YAML_SIGNED( "studWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_TrainerData[] = { + YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL), + YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_1[] = { + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_anonymous_2[] = { + YAML_SIGNED( "val", 16 ), + YAML_UNSIGNED( "mode", 8 ), + YAML_UNSIGNED( "param", 8 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_3[] = { + YAML_SIGNED( "val1", 32 ), + YAML_PADDING( 32 ), + YAML_END +}; +static const struct YamlNode union_anonymous_0_elmts[] = { + YAML_STRUCT("play", 48, struct_anonymous_1, NULL), + YAML_STRUCT("all", 64, struct_anonymous_2, NULL), + YAML_STRUCT("clear", 64, struct_anonymous_3, NULL), + YAML_END +}; +static const struct YamlNode struct_CustomFunctionData[] = { + YAML_IDX, + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_ENUM("func", 7, enum_Functions), + YAML_UNION("fp", 64, union_anonymous_0_elmts, select_custom_fn), + YAML_UNSIGNED( "active", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_24[] = { + YAML_IDX, + YAML_STRING("val", 3), + YAML_END +}; +static const struct YamlNode struct_RadioData[] = { + YAML_UNSIGNED( "version", 8 ), + YAML_PADDING( 16 ), + YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL), + YAML_PADDING( 16 ), + YAML_SIGNED( "currModel", 8 ), + YAML_UNSIGNED( "contrast", 8 ), + YAML_UNSIGNED( "vBatWarn", 8 ), + YAML_SIGNED( "txVoltageCalibration", 8 ), + YAML_ENUM("backlightMode", 3, enum_BacklightMode), + YAML_ENUM("antennaMode", 2, enum_AntennaModes), + YAML_UNSIGNED( "disableRtcWarning", 1 ), + YAML_UNSIGNED( "keysBacklight", 1 ), + YAML_PADDING( 1 ), + YAML_STRUCT("trainer", 128, struct_TrainerData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "fai", 1 ), + YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ), + YAML_UNSIGNED( "alarmsFlash", 1 ), + YAML_UNSIGNED( "disableMemoryWarning", 1 ), + YAML_UNSIGNED( "disableAlarmWarning", 1 ), + YAML_UNSIGNED( "stickMode", 2 ), + YAML_SIGNED( "timezone", 5 ), + YAML_UNSIGNED( "adjustRTC", 1 ), + YAML_UNSIGNED( "inactivityTimer", 8 ), + YAML_UNSIGNED( "telemetryBaudrate", 3 ), + YAML_SIGNED( "splashMode", 3 ), + YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ), + YAML_SIGNED( "switchesDelay", 8 ), + YAML_UNSIGNED( "lightAutoOff", 8 ), + YAML_UNSIGNED( "templateSetup", 8 ), + YAML_SIGNED( "PPM_Multiplier", 8 ), + YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ), + YAML_UNSIGNED( "gpsFormat", 1 ), + YAML_UNSIGNED( "unexpectedShutdown", 1 ), + YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ), + YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ), + YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ), + YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ), + YAML_UNSIGNED( "backlightBright", 8 ), + YAML_UNSIGNED( "globalTimer", 32 ), + YAML_UNSIGNED( "bluetoothBaudrate", 4 ), + YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes), + YAML_UNSIGNED( "countryCode", 2 ), + YAML_SIGNED( "pwrOnSpeed", 3 ), + YAML_SIGNED( "pwrOffSpeed", 3 ), + YAML_UNSIGNED( "imperial", 1 ), + YAML_UNSIGNED( "jitterFilter", 1 ), + YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ), + YAML_UNSIGNED( "USBMode", 2 ), + YAML_UNSIGNED( "jackMode", 2 ), + YAML_PADDING( 1 ), + YAML_STRING("ttsLanguage", 2), + YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ), + YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), + YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), + YAML_SIGNED( "varioRepeat", 8 ), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_ENUM("auxSerialMode", 4, enum_UartModes), + YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), + YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), + YAML_UNSIGNED( "backlightColor", 8 ), + YAML_UNSIGNED( "switchUnlockStates", 16 ), + YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), + YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr), + YAML_PADDING( 144 ), + YAML_PADDING( 144 ), + YAML_PADDING( 8 ), + YAML_STRING("bluetoothName", 10), + YAML_STRING("ownerRegistrationID", 8), + YAML_SIGNED( "gyroMax", 8 ), + YAML_SIGNED( "gyroOffset", 8 ), + YAML_SIGNED( "uartSampleMode", 2 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_8[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_ModelHeader[] = { + YAML_STRING("name", 10), + YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_TimerData[] = { + YAML_IDX, + YAML_UNSIGNED( "start", 22 ), + YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), + YAML_SIGNED( "value", 22 ), + YAML_ENUM("mode", 3, enum_TimerModes), + YAML_UNSIGNED( "countdownBeep", 2 ), + YAML_UNSIGNED( "minuteBeep", 1 ), + YAML_UNSIGNED( "persistent", 2 ), + YAML_SIGNED( "countdownStart", 2 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_CurveRef[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_SIGNED( "value", 8 ), + YAML_END +}; +static const struct YamlNode struct_MixData[] = { + YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ), + YAML_UNSIGNED( "destCh", 5 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_UNSIGNED( "carryTrim", 1 ), + YAML_UNSIGNED( "mixWarn", 2 ), + YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_PADDING( 1 ), + YAML_SIGNED( "offset", 14 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_UNSIGNED( "delayUp", 8 ), + YAML_UNSIGNED( "delayDown", 8 ), + YAML_UNSIGNED( "speedUp", 8 ), + YAML_UNSIGNED( "speedDown", 8 ), + YAML_STRING("name", 6), + YAML_END +}; +static const struct YamlNode struct_LimitData[] = { + YAML_IDX, + YAML_SIGNED( "min", 11 ), + YAML_SIGNED( "max", 11 ), + YAML_SIGNED( "ppmCenter", 10 ), + YAML_SIGNED( "offset", 11 ), + YAML_UNSIGNED( "symetrical", 1 ), + YAML_UNSIGNED( "revert", 1 ), + YAML_PADDING( 3 ), + YAML_SIGNED( "curve", 8 ), + YAML_STRING("name", 4), + YAML_END +}; +static const struct YamlNode struct_ExpoData[] = { + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "scale", 14 ), + YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ), + YAML_SIGNED( "carryTrim", 6 ), + YAML_UNSIGNED( "chn", 5 ), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_UNSIGNED( "flightModes", 9 ), + YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ), + YAML_PADDING( 1 ), + YAML_STRING("name", 6), + YAML_SIGNED( "offset", 8 ), + YAML_STRUCT("curve", 16, struct_CurveRef, NULL), + YAML_END +}; +static const struct YamlNode struct_CurveHeader[] = { + YAML_IDX, + YAML_UNSIGNED( "type", 1 ), + YAML_UNSIGNED( "smooth", 1 ), + YAML_SIGNED( "points", 6 ), + YAML_STRING("name", 3), + YAML_END +}; +static const struct YamlNode struct_signed_8[] = { + YAML_IDX, + YAML_SIGNED( "val", 8 ), + YAML_END +}; +static const struct YamlNode struct_LogicalSwitchData[] = { + YAML_IDX, + YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions), + YAML_SIGNED( "v1", 10 ), + YAML_SIGNED( "v3", 10 ), + YAML_SIGNED( "andsw", 9 ), + YAML_UNSIGNED( "andswtype", 1 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "v2", 16 ), + YAML_UNSIGNED( "delay", 8 ), + YAML_UNSIGNED( "duration", 8 ), + YAML_END +}; +static const struct YamlNode struct_SwashRingData[] = { + YAML_UNSIGNED( "type", 8 ), + YAML_UNSIGNED( "value", 8 ), + YAML_UNSIGNED( "collectiveSource", 8 ), + YAML_UNSIGNED( "aileronSource", 8 ), + YAML_UNSIGNED( "elevatorSource", 8 ), + YAML_SIGNED( "collectiveWeight", 8 ), + YAML_SIGNED( "aileronWeight", 8 ), + YAML_SIGNED( "elevatorWeight", 8 ), + YAML_END +}; +static const struct YamlNode struct_trim_t[] = { + YAML_IDX, + YAML_SIGNED( "value", 11 ), + YAML_UNSIGNED( "mode", 5 ), + YAML_END +}; +static const struct YamlNode struct_FlightModeData[] = { + YAML_IDX, + YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL), + YAML_STRING("name", 6), + YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ), + YAML_PADDING( 7 ), + YAML_UNSIGNED( "fadeIn", 8 ), + YAML_UNSIGNED( "fadeOut", 8 ), + YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active), + YAML_END +}; +static const struct YamlNode struct_GVarData[] = { + YAML_IDX, + YAML_STRING("name", 3), + YAML_UNSIGNED( "min", 12 ), + YAML_UNSIGNED( "max", 12 ), + YAML_UNSIGNED( "popup", 1 ), + YAML_UNSIGNED( "prec", 1 ), + YAML_UNSIGNED( "unit", 2 ), + YAML_PADDING( 4 ), + YAML_END +}; +static const struct YamlNode struct_VarioData[] = { + YAML_UNSIGNED( "source", 7 ), + YAML_UNSIGNED( "centerSilent", 1 ), + YAML_SIGNED( "centerMax", 8 ), + YAML_SIGNED( "centerMin", 8 ), + YAML_SIGNED( "min", 8 ), + YAML_SIGNED( "max", 8 ), + YAML_END +}; +static const struct YamlNode struct_RssiAlarmData[] = { + YAML_SIGNED( "disabled", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "warning", 6 ), + YAML_PADDING( 2 ), + YAML_SIGNED( "critical", 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_5[] = { + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_UNSIGNED( "outputType", 1 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_6[] = { + YAML_UNSIGNED( "rfProtocolExtra", 3 ), + YAML_UNSIGNED( "disableTelemetry", 1 ), + YAML_UNSIGNED( "disableMapping", 1 ), + YAML_UNSIGNED( "customProto", 1 ), + YAML_UNSIGNED( "autoBindMode", 1 ), + YAML_UNSIGNED( "lowPowerMode", 1 ), + YAML_SIGNED( "optionValue", 8 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_PADDING( 6 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_7[] = { + YAML_UNSIGNED( "power", 2 ), + YAML_PADDING( 2 ), + YAML_UNSIGNED( "receiverTelemetryOff", 1 ), + YAML_UNSIGNED( "receiverHigherChannels", 1 ), + YAML_SIGNED( "antennaMode", 2 ), + YAML_PADDING( 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_8[] = { + YAML_PADDING( 6 ), + YAML_UNSIGNED( "noninverted", 1 ), + YAML_PADDING( 1 ), + YAML_SIGNED( "refreshRate", 8 ), + YAML_END +}; +static const struct YamlNode struct_string_64[] = { + YAML_IDX, + YAML_STRING("val", 8), + YAML_END +}; +static const struct YamlNode struct_anonymous_9[] = { + YAML_UNSIGNED( "receivers", 7 ), + YAML_UNSIGNED( "racingMode", 1 ), + YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_10[] = { + YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 3 ), + YAML_UNSIGNED( "rfPower", 1 ), + YAML_UNSIGNED( "reserved", 4 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_11[] = { + YAML_UNSIGNED( "bindPower", 3 ), + YAML_UNSIGNED( "runPower", 3 ), + YAML_UNSIGNED( "emi", 1 ), + YAML_UNSIGNED( "telemetry", 1 ), + YAML_UNSIGNED( "failsafeTimeout", 16 ), + YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL), + YAML_UNSIGNED( "mode", 2 ), + YAML_UNSIGNED( "reserved", 6 ), + YAML_END +}; +static const struct YamlNode union_anonymous_4_elmts[] = { + YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL), + YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL), + YAML_STRUCT("multi", 24, struct_anonymous_6, NULL), + YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL), + YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL), + YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL), + YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL), + YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL), + YAML_END +}; +static const struct YamlNode struct_ModuleData[] = { + YAML_IDX, + YAML_ENUM("type", 4, enum_ModuleType), + YAML_SIGNED( "rfProtocol", 4 ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_UNSIGNED( "failsafeMode", 4 ), + YAML_UNSIGNED( "subType", 3 ), + YAML_UNSIGNED( "invertedSerial", 1 ), + YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type), + YAML_END +}; +static const struct YamlNode struct_TrainerModuleData[] = { + YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ), + YAML_UNSIGNED( "channelsStart", 8 ), + YAML_SIGNED( "channelsCount", 8 ), + YAML_SIGNED( "frameLength", 8 ), + YAML_SIGNED( "delay", 6 ), + YAML_UNSIGNED( "pulsePol", 1 ), + YAML_PADDING( 1 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput_elmts[] = { + YAML_SIGNED( "value", 16 ), + YAML_UNSIGNED( "source", 16 ), + YAML_END +}; +static const struct YamlNode union_ScriptDataInput[] = { + YAML_IDX, + YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input), + YAML_END +}; +static const struct YamlNode struct_ScriptData[] = { + YAML_IDX, + YAML_STRING("file", 6), + YAML_STRING("name", 6), + YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL), + YAML_END +}; +static const struct YamlNode union_anonymous_12_elmts[] = { + YAML_UNSIGNED( "id", 16 ), + YAML_UNSIGNED( "persistentValue", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_14[] = { + YAML_UNSIGNED( "physID", 5 ), + YAML_UNSIGNED( "rxIndex", 3 ), + YAML_END +}; +static const struct YamlNode union_anonymous_13_elmts[] = { + YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL), + YAML_UNSIGNED( "instance", 8 ), + YAML_UNSIGNED( "formula", 8 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_16[] = { + YAML_UNSIGNED( "ratio", 16 ), + YAML_SIGNED( "offset", 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_17[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_UNSIGNED( "index", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_18[] = { + YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL), + YAML_END +}; +static const struct YamlNode struct_anonymous_19[] = { + YAML_UNSIGNED( "source", 8 ), + YAML_PADDING( 24 ), + YAML_END +}; +static const struct YamlNode struct_anonymous_20[] = { + YAML_UNSIGNED( "gps", 8 ), + YAML_UNSIGNED( "alt", 8 ), + YAML_PADDING( 16 ), + YAML_END +}; +static const struct YamlNode union_anonymous_15_elmts[] = { + YAML_STRUCT("custom", 32, struct_anonymous_16, NULL), + YAML_STRUCT("cell", 32, struct_anonymous_17, NULL), + YAML_STRUCT("calc", 32, struct_anonymous_18, NULL), + YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL), + YAML_STRUCT("dist", 32, struct_anonymous_20, NULL), + YAML_UNSIGNED( "param", 32 ), + YAML_END +}; +static const struct YamlNode struct_TelemetrySensor[] = { + YAML_IDX, + YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1), + YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2), + YAML_STRING("label", 4), + YAML_UNSIGNED( "subId", 8 ), + YAML_UNSIGNED( "type", 1 ), + YAML_PADDING( 1 ), + YAML_UNSIGNED( "unit", 6 ), + YAML_UNSIGNED( "prec", 2 ), + YAML_UNSIGNED( "autoOffset", 1 ), + YAML_UNSIGNED( "filter", 1 ), + YAML_UNSIGNED( "logs", 1 ), + YAML_UNSIGNED( "persistent", 1 ), + YAML_UNSIGNED( "onlyPositive", 1 ), + YAML_PADDING( 1 ), + YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg), + YAML_END +}; +static const struct YamlNode struct_FrSkyBarData[] = { + YAML_IDX, + YAML_UNSIGNED( "source", 16 ), + YAML_SIGNED( "barMin", 16 ), + YAML_SIGNED( "barMax", 16 ), + YAML_END +}; +static const struct YamlNode struct_unsigned_16[] = { + YAML_IDX, + YAML_UNSIGNED( "val", 16 ), + YAML_END +}; +static const struct YamlNode struct_FrSkyLineData[] = { + YAML_IDX, + YAML_ARRAY("sources", 16, 2, struct_unsigned_16, NULL), + YAML_END +}; +static const struct YamlNode struct_TelemetryScriptData[] = { + YAML_STRING("file", 6), + YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData_elmts[] = { + YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL), + YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL), + YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL), + YAML_END +}; +static const struct YamlNode union_TelemetryScreenData[] = { + YAML_IDX, + YAML_UNION("u", 192, union_TelemetryScreenData_elmts, NULL), + YAML_END +}; +static const struct YamlNode struct_ModelData[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_UNSIGNED( "telemetryProtocol", 3 ), + YAML_UNSIGNED( "thrTrim", 1 ), + YAML_UNSIGNED( "noGlobalFunctions", 1 ), + YAML_UNSIGNED( "displayTrims", 2 ), + YAML_UNSIGNED( "ignoreSensorIds", 1 ), + YAML_SIGNED( "trimInc", 3 ), + YAML_UNSIGNED( "disableThrottleWarning", 1 ), + YAML_UNSIGNED( "displayChecklist", 1 ), + YAML_UNSIGNED( "extendedLimits", 1 ), + YAML_UNSIGNED( "extendedTrims", 1 ), + YAML_UNSIGNED( "throttleReversed", 1 ), + YAML_UNSIGNED( "beepANACenter", 16 ), + YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL), + YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL), + YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), + YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), + YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), + YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), + YAML_STRUCT("swashR", 64, struct_SwashRingData, NULL), + YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), + YAML_UNSIGNED( "thrTraceSrc", 8 ), + YAML_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ), + YAML_UNSIGNED( "switchWarningEnable", 8 ), + YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL), + YAML_STRUCT("varioData", 40, struct_VarioData, NULL), + YAML_UNSIGNED( "rssiSource", 8 ), + YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL), + YAML_PADDING( 3 ), + YAML_UNSIGNED( "thrTrimSw", 3 ), + YAML_UNSIGNED( "potsWarnMode", 2 ), + YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL), + YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL), + YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL), + YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL), + YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL), + YAML_UNSIGNED( "potsWarnEnabled", 8 ), + YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL), + YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL), + YAML_UNSIGNED( "screensType", 8 ), + YAML_ARRAY("screens", 192, 4, union_TelemetryScreenData, NULL), + YAML_UNSIGNED( "view", 8 ), + YAML_STRING("modelRegistrationID", 8), + YAML_END +}; +static const struct YamlNode struct_PartialModel[] = { + YAML_STRUCT("header", 96, struct_ModelHeader, NULL), + YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL), + YAML_END +}; + +#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24 + +static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData ); + +const YamlNode* get_radiodata_nodes() +{ + return &__RadioData_root_node; +} +static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData ); + +const YamlNode* get_modeldata_nodes() +{ + return &__ModelData_root_node; +} +static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel ); + +const YamlNode* get_partialmodel_nodes() +{ + return &__PartialModel_root_node; +} + diff --git a/radio/src/storage/conversions/yaml/zone_220.h b/radio/src/storage/conversions/yaml/zone_220.h new file mode 100644 index 000000000..5e9471bbb --- /dev/null +++ b/radio/src/storage/conversions/yaml/zone_220.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#pragma once + +#define LEN_ZONE_OPTION_STRING 8 + +union ZoneOptionValue +{ + uint32_t unsignedValue; + int32_t signedValue; + uint32_t boolValue; + char stringValue[LEN_ZONE_OPTION_STRING]; +}; + +enum ZoneOptionValueEnum { + ZOV_Unsigned=0, + ZOV_Signed, + ZOV_Bool, + ZOV_String +}; + +struct ZoneOption +{ + enum Type { + Integer, + Source, + Bool, + String, + File, + TextSize, + Timer, + Switch, + Color + }; + + const char * name; + Type type; + ZoneOptionValue deflt; + ZoneOptionValue min; + ZoneOptionValue max; +}; + +struct ZoneOptionValueTyped +{ + ZoneOptionValueEnum type; + ZoneOptionValue value FUNC(select_zov); +};