From 85bba67e4130581bfff01e0cce135391bf7c6b3f Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Sat, 12 Apr 2025 02:55:19 +0800 Subject: [PATCH 01/22] The first submission of the DRO1 device code originating from DumboRC. --- .github/ISSUE_TEMPLATE/bug-report.yml | 1 + .github/workflows/actions.yml | 2 + .github/workflows/nightly.yml | 1 + companion/src/CMakeLists.txt | 2 + companion/src/firmwares/boardjson.cpp | 2 +- companion/src/firmwares/boards.cpp | 8 + companion/src/firmwares/boards.h | 14 +- .../src/firmwares/opentx/opentxinterface.cpp | 12 +- fw.json | 3 +- radio/src/CMakeLists.txt | 4 + radio/src/edgetx.cpp | 2 +- .../src/gui/colorlcd/module/module_setup.cpp | 2 +- radio/src/stamp.cpp | 6 +- radio/src/targets/horus/CMakeLists.txt | 20 ++ radio/src/targets/horus/board.h | 6 +- radio/src/targets/horus/hal.h | 63 +++++- radio/src/targets/horus/lcd_driver.cpp | 2 +- radio/src/targets/horus/tp_gt911.cpp | 188 ++++++++++++++++++ radio/src/targets/horus/usb_descriptor.h | 4 + radio/src/tasks.cpp | 2 +- radio/src/telemetry/frsky.h | 2 +- radio/util/build-firmware.py | 7 +- radio/util/fwoptions.py | 13 ++ radio/util/hw_defs/hal_keys.py | 2 +- radio/util/hw_defs/legacy_names.py | 2 +- radio/util/hw_defs/pot_config.py | 11 + radio/util/hw_defs/switch_config.py | 12 ++ tools/boards.py | 5 + tools/build-common.sh | 3 + tools/build-companion.sh | 2 +- tools/build-dumborc.py | 77 +++++++ tools/generate-hw-defs.sh | 2 +- tools/generate-yaml.sh | 2 +- tools/msys2_fetch_and_build_all.sh | 5 +- 34 files changed, 456 insertions(+), 33 deletions(-) create mode 100644 tools/build-dumborc.py diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 84ff07e6db4..ff51ade3c9e 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -122,6 +122,7 @@ body: - RadioMaster TX12 / TX12MK2 - RadioMaster TX16S / TX16SMK2 - RadioMaster Zorro + - DumboRC DRO1 - Other (Please specify below) validations: required: true diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 2916eb57013..47ab25b5cd8 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -64,6 +64,7 @@ jobs: - gx12 - nb4p - st16 + - dro1 container: image: ghcr.io/edgetx/edgetx-dev:latest volumes: @@ -109,6 +110,7 @@ jobs: - mt12;gx12 - nb4p - st16 + - dro1 container: image: ghcr.io/edgetx/edgetx-dev:latest volumes: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ab027707eef..86e02f4f96f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -35,6 +35,7 @@ jobs: - mt12 - nb4p - st16 + - dro1 container: image: ghcr.io/edgetx/edgetx-dev:latest volumes: diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 57f3c816252..6d22df1922a 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -352,6 +352,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T16) set(FLAVOUR t16) elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T18) set(FLAVOUR t18) +elseif(PCB STREQUAL X10 AND PCBREV STREQUAL DRO1) + set(FLAVOUR dro1) elseif(PCB STREQUAL PL18 AND PCBREV STREQUAL EL18) set(FLAVOUR el18) elseif(PCB STREQUAL PL18 AND PCBREV STREQUAL PL18EV) diff --git a/companion/src/firmwares/boardjson.cpp b/companion/src/firmwares/boardjson.cpp index 10d52032778..79886e8663d 100644 --- a/companion/src/firmwares/boardjson.cpp +++ b/companion/src/firmwares/boardjson.cpp @@ -119,7 +119,7 @@ void BoardJson::afterLoadFixups(Board::Type board, InputsTable * inputs, Switche } // Flex switches are not listed in json file for these radios - int count = IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_MT12(board) ? 2 : 0; + int count = IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_MT12(board) || IS_DUMBORC_DRO1(board) ? 2 : 0; for (int i = 1; i <= count; i++) { QString tag = QString("FL%1").arg(i); diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index 60ec9fad771..4ccbb1d91f6 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -160,6 +160,8 @@ uint32_t Boards::getFourCC(Type board) return 0x4878746F; case BOARD_FLYSKY_ST16: return 0x4C78746F; + case BOARD_DUMBORC_DRO1: + return 0x4A78746F; default: return 0; } @@ -221,6 +223,7 @@ int Boards::getEEpromSize(Board::Type board) case BOARD_FLYSKY_ST16: case BOARD_FATFISH_F16: case BOARD_HELLORADIOSKY_V16: + case BOARD_DUMBORC_DRO1: return 0; default: return 0; @@ -281,6 +284,7 @@ int Boards::getFlashSize(Type board) case BOARD_FLYSKY_ST16: case BOARD_FATFISH_F16: case BOARD_HELLORADIOSKY_V16: + case BOARD_DUMBORC_DRO1: return FSIZE_HORUS; case BOARD_UNKNOWN: return FSIZE_MAX; @@ -671,6 +675,8 @@ QString Boards::getBoardName(Board::Type board) return "Fatfish F16"; case BOARD_HELLORADIOSKY_V16: return "HelloRadioSky V16"; + case BOARD_DUMBORC_DRO1: + return "DumboRC DRO1"; default: return CPN_STR_UNKNOWN_ITEM; } @@ -776,6 +782,7 @@ int Boards::getDefaultInternalModules(Board::Type board) case BOARD_FLYSKY_PL18: case BOARD_FLYSKY_PL18EV: case BOARD_FLYSKY_ST16: + case BOARD_DUMBORC_DRO1: return (int)MODULE_TYPE_MULTIMODULE; case BOARD_BETAFPV_LR3PRO: @@ -847,6 +854,7 @@ void Boards::getBattRange(Board::Type board, int& vmin, int& vmax, unsigned int& case BOARD_JUMPER_T18: case BOARD_JUMPER_T20: case BOARD_JUMPER_T20V2: + case BOARD_DUMBORC_DRO1: BR(67, 83, 66) break; case BOARD_JUMPER_TLITE: diff --git a/companion/src/firmwares/boards.h b/companion/src/firmwares/boards.h index a787c294fdc..dcb07871461 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -93,6 +93,7 @@ namespace Board { BOARD_FATFISH_F16, BOARD_HELLORADIOSKY_V16, BOARD_RADIOMASTER_MT12, + BOARD_DUMBORC_DRO1, BOARD_TYPE_COUNT, BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1 }; @@ -617,9 +618,20 @@ inline bool IS_HELLORADIOSKY_V16(Board::Type board) return board == Board::BOARD_HELLORADIOSKY_V16; } +inline bool IS_DUMBORC_DRO1(Board::Type board) +{ + return board == Board::BOARD_DUMBORC_DRO1; +} + inline bool IS_FAMILY_T16(Board::Type board) { - return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_FATFISH_F16 || board == Board::BOARD_HELLORADIOSKY_V16; + return board == Board::BOARD_JUMPER_T15 || + board == Board::BOARD_JUMPER_T16 || + board == Board::BOARD_RADIOMASTER_TX16S || + board == Board::BOARD_JUMPER_T18 || + board == Board::BOARD_FATFISH_F16 || + board == Board::BOARD_HELLORADIOSKY_V16 || + board == Board::BOARD_DUMBORC_DRO1; } inline bool IS_FAMILY_T12(Board::Type board) diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index dc1d24ecdb9..1219da02c03 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -330,9 +330,9 @@ int OpenTxFirmware::getCapability(::Capability capability) IS_JUMPER_T15(board) || IS_JUMPER_T18(board) || IS_JUMPER_T20(board) || IS_JUMPER_TPRO(board) || IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_GX12(board) || IS_RADIOMASTER_MT12(board) || IS_RADIOMASTER_POCKET(board) || IS_RADIOMASTER_TX12(board) || IS_RADIOMASTER_TX12_MK2(board) || - IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_ZORRO(board)); + IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_ZORRO(board) || IS_DUMBORC_DRO1(board)); case HasSoftwareSerialPower: - return IS_RADIOMASTER_TX16S(board); + return IS_RADIOMASTER_TX16S(board) || IS_DUMBORC_DRO1(board); case HasIntModuleMulti: return id.contains("internalmulti") || IS_RADIOMASTER_TX16S(board) || IS_JUMPER_T18(board) || IS_RADIOMASTER_TX12(board) || IS_JUMPER_TLITE(board) || IS_BETAFPV_LR3PRO(board) || @@ -819,6 +819,14 @@ void registerOpenTxFirmwares() registerOpenTxFirmware(firmware); addOpenTxRfOptions(firmware, FLEX + AFHDS2A + AFHDS3); + /* DumboRC DRO1 board */ + firmware = new OpenTxFirmware(FIRMWAREID("dro1"), QCoreApplication::translate("Firmware", "DumboRC DRO1"), Board::BOARD_DUMBORC_DRO1); + addOpenTxCommonOptions(firmware); + firmware->addOption("lua", Firmware::tr("Enable Lua custom scripts screen")); + addOpenTxFontOptions(firmware); + registerOpenTxFirmware(firmware); + addOpenTxRfOptions(firmware, FLEX); + Firmware::sortRegisteredFirmwares(); Firmware::setDefaultVariant(Firmware::getFirmwareForFlavour("tx16s")); Firmware::setCurrentVariant(Firmware::getDefaultVariant()); diff --git a/fw.json b/fw.json index 76022a0ed08..11cf74b2adc 100644 --- a/fw.json +++ b/fw.json @@ -34,7 +34,8 @@ ["RadioMaster TX12MK2", "tx12mk2-"], ["RadioMaster TX16S", "tx16s-"], ["RadioMaster Zorro","zorro-"], - ["RadioMaster GX12", "gx12-"] + ["RadioMaster GX12", "gx12-"], + ["DumboRC DRO1", "dro1-"] ], "changelog": "- Major initial bug fixes" } diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 590b530d506..10887db3c6a 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -394,6 +394,10 @@ if(IFLIGHT_RELEASE) add_definitions(-DIFLIGHT_RELEASE) endif() +if(DUMBORC_RELEASE) + add_definitions(-DDUMBORC_RELEASE) +endif() + if(HARDWARE_TRAINER_MULTI) add_definitions(-DHARDWARE_TRAINER_MULTI) endif() diff --git a/radio/src/edgetx.cpp b/radio/src/edgetx.cpp index 724419aceb3..f00580b17a6 100644 --- a/radio/src/edgetx.cpp +++ b/radio/src/edgetx.cpp @@ -384,7 +384,7 @@ void generalDefault() g_eeGeneral.pwrOffSpeed = 2; #endif -#if defined(MANUFACTURER_RADIOMASTER) +#if defined(MANUFACTURER_RADIOMASTER) || defined(MANUFACTURER_DUMBORC) g_eeGeneral.audioMuteEnable = 1; #endif diff --git a/radio/src/gui/colorlcd/module/module_setup.cpp b/radio/src/gui/colorlcd/module/module_setup.cpp index 660afed305f..a8a601b09d9 100644 --- a/radio/src/gui/colorlcd/module/module_setup.cpp +++ b/radio/src/gui/colorlcd/module/module_setup.cpp @@ -417,7 +417,7 @@ class ModuleWindow : public Window edit->setStep(SBUS_STEPSIZE); new Choice(box, rect_t{}, STR_SBUS_INVERSION_VALUES, 0, 1, GET_SET_DEFAULT(md->sbus.noninverted)); - #if defined(RADIO_TX16S) + #if defined(RADIO_TX16S) || defined(RADIO_DRO1) new StaticText(this, rect_t{}, STR_WARN_5VOLTS); #endif } diff --git a/radio/src/stamp.cpp b/radio/src/stamp.cpp index a68a8834732..b4a3934199b 100644 --- a/radio/src/stamp.cpp +++ b/radio/src/stamp.cpp @@ -42,13 +42,15 @@ #define DISPLAY_VERSION "-tbs" #elif defined(IMRC_RELEASE) #define DISPLAY_VERSION "-imrc" +#elif defined(DUMBORC_RELEASE) +#define DISPLAY_VERSION "-DRO" #else #define DISPLAY_VERSION #endif #if defined(COLORLCD) const char fw_stamp[] = "FW" TAB ": edgetx-" FLAVOUR; - #if defined(RADIOMASTER_RELEASE) || defined(JUMPER_RELEASE) + #if defined(RADIOMASTER_RELEASE) || defined(JUMPER_RELEASE) || defined(DUMBORC_RELEASE) const char vers_stamp[] = "VERS" TAB ": Factory firmware (" GIT_STR ")"; #else #if defined(VERSION_TAG) @@ -63,7 +65,7 @@ const char vers_stamp[] = "FW" TAB ": edgetx-" BOARD_NAME "\036VERS" TAB ": " VERSION DISPLAY_VERSION " (" GIT_STR ")" "\036DATE" TAB ": " DATE " " TIME; #elif defined(RADIOMASTER_RELEASE) const char vers_stamp[] = "FW" TAB ": edgetx-" FLAVOUR "\036VERS" TAB ": RM Factory (" GIT_STR ")" "\036BUILT BY : EdgeTX" "\036DATE" TAB ": " DATE " " TIME; -#elif defined(JUMPER_RELEASE) || defined(IFLIGHT_RELEASE) +#elif defined(JUMPER_RELEASE) || defined(IFLIGHT_RELEASE) || defined(DUMBORC_RELEASE) const char vers_stamp[] = "FW" TAB ": edgetx-" FLAVOUR "\036VERS" TAB ": Factory (" GIT_STR ")" "\036BUILT BY : EdgeTX" "\036DATE" TAB ": " DATE " " TIME; #else #if defined(VERSION_TAG) diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index 614606b00d6..7d2f75997ab 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -139,6 +139,26 @@ if (PCB STREQUAL X10) set(AUX2_SERIAL ON) endif() set(FLYSKY_GIMBAL ON) + elseif (PCBREV STREQUAL DRO1) + set(FLAVOUR dro1) + add_definitions(-DRADIO_DRO1) + add_definitions(-DRADIO_FAMILY_T16) + +# Uncomment the line below to enable bootloader support for SPI flash +# add_definitions(-DSPI_FLASH) + + unset(INTERNAL_MODULES CACHE) + option(BLUETOOTH "Support for bluetooth module" OFF) + option(INTERNAL_GPS "Support for internal GPS" OFF) + set(SWSERIALPOWER YES) + set(USB_CHARGER YES) + add_definitions(-DMANUFACTURER_DUMBORC) + if (NOT BLUETOOTH) + set(AUX2_SERIAL ON) + endif() + set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS") + set(FLYSKY_GIMBAL OFF) + set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches") else() set(FLAVOUR x10) set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module") diff --git a/radio/src/targets/horus/board.h b/radio/src/targets/horus/board.h index 50ff2aff274..7f0b1a6be55 100644 --- a/radio/src/targets/horus/board.h +++ b/radio/src/targets/horus/board.h @@ -133,7 +133,7 @@ enum { #define EXTERNAL_MODULE_OFF() gpio_clear(EXTMODULE_PWR_GPIO) // POTS and SLIDERS default configuration -#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) +#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) #define XPOS_CALIB_DEFAULT {0x3, 0xc, 0x15, 0x1e, 0x26} #endif @@ -266,7 +266,7 @@ void telemetryPortInvertedInit(uint32_t baudrate); // Aux serial port driver -#if defined(RADIO_TX16S) || defined(RADIO_F16) +#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_DRO1) #define DEBUG_BAUDRATE 460800 #define LUA_DEFAULT_BAUDRATE 115200 #else @@ -293,7 +293,7 @@ void bluetoothWriteWakeup(); uint8_t bluetoothIsWriting(); void bluetoothDisable(); -#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) +#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) #define BATTERY_DIVIDER 1495 #else #define BATTERY_DIVIDER 1629 diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index b0f738367c8..796e44c92b8 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -45,7 +45,7 @@ #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_6 // PI.06 #define KEYS_GPIO_REG_TELE GPIOC #define KEYS_GPIO_PIN_TELE LL_GPIO_PIN_4 // PC.04 -#elif defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) +#elif defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) #define KEYS_GPIO_REG_ENTER GPIOI #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_8 // PI.08 #define KEYS_GPIO_REG_PAGEUP GPIOC @@ -234,6 +234,22 @@ #if defined(PCBX12S) #define SWITCHES_F_INVERTED + #elif defined(RADIO_DRO1) + #undef SWITCHES_GPIO_REG_F + #undef SWITCHES_GPIO_PIN_F + #undef SWITCHES_GPIO_REG_H + #undef SWITCHES_GPIO_PIN_H + #define SWITCHES_GPIO_REG_F_H GPIOH + #define SWITCHES_GPIO_PIN_F_H LL_GPIO_PIN_7 // PH.07 + #define SWITCHES_GPIO_REG_F_L GPIOH + #define SWITCHES_GPIO_PIN_F_L LL_GPIO_PIN_3 // PH.03 + #define SWITCHES_GPIO_REG_H_H GPIOH + #define SWITCHES_GPIO_PIN_H_H LL_GPIO_PIN_8 // PH.08 + #define SWITCHES_GPIO_REG_H_L GPIOG + #define SWITCHES_GPIO_PIN_H_L LL_GPIO_PIN_7 // PG.07 + #define SWITCHES_B_INVERTED + #define SWITCHES_D_INVERTED + #define SWITCHES_G_INVERTED #elif defined(PCBX10) #define SWITCHES_B_INVERTED #define SWITCHES_D_INVERTED @@ -316,6 +332,31 @@ #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_14 // PB.14 #define TRIMS_GPIO_REG_LSU GPIOB #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_13 // PB.13 +#elif defined(RADIO_DRO1) + #define TRIMS_GPIO_REG_RHL GPIOA + #define TRIMS_GPIO_PIN_RHL LL_GPIO_PIN_6 // PA.06 + #define TRIMS_GPIO_REG_RHR GPIOC + #define TRIMS_GPIO_PIN_RHR LL_GPIO_PIN_4 // PC.04 + #define TRIMS_GPIO_REG_RVD GPIOG + #define TRIMS_GPIO_PIN_RVD LL_GPIO_PIN_12 // PG.12 + #define TRIMS_GPIO_REG_RVU GPIOJ + #define TRIMS_GPIO_PIN_RVU LL_GPIO_PIN_14 // PJ.14 + #define TRIMS_GPIO_REG_LVD GPIOJ + #define TRIMS_GPIO_PIN_LVD LL_GPIO_PIN_13 // PJ.13 + #define TRIMS_GPIO_REG_LHL GPIOD + #define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_3 // PD.03 + #define TRIMS_GPIO_REG_LVU GPIOJ + #define TRIMS_GPIO_PIN_LVU LL_GPIO_PIN_12 // PJ.12 + #define TRIMS_GPIO_REG_LHR GPIOD + #define TRIMS_GPIO_PIN_LHR LL_GPIO_PIN_7 // PD.07 + #define TRIMS_GPIO_REG_LSU GPIOD + #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_13 // PD.13 + #define TRIMS_GPIO_REG_LSD GPIOJ + #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_8 // PJ.08 + #define TRIMS_GPIO_REG_RSU GPIOB + #define TRIMS_GPIO_PIN_RSU LL_GPIO_PIN_14 // PB.14 + #define TRIMS_GPIO_REG_RSD GPIOB + #define TRIMS_GPIO_PIN_RSD LL_GPIO_PIN_13 // PB.13 #elif defined(PCBX10) // Left/Right Horizontal trims (LHL/LHR) #if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) @@ -498,7 +539,7 @@ #define ADC_GPIO_PIN_EXT3 ADC_GPIO_PIN_STICK_RH #define ADC_GPIO_PIN_EXT4 ADC_GPIO_PIN_STICK_RV #endif - #if !(defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_T15) || defined(RADIO_V16)) + #if !(defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_T15) || defined(RADIO_V16) || defined(RADIO_DRO1)) #define PWM_STICKS #define PWM_TIMER TIM5 #define PWM_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1) @@ -567,7 +608,7 @@ #define ADC_DMA_STREAM_IRQHandler DMA2_Stream0_IRQHandler // VBat divider is /4 on F42x and F43x devices - #if defined(RADIO_TX16S) || defined(RADIO_T15) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_T18) + #if defined(RADIO_TX16S) || defined(RADIO_T15) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_T18) || defined(RADIO_DRO1) #define ADC_VREF_PREC2 330 #elif defined(RADIO_T16) #define ADC_VREF_PREC2 300 @@ -582,7 +623,7 @@ #define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 } #elif defined(RADIO_T18) #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 } -#elif defined(RADIO_TX16S) || defined(RADIO_F16) +#elif defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_DRO1) #define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 } #elif defined(RADIO_V16) #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 } @@ -634,7 +675,7 @@ #if defined(RADIO_T15) #define PCBREV_GPIO GPIO_PIN(GPIOH, 8) // PH.08 #define PCBREV_VALUE() (gpio_read(PCBREV_GPIO) >> 8) -#elif defined(RADIO_V16) +#elif defined(RADIO_V16) || defined(RADIO_DRO1) #define PCBREV_VALUE() {0} #elif defined(PCBX10) #define PCBREV_GPIO_1 GPIO_PIN(GPIOH, 7) // PH.07 @@ -705,7 +746,7 @@ #define AUX_SERIAL_DMA_RX DMA1 #define AUX_SERIAL_DMA_RX_STREAM LL_DMA_STREAM_1 #define AUX_SERIAL_DMA_RX_CHANNEL LL_DMA_CHANNEL_4 - #if defined(RADIO_TX16S) || defined(RADIO_F16) + #if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_DRO1) #define AUX_SERIAL_PWR_GPIO GPIO_PIN(GPIOA, 15) // PA.15 #endif #endif @@ -817,7 +858,7 @@ #elif defined(PCBX10) #define LCD_GPIO_NRST GPIO_PIN(GPIOI, 10) // PI.10 #endif -#if defined(PCBX10) && !defined(RADIO_T18) && !defined(RADIO_V16) +#if defined(PCBX10) && !(defined(RADIO_T18) || defined(RADIO_V16) || defined(RADIO_DRO1)) #define LCD_VERTICAL_INVERT #endif #define LTDC_IRQ_PRIO 4 @@ -938,7 +979,7 @@ #endif #if defined(RADIO_FAMILY_T16) -#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) +#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) #define AUDIO_UNMUTE_DELAY 150 // ms #else #define AUDIO_UNMUTE_DELAY 120 // ms @@ -971,7 +1012,7 @@ #endif // HARDWARE_TOUCH // First I2C Bus -#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(PCBX12S) || defined(RADIO_T15) || defined(RADIO_V16) +#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(PCBX12S) || defined(RADIO_T15) || defined(RADIO_V16) || defined(RADIO_DRO1) #define I2C_B1 I2C1 #define I2C_B1_SCL_GPIO GPIO_PIN(GPIOB, 8) // PB.08 #define I2C_B1_SDA_GPIO GPIO_PIN(GPIOB, 9) // PB.09 @@ -992,7 +1033,7 @@ #define I2C_B2_SDA_GPIO GPIO_PIN(GPIOB, 11) // PB.11 #define I2C_B2_GPIO_AF LL_GPIO_AF_4 // I2C2 #define I2C_B2_CLK_RATE 400000 - #if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) + #if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) #define I2C_B2_PWR_GPIO GPIO_PIN(GPIOA, 15) // PA.15 #endif #endif @@ -1222,7 +1263,7 @@ #define BT_USART_GPIO GPIOG #define BT_TX_GPIO GPIO_PIN(GPIOG, 14) // PG.14 #define BT_RX_GPIO GPIO_PIN(GPIOG, 9) // PG.09 - #if defined(RADIO_TX16S) + #if defined(RADIO_TX16S) || defined(RADIO_DRO1) #define BT_PWR_GPIO GPIO_PIN(GPIOB, 0) // PB.00 #endif #endif diff --git a/radio/src/targets/horus/lcd_driver.cpp b/radio/src/targets/horus/lcd_driver.cpp index c6aab824fe3..5608d21dd75 100644 --- a/radio/src/targets/horus/lcd_driver.cpp +++ b/radio/src/targets/horus/lcd_driver.cpp @@ -289,7 +289,7 @@ void LCD_Init_LTDC() clkConfig.PLLSAI.PLLSAIN = 192; clkConfig.PLLSAI.PLLSAIR = 3; clkConfig.PLLSAIDivQ = 6; - #if defined(RADIO_TX16S) || defined(RADIO_F16) + #if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_DRO1) clkConfig.PLLSAIDivR = RCC_PLLSAIDIVR_8; #else clkConfig.PLLSAIDivR = RCC_PLLSAIDIVR_4; diff --git a/radio/src/targets/horus/tp_gt911.cpp b/radio/src/targets/horus/tp_gt911.cpp index 6e6d21a5277..786f2f718aa 100644 --- a/radio/src/targets/horus/tp_gt911.cpp +++ b/radio/src/targets/horus/tp_gt911.cpp @@ -230,6 +230,194 @@ const uint8_t TOUCH_GT911_Cfg[] = { 0xFF // 0x80FE Reserved }; +#elif defined (RADIO_DRO1) +const uint8_t TOUCH_GT911_Cfg[] = { + GT911_CFG_NUMBER, // 0x8047 Config version + 0xE0, // 0x8048 X output map : x 480 + 0x01, + 0x10, // 0x804A Y ouptut max : y 272 + 0x01, + GT911_MAX_TP, // 0x804C Touch number + 0xCC, // 0x804D Module switch 1 : 180° rotation + 0x20, // 0x804E Module switch 2 + 0x01, // 0x804F Shake_Count + 0x0A, // 0x8050 Filter + 0x28, // 0x8051 Larger touch + 0x0F, // 0x8052 Noise reduction + 0x5A, // 0x8053 Screen touch level + 0x3C, // 0x8054 Screen touch leave + 0x03, // 0x8055 Low power control + 0x05, // 0x8056 Refresh rate + 0x00, // 0x8057 X threshold + 0x00, // 0x8058 Y threshold + 0x00, // 0x8059 Reserved + 0x00, // 0x805A Reserved + 0x00, // 0x805B Space (top, bottom) + 0x00, // 0x805C Space (left, right) + 0x05, // 0x805D Mini filter + 0x00, // 0x805E Strech R0 + 0x00, // 0x805F Strech R1 + 0x00, // 0x8060 Strech R2 + 0x00, // 0x8061 Strech RM + 0x8A, // 0x8062 Drv groupA num + 0x2A, // 0x8063 Drv groupB num + 0x0C, // 0x8064 Sensor num + 0x32, // 0x8065 FreqA factor + 0x34, // 0x8066 FreqB factor + 0x0C, // 0x8067 Panel bit freq + 0x08, + 0x00, // 0x8069 Reserved + 0x00, + 0x00, // 0x806B Panel tx gain + 0x03, // 0x806C Panel rx gain + 0x02, // 0x806D Panel dump shift + 0x25, // 0x806E Drv frame control + 0x00, // 0x806F Charging level up + 0x00, // 0x8070 Module switch 3 + 0x00, // 0x8071 Gesture distance + 0x00, // 0x8072 Gesture long press time + 0x00, // 0x8073 X/Y slope adjust + 0x00, // 0x8074 Gesture control + 0x00, // 0x8075 Gesture switch 1 + 0x00, // 0x8076 Gesture switch 2 + 0x00, // 0x8077 Gesture refresh rate + 0x00, // 0x8078 Gesture touch level + 0x00, // 0x8079 New green wake up level + 0x28, // 0x807A Freq hopping start + 0x55, // 0x807B Freq hopping end + 0x94, // 0x807C Noise detect time + 0xC5, // 0x807D Hopping flag + 0x02, // 0x807E Hopping flag + 0x07, // 0x807F Noise threshold + 0x00, // 0x8080 Nois min threshold old + 0x00, // 0x8081 Reserved + 0x04, // 0x8082 Hopping sensor group + 0x8D, // 0x8083 Hopping Seg1 normalize + 0x2B, // 0x8084 Hopping Seg1 factor + 0x00, // 0x8085 Main clock adjust + 0x80, // 0x8086 Hopping Seg2 normalize + 0x32, // 0x8087 Hopping Seg2 factor + 0x00, // 0x8088 Reserved + 0x75, // 0x8089 Hopping Seg3 normalize + 0x3A, // 0x808A Hopping Seg3 factor + 0x00, // 0x808B Reserved + 0x6C, // 0x808C Hopping Seg4 normalize + 0x43, // 0x808D Hopping Seg4 factor + 0x00, // 0x808E Reserved + 0x64, // 0x808F Hopping Seg5 normalize + 0x4F, // 0x8090 Hopping Seg5 factor + 0x00, // 0x8091 Reserved + 0x64, // 0x8092 Hopping Seg6 normalize + 0x00, // 0x8093 Key1 + 0x00, // 0x8094 Key2 + 0x00, // 0x8095 Key3 + 0x00, // 0x8096 Key4 + 0x00, // 0x8097 Key area + 0x00, // 0x8098 Key touch level + 0x00, // 0x8099 Key leave level + 0x00, // 0x809A Key sens + 0x00, // 0x809B Key sens + 0x00, // 0x809C Key restrain + 0x00, // 0x809D Key restrain time + 0x00, // 0x809E Large gesture touch + 0x00, // 0x809F Reserved + 0x00, // 0x80A0 Reserved + 0x00, // 0x80A1 Hotknot noise map + 0x00, // 0x80A2 Link threshold + 0x00, // 0x80A3 Pxy threshold + 0x00, // 0x80A4 GHot dump shift + 0x00, // 0x80A5 GHot rx gain + 0x00, // 0x80A6 Freg gain + 0x00, // 0x80A7 Freg gain 1 + 0x00, // 0x80A8 Freg gain 2 + 0x00, // 0x80A9 Freg gain 3 + 0x00, // 0x80AA Reserved + 0x00, // 0x80AB Reserved + 0x00, // 0x80AC Reserved + 0x00, // 0x80AD Reserved + 0x00, // 0x80AE Reserved + 0x00, // 0x80AF Reserved + 0x00, // 0x80B0 Reserved + 0x00, // 0x80B1 Reserved + 0x00, // 0x80B2 Reserved + 0x00, // 0x80B3 Combine dis + 0x00, // 0x80B4 Split set + 0x00, // 0x80B5 Reserved + 0x00, // 0x80B6 Reserved + 0x18, // 0x80B7 Sensor CH0 + 0x16, // 0x80B8 Sensor CH1 + 0x14, // 0x80B9 Sensor CH2 + 0x12, // 0x80BA Sensor CH3 + 0x10, // 0x80BB Sensor CH4 + 0x0E, // 0x80BC Sensor CH5 + 0x0C, // 0x80BD Sensor CH6 + 0x0A, // 0x80BE Sensor CH7 + 0x08, // 0x80BF Sensor CH8 + 0x06, // 0x80C0 Sensor CH9 + 0x04, // 0x80C1 Sensor CH10 + 0x02, // 0x80C2 Sensor CH11 + 0xFF, // 0x80C3 Sensor CH12 + 0xFF, // 0x80C4 Sensor CH13 + 0x00, // 0x80C5 Reserved + 0x00, // 0x80C6 Reserved + 0x00, // 0x80C7 Reserved + 0x00, // 0x80C8 Reserved + 0x00, // 0x80C9 Reserved + 0x00, // 0x80CA Reserved + 0x00, // 0x80CB Reserved + 0x00, // 0x80CC Reserved + 0x00, // 0x80CD Reserved + 0x00, // 0x80CE Reserved + 0x00, // 0x80CF Reserved + 0x00, // 0x80D0 Reserved + 0x00, // 0x80D1 Reserved + 0x00, // 0x80D2 Reserved + 0x00, // 0x80D3 Reserved + 0x00, // 0x80D4 Reserved + 0x24, // 0x80D5 Driver CH0 + 0x22, // 0x80D6 Driver CH1 + 0x21, // 0x80D7 Driver CH2 + 0x20, // 0x80D8 Driver CH3 + 0x1F, // 0x80D9 Driver CH4 + 0x1E, // 0x80DA Driver CH5 + 0x1D, // 0x80DB Driver CH6 + 0x1C, // 0x80DC Driver CH7 + 0x18, // 0x80DD Driver CH8 + 0x16, // 0x80DE Driver CH9 + 0x13, // 0x80DF Driver CH10 + 0x12, // 0x80E0 Driver CH11 + 0x10, // 0x80E1 Driver CH12 + 0x0F, // 0x80E2 Driver CH13 + 0x0A, // 0x80E3 Driver CH14 + 0x08, // 0x80E4 Driver CH15 + 0x06, // 0x80E5 Driver CH16 + 0x04, // 0x80E6 Driver CH17 + 0x02, // 0x80E7 Driver CH18 + 0x00, // 0x80E8 Driver CH19 + 0xFF, // 0x80E9 Driver CH20 + 0xFF, // 0x80EA Driver CH21 + 0xFF, // 0x80EB Driver CH22 + 0xFF, // 0x80EC Driver CH23 + 0xFF, // 0x80ED Driver CH24 + 0xFF, // 0x80EE Driver CH25 + 0x00, // 0x80EF Reserved + 0x00, // 0x80F0 Reserved + 0x00, // 0x80F1 Reserved + 0x00, // 0x80F2 Reserved + 0x00, // 0x80F3 Reserved + 0x00, // 0x80F4 Reserved + 0x00, // 0x80F5 Reserved + 0x00, // 0x80F6 Reserved + 0x00, // 0x80F7 Reserved + 0x00, // 0x80F8 Reserved + 0x00, // 0x80F9 Reserved + 0x00, // 0x80FA Reserved + 0x00, // 0x80FB Reserved + 0x00, // 0x80FC Reserved + 0x00, // 0x80FD Reserved + 0x00 // 0x80FE Reserved +}; + #else //GT911 param table diff --git a/radio/src/targets/horus/usb_descriptor.h b/radio/src/targets/horus/usb_descriptor.h index 0c18dc257b7..b9085a8b419 100644 --- a/radio/src/targets/horus/usb_descriptor.h +++ b/radio/src/targets/horus/usb_descriptor.h @@ -53,4 +53,8 @@ #define USB_NAME "HelloRadioSky V16" #define USB_MANUFACTURER 'H', 'R', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */ #define USB_PRODUCT 'V', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */ +#elif defined(RADIO_DRO1) + #define USB_NAME "DumboRC DRO1" + #define USB_MANUFACTURER 'D', 'U', 'M', 'B', 'O', 'R', 'C', ' ' /* 8 bytes */ + #define USB_PRODUCT 'D', 'R', 'O', '1', ' ', ' ', ' ', ' ' /* 8 Bytes */ #endif diff --git a/radio/src/tasks.cpp b/radio/src/tasks.cpp index e21a1dd6ab2..077c8f45683 100644 --- a/radio/src/tasks.cpp +++ b/radio/src/tasks.cpp @@ -105,7 +105,7 @@ static void audioTask() sleep_ms(1); } -#if defined(PCBX12S) || defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) +#if defined(PCBX12S) || defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) // The audio amp needs ~2s to start sleep_ms(1000); // 1s #endif diff --git a/radio/src/telemetry/frsky.h b/radio/src/telemetry/frsky.h index 5df512ec47a..112fa9b9e42 100644 --- a/radio/src/telemetry/frsky.h +++ b/radio/src/telemetry/frsky.h @@ -35,7 +35,7 @@ enum FrSkyDataState { }; #define FRSKY_SPORT_BAUDRATE 57600 -#if defined(RADIO_TX16S) || defined(RADIO_F16) +#if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_DRO1) #define FRSKY_TELEM_MIRROR_BAUDRATE 115200 #else #define FRSKY_TELEM_MIRROR_BAUDRATE FRSKY_SPORT_BAUDRATE diff --git a/radio/util/build-firmware.py b/radio/util/build-firmware.py index 3b6f0c0fed2..879b2d9fa99 100755 --- a/radio/util/build-firmware.py +++ b/radio/util/build-firmware.py @@ -213,7 +213,12 @@ def main(): cmake_options["PCB"] = "X10" cmake_options["PCBREV"] = "V16" firmware_options = options_helloradiosky_v16 - maxsize = 2 * 1024 * 1024 + maxsize = 2 * 1024 * 1024 + elif board_name == "dro1": + cmake_options["PCB"] = "X10" + cmake_options["PCBREV"] = "DRO1" + firmware_options = options_dumborc_dro1 + maxsize = 2 * 1024 * 1024 else: return INVALID_BOARD diff --git a/radio/util/fwoptions.py b/radio/util/fwoptions.py index 304cc0ef0b6..87f36b4c774 100755 --- a/radio/util/fwoptions.py +++ b/radio/util/fwoptions.py @@ -376,3 +376,16 @@ "faichoice": ("FAI", "CHOICE", None), "nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"), } + +options_dumborc_dro1 = { + "noheli": ("HELI", "NO", "YES"), + "lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"), + "nogvars": ("GVARS", "NO", "YES"), + "faimode": ("FAI", "YES", None), + "faichoice": ("FAI", "CHOICE", None), + "nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"), + "flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None), + "bluetooth": ("BLUETOOTH", "YES", "NO"), + "internalgps": ("INTERNAL_GPS", "YES", "NO"), + "externalaccessmod": ("HARDWARE_EXTERNAL_ACCESS_MOD", "YES", "NO"), +} diff --git a/radio/util/hw_defs/hal_keys.py b/radio/util/hw_defs/hal_keys.py index 8a00b0a311a..f449cfbdc44 100644 --- a/radio/util/hw_defs/hal_keys.py +++ b/radio/util/hw_defs/hal_keys.py @@ -58,7 +58,7 @@ KEY_LABELS = [ { - "targets": {"boxer", "f16", "mt12", "gx12", "pocket", "tx12", "tx12mk2", "tx16s", "v16", "zorro"}, + "targets": {"boxer", "f16", "mt12", "gx12", "pocket", "tx12", "tx12mk2", "tx16s", "v16", "zorro", "dro1"}, "keys": { "EXIT": { "label": "RTN" } } diff --git a/radio/util/hw_defs/legacy_names.py b/radio/util/hw_defs/legacy_names.py index d462a8864c4..5c9dfd98467 100644 --- a/radio/util/hw_defs/legacy_names.py +++ b/radio/util/hw_defs/legacy_names.py @@ -2,7 +2,7 @@ LEGACY_NAMES = [ { - "targets": {"x10", "x10express", "t16", "tx16s", "t18", "f16", "v16"}, + "targets": {"x10", "x10express", "t16", "tx16s", "t18", "f16", "v16", "dro1"}, "inputs": { "LH": { "yaml": "Rud", diff --git a/radio/util/hw_defs/pot_config.py b/radio/util/hw_defs/pot_config.py index 0cd3bd22a8b..394d063e05f 100644 --- a/radio/util/hw_defs/pot_config.py +++ b/radio/util/hw_defs/pot_config.py @@ -237,6 +237,17 @@ "SL1": {"default": "SLIDER"}, "SL2": {"default": "SLIDER"}, }, + "dro1": { + "P1": {"default": "POT_CENTER"}, + "P2": {"default": "NONE"}, + "P3": {"default": "POT_CENTER"}, + "SL1": {"default": "SLIDER"}, + "SL2": {"default": "SLIDER"}, + "EXT1": {"default": "POT"}, + "EXT2": {"default": "POT"}, + "EXT3": {"default": "NONE"}, + "EXT4": {"default": "NONE"} + }, } diff --git a/radio/util/hw_defs/switch_config.py b/radio/util/hw_defs/switch_config.py index b39616f09e7..2823dbd28b3 100644 --- a/radio/util/hw_defs/switch_config.py +++ b/radio/util/hw_defs/switch_config.py @@ -507,6 +507,18 @@ "SD": { "default": "2POS", "display": [ 1, 0 ] }, "SC": { "default": "3POS", "display": [ 1, 1 ] }, }, + "dro1": { + "SA": {"default": "3POS"}, + "SB": {"default": "3POS"}, + "SC": {"default": "3POS"}, + "SD": {"default": "3POS"}, + "SE": {"default": "3POS"}, + "SF": {"default": "3POS"}, + "SG": {"default": "3POS"}, + "SH": {"default": "3POS"}, + "SI": {"default": "2POS"}, + "SJ": {"default": "2POS"} + }, } diff --git a/tools/boards.py b/tools/boards.py index b8ae44ccbb9..6c9e4053bb0 100755 --- a/tools/boards.py +++ b/tools/boards.py @@ -101,4 +101,9 @@ "PCB": "X7", "PCBREV": "T14", }, + "DRO1": { + "PCB": "X10", + "PCBREV": "DRO1", + "INTERNAL_MODULE_MULTI": "NO" + }, } diff --git a/tools/build-common.sh b/tools/build-common.sh index 49fc2d71641..6433938046f 100644 --- a/tools/build-common.sh +++ b/tools/build-common.sh @@ -155,6 +155,9 @@ get_target_build_options() { st16) BUILD_OPTIONS+="-DPCB=ST16 -DNANO=NO" ;; + dro1) + BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=DRO1" + ;; *) echo "Unknown target: $target_name" return 1 diff --git a/tools/build-companion.sh b/tools/build-companion.sh index 97e7f5fd7f9..5efad10ca04 100755 --- a/tools/build-companion.sh +++ b/tools/build-companion.sh @@ -75,7 +75,7 @@ declare -a simulator_plugins=(x9lite x9lites xlite xlites nv14 el18 pl18 pl18ev st16 x10 x10express x12s - t15 t16 t18 t20 t20v2 tx16s f16 v16) + t15 t16 t18 t20 t20v2 tx16s f16 v16 dro1) for plugin in "${simulator_plugins[@]}" do diff --git a/tools/build-dumborc.py b/tools/build-dumborc.py new file mode 100644 index 00000000000..905662bef37 --- /dev/null +++ b/tools/build-dumborc.py @@ -0,0 +1,77 @@ +#!/usr/bin/python3 + +import argparse +import datetime +import os +from builtins import NotADirectoryError +import shutil +import tempfile + + +boards = { + "DRO1_1": { + "PCB": "X10", + "PCBREV": "DRO1", + "DEFAULT_MODE": "1", + }, + "DRO1_2": { + "PCB": "X10", + "PCBREV": "DRO1", + "DEFAULT_MODE": "2", + } +} + +translations = [ + "EN", +] + + +def timestamp(): + return datetime.datetime.now().strftime("%y%m%d") + + +def build(board, translation, srcdir): + cmake_options = " ".join(["-D%s=%s" % (key, value) for key, value in boards[board].items()]) + cwd = os.getcwd() + if not os.path.exists("output"): + os.mkdir("output") + path = tempfile.mkdtemp() + os.chdir(path) + command = "cmake %s -DTRANSLATIONS=%s -DDUMBORC_RELEASE=YES %s" % (cmake_options, translation, srcdir) + print(command) + os.system(command) + os.system("make firmware -j6") + os.chdir(cwd) + index = 0 + while 1: + suffix = "" if index == 0 else "_%d" % index + filename = "output/firmware_%s_%s_%s%s.bin" % (board.lower(), translation.lower(), timestamp(), suffix) + if not os.path.exists(filename): + shutil.copy("%s/arm-none-eabi/firmware.bin" % path, filename) + break + index += 1 + shutil.rmtree(path) + + +def dir_path(string): + if os.path.isdir(string): + return string + else: + raise NotADirectoryError(string) + + +def main(): + parser = argparse.ArgumentParser(description="Build DumboRC firmware") + parser.add_argument("-b", "--boards", action="append", help="Destination boards", required=True) + parser.add_argument("-t", "--translations", action="append", help="Translations", required=True) + parser.add_argument("srcdir", type=dir_path) + + args = parser.parse_args() + + for board in (boards.keys() if "ALL" in args.boards else args.boards): + for translation in (translations if "ALL" in args.translations else args.translations): + build(board, translation, args.srcdir) + + +if __name__ == "__main__": + main() diff --git a/tools/generate-hw-defs.sh b/tools/generate-hw-defs.sh index 4075506e885..c775aba1d9d 100755 --- a/tools/generate-hw-defs.sh +++ b/tools/generate-hw-defs.sh @@ -9,7 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" : "${SRCDIR:=$(dirname "$(pwd)/$0")/..}" -: ${FLAVOR:="nv14;el18;pl18;pl18ev;nb4p;st16;t12;t12max;t15;t16;t18;t8;zorro;pocket;commando8;tlite;tpro;tprov2;tpros;bumblebee;t20;t20v2;t14;lr3pro;mt12;gx12;tx12;tx12mk2;boxer;tx16s;x10;x10express;x12s;x7;x7access;x9d;x9dp;x9dp2019;x9e;x9lite;x9lites;xlite;xlites;f16;v14;v12"} +: ${FLAVOR:="nv14;el18;pl18;pl18ev;nb4p;st16;t12;t12max;t15;t16;t18;t8;zorro;pocket;commando8;tlite;tpro;tprov2;tpros;bumblebee;t20;t20v2;t14;lr3pro;mt12;gx12;tx12;tx12mk2;boxer;tx16s;x10;x10express;x12s;x7;x7access;x9d;x9dp;x9dp2019;x9e;x9lite;x9lites;xlite;xlites;f16;v14;v12;dro1"} : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_RULE_MESSAGES=OFF -Wno-dev -DCMAKE_MESSAGE_LOG_LEVEL=WARNING"} # wipe build directory clean diff --git a/tools/generate-yaml.sh b/tools/generate-yaml.sh index 665f3f1904d..c6acb419d28 100755 --- a/tools/generate-yaml.sh +++ b/tools/generate-yaml.sh @@ -11,7 +11,7 @@ if [[ -n ${GCC_ARM} ]] ; then export PATH=${GCC_ARM}:$PATH fi -: ${FLAVOR:="t15;tx16s;pl18;nv14;nb4p;x9d;x9dp2019;x9e;xlite;xlites;x7;tpro;t20;f16;gx12;st16"} +: ${FLAVOR:="t15;tx16s;pl18;nv14;nb4p;x9d;x9dp2019;x9e;xlite;xlites;x7;tpro;t20;f16;gx12;st16;dro1"} : ${SRCDIR:=$(dirname "$(pwd)/$0")/..} : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_RULE_MESSAGES=OFF -Wno-dev -DDISABLE_COMPANION=YES -DCMAKE_MESSAGE_LOG_LEVEL=WARNING"} diff --git a/tools/msys2_fetch_and_build_all.sh b/tools/msys2_fetch_and_build_all.sh index 56571573cbb..7135efea7b6 100644 --- a/tools/msys2_fetch_and_build_all.sh +++ b/tools/msys2_fetch_and_build_all.sh @@ -9,7 +9,7 @@ # ----------------------------------------------------------------------------- export BRANCH_NAME="main" # main|2.9|... -export RADIO_TYPE="tx16s" # tx16s|x10|x10express|x12s|x9d|x9dp|x9lite|x9lites|x7|x7access|t12|t12max|tx12|tx12mk2|mt12|gx12|boxer|t8|zorro|pocket|tlite|tpro|t20|t20v2|t14|lr3pro|xlite|xlites|x9dp2019|x9e|x9e-hall|t15|t16|t18|nv14|commando8 +export RADIO_TYPE="tx16s" # tx16s|x10|x10express|x12s|x9d|x9dp|x9lite|x9lites|x7|x7access|t12|t12max|tx12|tx12mk2|mt12|gx12|boxer|t8|zorro|pocket|tlite|tpro|t20|t20v2|t14|lr3pro|xlite|xlites|x9dp2019|x9e|x9e-hall|t15|t16|t18|nv14|commando8|dro1 export BUILD_OPTIONS="-DDEFAULT_MODE=2 -DGVARS=YES" @@ -123,6 +123,9 @@ case $RADIO_TYPE in commando8) BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=COMMANDO8" ;; + dro1) + BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=DRO1" + ;; *) echo "Unknown target: $RADIO_TYPE" exit 1 From a620343e713107aa73fe3d28aa4b4ed2e6bd7c47 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 14 Apr 2025 16:41:20 +0800 Subject: [PATCH 02/22] fix: Support for 'Run tests' when radio does not have hardware internal module --- radio/src/tests/module_ports.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/tests/module_ports.cpp b/radio/src/tests/module_ports.cpp index e24fcc4048b..6da910b8052 100644 --- a/radio/src/tests/module_ports.cpp +++ b/radio/src/tests/module_ports.cpp @@ -80,6 +80,8 @@ TEST(ports, isPortUsed) } #endif +/* FIX : Valid only if HARDWARE_INTERNAL_MODULE is defined */ +#if defined(HARDWARE_INTERNAL_MODULE) #if defined(INTERNAL_MODULE_PXX1) && defined(HARDWARE_EXTERNAL_MODULE) #include "pulses/pxx1.h" @@ -277,3 +279,4 @@ TEST(ports, isTelemAllowedOnBind) EXPECT_TRUE(isTelemAllowedOnBind(EXTERNAL_MODULE)); } #endif +#endif /* defined(HARDWARE_INTERNAL_MODULE) */ From 04f85b4e639c86fdaa6c9beb33e3af5922a4c69f Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Wed, 23 Jul 2025 17:35:16 +0800 Subject: [PATCH 03/22] fix(radio): Support for 'Model Setup Page' when radio does not have hardware internal or external module --- radio/src/gui/colorlcd/model/model_setup.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radio/src/gui/colorlcd/model/model_setup.cpp b/radio/src/gui/colorlcd/model/model_setup.cpp index 336dc3bf972..803113b882c 100644 --- a/radio/src/gui/colorlcd/model/model_setup.cpp +++ b/radio/src/gui/colorlcd/model/model_setup.cpp @@ -353,8 +353,14 @@ void ModelSetupPage::build(Window * window) new SetupButtonGroup(window, {0, y, LCD_W - padding * 2, 0}, nullptr, BTN_COLS, PAD_TINY, { // Modules +/* FIX : Valid only if HARDWARE_INTERNAL_MODULE is defined */ +#if defined(HARDWARE_INTERNAL_MODULE) {STR_INTERNALRF, []() { new ModulePage(INTERNAL_MODULE); }, []() { return g_model.moduleData[INTERNAL_MODULE].type > 0; }}, +#endif /* defined(HARDWARE_INTERNAL_MODULE) */ +/* FIX : Valid only if HARDWARE_EXTERNAL_MODULE is defined */ +#if defined(HARDWARE_EXTERNAL_MODULE) {STR_EXTERNALRF, []() { new ModulePage(EXTERNAL_MODULE); }, []() { return g_model.moduleData[EXTERNAL_MODULE].type > 0; }}, +#endif /* defined(HARDWARE_EXTERNAL_MODULE) */ {STR_TRAINER, []() { new TrainerPage(); }, []() { return g_model.trainerData.mode > 0; }}, // Timer buttons {TR_TIMER "1", []() { new TimerWindow(0); }, []() { return g_model.timers[0].mode > 0; }}, From 581dda9f67c6096471f0166e7b34be9c37d47598 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 4 Aug 2025 11:07:28 +0800 Subject: [PATCH 04/22] feat: Added 6POS keys and their lights. --- radio/src/targets/horus/board.h | 2 +- radio/src/targets/horus/hal.h | 21 +++++++++++++++++++++ radio/util/hw_defs/pot_config.py | 10 +++++----- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/radio/src/targets/horus/board.h b/radio/src/targets/horus/board.h index 68dc78dd055..a903fbb335c 100644 --- a/radio/src/targets/horus/board.h +++ b/radio/src/targets/horus/board.h @@ -185,7 +185,7 @@ uint32_t pwrPressedDuration(); void usbChargerInit(); bool usbChargerLed(); -#if defined(RADIO_V16) +#if defined(RADIO_V16) || defined(RADIO_DRO1) uint16_t getSixPosAnalogValue(uint16_t adcValue); #endif diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index ca430cdc498..9399c9acddf 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -293,6 +293,11 @@ #define SIXPOS_LED_RED 200 #define SIXPOS_LED_GREEN 0 #define SIXPOS_LED_BLUE 0 +#elif defined(RADIO_DRO1) + #define SIXPOS_SWITCH_INDEX 5 + #define SIXPOS_LED_RED 170 + #define SIXPOS_LED_GREEN 85 + #define SIXPOS_LED_BLUE 0 #endif // Trims @@ -1104,6 +1109,22 @@ #define LED_STRIP_TIMER_DMA_IRQn DMA2_Stream5_IRQn #define LED_STRIP_TIMER_DMA_IRQHandler DMA2_Stream5_IRQHandler #define LED_STRIP_REFRESH_PERIOD 50 //ms +#elif defined(RADIO_DRO1) + // LED Strip + #define LED_STRIP_LENGTH 36 + #define BLING_LED_STRIP_START 6 + #define BLING_LED_STRIP_LENGTH 30 + #define LED_STRIP_GPIO GPIO_PIN(GPIOA, 5) // PA.05 / TIM2_CH1 + #define LED_STRIP_GPIO_AF LL_GPIO_AF_1 // TIM1/2 + #define LED_STRIP_TIMER TIM2 + #define LED_STRIP_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1) + #define LED_STRIP_TIMER_CHANNEL LL_TIM_CHANNEL_CH1 + #define LED_STRIP_TIMER_DMA DMA1 + #define LED_STRIP_TIMER_DMA_CHANNEL LL_DMA_CHANNEL_3 + #define LED_STRIP_TIMER_DMA_STREAM LL_DMA_STREAM_7 + #define LED_STRIP_TIMER_DMA_IRQn DMA1_Stream7_IRQn + #define LED_STRIP_TIMER_DMA_IRQHandler DMA1_Stream7_IRQHandler + #define LED_STRIP_REFRESH_PERIOD 50 //ms #endif // Internal PXX1 Module: diff --git a/radio/util/hw_defs/pot_config.py b/radio/util/hw_defs/pot_config.py index 1591f648619..4649d87a0b7 100644 --- a/radio/util/hw_defs/pot_config.py +++ b/radio/util/hw_defs/pot_config.py @@ -245,13 +245,13 @@ "SL2": {"default": "SLIDER"}, }, "dro1": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "NONE"}, - "P3": {"default": "POT_CENTER"}, + "P1": {"default": "POT"}, + "P2": {"default": "MULTIPOS"}, + "P3": {"default": "POT"}, "SL1": {"default": "SLIDER"}, "SL2": {"default": "SLIDER"}, - "EXT1": {"default": "POT"}, - "EXT2": {"default": "POT"}, + "EXT1": {"default": "SLIDER"}, + "EXT2": {"default": "SLIDER"}, "EXT3": {"default": "NONE"}, "EXT4": {"default": "NONE"} }, From 1b26cacbbf63b3f3b32b99c369ce477c836aafd2 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 4 Aug 2025 19:05:59 +0800 Subject: [PATCH 05/22] fix (6POS) : Reset the state to reduce the number of refreshes. --- radio/src/targets/horus/board.cpp | 2 ++ radio/src/targets/taranis/board.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/radio/src/targets/horus/board.cpp b/radio/src/targets/horus/board.cpp index b60b1b49fa4..60d907b099e 100644 --- a/radio/src/targets/horus/board.cpp +++ b/radio/src/targets/horus/board.cpp @@ -145,6 +145,8 @@ uint16_t getSixPosAnalogValue(uint16_t adcValue) } } rgbLedColorApply(); + /* FIX (6POS) : Reset the state to reduce the number of refreshes. */ + dirty = false; } return (4096/5)*(sixPosState); } diff --git a/radio/src/targets/taranis/board.cpp b/radio/src/targets/taranis/board.cpp index 1ecf9ce999d..4f3cc0edd3b 100644 --- a/radio/src/targets/taranis/board.cpp +++ b/radio/src/targets/taranis/board.cpp @@ -105,6 +105,8 @@ uint16_t getSixPosAnalogValue(uint16_t adcValue) ws2812_set_color(i, 0, 0, 0); } rgbLedColorApply(); + /* FIX (6POS) : Reset the state to reduce the number of refreshes. */ + dirty = false; } return (4096/5)*(sixPosState); } From 43df50c9b0d250fbd9c780f55f08b6386dfddde3 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Tue, 2 Sep 2025 02:14:32 +0800 Subject: [PATCH 06/22] fix(DRO1): Resolve conflicts between the repository and this branch. --- .github/ISSUE_TEMPLATE/bug-report.yml | 1 + .../workflows/{actions.yml => build_fw.yml} | 41 ++++----- .github/workflows/nightly.yml | 2 + .github/workflows/validate_fw_json.yml | 23 +++++ .github/workflows/win_cpn-64.yml | 88 +++++++++++++------ companion/src/firmwares/boards.cpp | 34 +++++-- companion/src/firmwares/boards.h | 17 +++- .../src/firmwares/opentx/opentxinterface.cpp | 16 +++- fw.json | 10 ++- radio/src/targets/horus/usb_descriptor.h | 8 +- radio/util/hw_defs/pot_config.py | 8 ++ tools/build-common.sh | 6 ++ tools/generate-hw-defs.sh | 2 +- tools/generate-yaml.sh | 2 +- tools/msys2_fetch_and_build_all.sh | 5 +- 15 files changed, 189 insertions(+), 74 deletions(-) rename .github/workflows/{actions.yml => build_fw.yml} (80%) create mode 100644 .github/workflows/validate_fw_json.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index fe527d1d413..b5ad045dab2 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -58,6 +58,7 @@ body: label: Version description: What version of EdgeTX software are you running? options: + - 2.11.3 - 2.11.2 - 2.11.1 - 2.11.0 diff --git a/.github/workflows/actions.yml b/.github/workflows/build_fw.yml similarity index 80% rename from .github/workflows/actions.yml rename to .github/workflows/build_fw.yml index 7a924a01256..c3a1bf9586f 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/build_fw.yml @@ -6,33 +6,23 @@ on: - 'main' tags: - v* - paths-ignore: - - '**.md' - - '.github/ISSUE_TEMPLATE/**' - - '.github/workflows/nightly.yml' - - '.github/workflows/linux_cpn.yml' - - '.github/workflows/macosx_cpn.yml' - - '.github/workflows/win-cpn-32.yml' - - '.github/workflows/win_cpn-64.yml' - - 'companion/**' - - '.gitpod.yml' - - '.devcontainer/**' - - 'fw.json' + paths: + - '.github/workflows/build_fw.yml' + - 'cmake/**' + - 'radio/**' + - 'tools/build-gh.sh' + - '.gitmodules' + - 'CMakeLists.txt' pull_request: branches: - 'main' - paths-ignore: - - '**.md' - - '.github/ISSUE_TEMPLATE/**' - - '.github/workflows/nightly.yml' - - '.github/workflows/linux_cpn.yml' - - '.github/workflows/macosx_cpn.yml' - - '.github/workflows/win-cpn-32.yml' - - '.github/workflows/win_cpn-64.yml' - - 'companion/**' - - '.gitpod.yml' - - '.devcontainer/**' - - 'fw.json' + paths: + - '.github/workflows/build_fw.yml' + - 'cmake/**' + - 'radio/**' + - 'tools/build-gh.sh' + - '.gitmodules' + - 'CMakeLists.txt' workflow_dispatch: jobs: @@ -43,6 +33,7 @@ jobs: matrix: target: - x9dp2019 + - tx15 - tx16s - nv14 - el18 @@ -93,12 +84,14 @@ jobs: target: - nv14;el18 - pl18;pl18ev;pl18u + - pa01 - t12max - t15;t16;t18 - zorro;pocket;mt12;commando8 - tprov2;tpros;bumblebee - t20;t20v2;t14 - tx12mk2;boxer;gx12 + - tx15 - tx16s - f16 - v12;v14;v16 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 63b9c3a7530..4a9157a5a46 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -18,6 +18,7 @@ jobs: target: - nv14;el18 - pl18;pl18ev;pl18u + - pa01 - t12max - t15;t16;t18 - zorro;pocket;mt12;commando8 @@ -35,6 +36,7 @@ jobs: - mt12 - nb4p - st16 + - tx15 - dro1 container: image: ghcr.io/edgetx/edgetx-dev:latest diff --git a/.github/workflows/validate_fw_json.yml b/.github/workflows/validate_fw_json.yml new file mode 100644 index 00000000000..9ee1bcbaf2b --- /dev/null +++ b/.github/workflows/validate_fw_json.yml @@ -0,0 +1,23 @@ +--- +name: Validate fw.json +on: + push: + paths: + - 'fw.json' + pull_request: + paths: + - 'fw.json' + workflow_dispatch: + +jobs: + json-validate: + name: Validate fw.json file + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - name: Validate fw.json syntax and schema + run: python3 tools/validate-json.py --syntax-only + + - name: Validate fw.json alphabetical order + run: python3 tools/validate-json.py --order-only diff --git a/.github/workflows/win_cpn-64.yml b/.github/workflows/win_cpn-64.yml index 212f0d06891..e5cbcd7ca13 100644 --- a/.github/workflows/win_cpn-64.yml +++ b/.github/workflows/win_cpn-64.yml @@ -23,11 +23,13 @@ on: env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - CMAKE_GENERATOR: "MSYS Makefiles" + CMAKE_BUILD_TYPE: "Release" + CMAKE_GENERATOR: "Ninja" QT_VERSION: "6.9.0" - MINGW_VERSION: "win64_mingw" - MINGW_PATH: "mingw_64" + QT_ARCH: "win64_msvc2022_64" + SDL_VERSION: "2.32.8" + CXX: "clang++" + CC: "clang" jobs: build: @@ -38,26 +40,9 @@ jobs: runs-on: windows-latest defaults: run: - shell: msys2 {0} + shell: bash steps: - - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - update: true - install: git make mingw-w64-x86_64-toolchain - - - name: Install Dependencies - run: | - pacman -S --noconfirm mingw-w64-x86_64-cmake \ - mingw-w64-x86_64-ninja \ - mingw-w64-x86_64-zlib \ - mingw-w64-x86_64-SDL2 \ - mingw-w64-x86_64-clang \ - mingw-w64-x86_64-nsis \ - mingw-w64-x86_64-dfu-util \ - mingw-w64-x86_64-openssl - - name: Check out the repo uses: actions/checkout@v4 with: @@ -69,23 +54,70 @@ jobs: AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini with: cache: true - cache-key-prefix: 'install-qt-action-win64' + cache-key-prefix: 'install-qt-action-${{ env.QT_ARCH }}' version: ${{ env.QT_VERSION }} - arch: ${{ env.MINGW_VERSION }} + arch: ${{ env.QT_ARCH }} modules: 'qtmultimedia qtserialport' + - name: Setup SDL2 + id: setup-sdl2 + uses: libsdl-org/setup-sdl@v1 + with: + version: ${{ env.SDL_VERSION }} + build-type: "Release" + - name: Install Python Dependencies run: | echo $PATH $Python3_ROOT_DIR/python3.exe -m pip install clang jinja2 lz4 pillow + - name: Setup dfu-util and libusb + run: | + #!/bin/bash + set -e + + echo "Setting up dfu-util and libusb..." + + # Create target directory + mkdir -p dfu-util-0.11 + + # Download and extract dfu-util + echo "Downloading dfu-util binaries..." + curl -LO https://dfu-util.sourceforge.net/releases/dfu-util-0.11-binaries.tar.xz + tar -xf dfu-util-0.11-binaries.tar.xz + cp dfu-util-0.11-binaries/win64/dfu-util.exe dfu-util-0.11/ + + # Install 7zip if not available + if ! command -v 7z &> /dev/null; then + echo "Installing 7zip..." + sudo apt-get update -qq + sudo apt-get install -y p7zip-full + fi + + # Download and extract libusb + echo "Downloading libusb..." + curl -LO https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z + 7z x -olibusb-1.0.29 libusb-1.0.29.7z > /dev/null + cp libusb-1.0.29/VS2022/MS64/dll/* dfu-util-0.11/ + + # Clean up temporary files + rm -f dfu-util-0.11-binaries.tar.xz libusb-1.0.29.7z + rm -rf dfu-util-0.11-binaries libusb-1.0.29 + + echo "Setup complete. Contents of dfu-util-0.11:" + ls -la dfu-util-0.11/ + + echo "LIBUSB1_ROOT_DIR=$(pwd)/dfu-util-0.11" >> $GITHUB_ENV + echo "DFU_UTIL_ROOT_DIR=$(pwd)/dfu-util-0.11" >> $GITHUB_ENV + + + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Build - working-directory: ${{github.workspace}} - env: - CMAKE_GENERATOR: Ninja run: | mkdir output && \ - CMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt/$QT_VERSION/$MINGW_PATH \ + CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \ tools/build-companion.sh "$(pwd)" "$(pwd)/output/" - name: Compose release filename diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index 6d8775cde3b..5c0b9be009e 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -135,6 +135,8 @@ uint32_t Boards::getFourCC(Type board) return 0x4078746F; case BOARD_RADIOMASTER_TX16S: return 0x3878746F; + case BOARD_RADIOMASTER_TX15: + return 0x4978746F; case BOARD_RADIOMASTER_TX12: return 0x4178746F; case BOARD_RADIOMASTER_TX12_MK2: @@ -152,6 +154,8 @@ uint32_t Boards::getFourCC(Type board) case BOARD_FLYSKY_PL18EV: case BOARD_FLYSKY_PL18U: return 0x4878746F; + case BOARD_FLYSKY_PA01: + return 0x4A78746F; case BOARD_FLYSKY_ST16: return 0x4C78746F; case BOARD_HELLORADIOSKY_V14: @@ -159,7 +163,7 @@ uint32_t Boards::getFourCC(Type board) case BOARD_HELLORADIOSKY_V16: return 0x4E78746F; case BOARD_DUMBORC_DRO1: - return 0x4A78746F; + return 0x4F78746F; default: return 0; } @@ -210,8 +214,10 @@ int Boards::getEEpromSize(Board::Type board) case BOARD_JUMPER_T16: case BOARD_JUMPER_T18: case BOARD_RADIOMASTER_TX16S: + case BOARD_RADIOMASTER_TX15: case BOARD_FLYSKY_NV14: case BOARD_FLYSKY_EL18: + case BOARD_FLYSKY_PA01: case BOARD_FLYSKY_PL18: case BOARD_FLYSKY_PL18EV: case BOARD_FLYSKY_PL18U: @@ -269,12 +275,14 @@ int Boards::getFlashSize(Type board) case BOARD_JUMPER_T16: case BOARD_JUMPER_T18: case BOARD_RADIOMASTER_TX16S: + case BOARD_RADIOMASTER_TX15: case BOARD_FLYSKY_NV14: case BOARD_FLYSKY_EL18: + case BOARD_FLYSKY_PA01: // 8MB SDRAM case BOARD_FLYSKY_PL18: case BOARD_FLYSKY_PL18EV: case BOARD_FLYSKY_PL18U: - case BOARD_FLYSKY_ST16: + case BOARD_FLYSKY_ST16: // 8MB SDRAM case BOARD_FATFISH_F16: case BOARD_HELLORADIOSKY_V16: case BOARD_DUMBORC_DRO1: @@ -380,19 +388,21 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) case LcdHeight: if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)) return 480; - else if (IS_FAMILY_PL18(board) || IS_JUMPER_T15(board) || IS_FLYSKY_ST16(board)) + else if (IS_FAMILY_PL18(board) || IS_JUMPER_T15(board) || IS_FLYSKY_ST16(board) || IS_RADIOMASTER_TX15(board)) return 320; + else if (IS_FLYSKY_PA01(board)) + return 240; else if (IS_FAMILY_HORUS_OR_T16(board)) return 272; else return 64; case LcdWidth: - if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)) + if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PA01(board)) return 320; else if (IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board)) return 480; - else if (IS_FAMILY_HORUS_OR_T16(board)) + else if (IS_FAMILY_HORUS_OR_T16(board) || IS_RADIOMASTER_TX15(board)) return 480; else if (IS_TARANIS_SMALL(board)) return 128; @@ -416,7 +426,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) return IS_RADIOMASTER_MT12(board); case FunctionSwitchColors: - return IS_RADIOMASTER_GX12(board) || IS_FLYSKY_ST16(board); + return IS_RADIOMASTER_GX12(board) || IS_FLYSKY_ST16(board) || IS_FLYSKY_PA01(board) || IS_RADIOMASTER_TX15(board); default: return getBoardJson(board)->getCapability(capability); @@ -646,6 +656,8 @@ QString Boards::getBoardName(Board::Type board) return "Radiomaster TX12 Mark II"; case BOARD_RADIOMASTER_TX16S: return "Radiomaster TX16S"; + case BOARD_RADIOMASTER_TX15: + return "Radiomaster TX15"; case BOARD_RADIOMASTER_ZORRO: return "Radiomaster Zorro"; case BOARD_RADIOMASTER_GX12: @@ -654,6 +666,8 @@ QString Boards::getBoardName(Board::Type board) return "FlySky NV14"; case BOARD_FLYSKY_EL18: return "FlySky EL18"; + case BOARD_FLYSKY_PA01: + return "FlySky PA01"; case BOARD_FLYSKY_PL18: return "FlySky PL18"; case BOARD_FLYSKY_PL18EV: @@ -774,7 +788,6 @@ int Boards::getDefaultInternalModules(Board::Type board) case BOARD_JUMPER_TPROV2: case BOARD_FLYSKY_PL18: case BOARD_FLYSKY_PL18EV: - case BOARD_FLYSKY_ST16: case BOARD_DUMBORC_DRO1: return (int)MODULE_TYPE_MULTIMODULE; @@ -782,6 +795,7 @@ int Boards::getDefaultInternalModules(Board::Type board) case BOARD_FATFISH_F16: case BOARD_HELLORADIOSKY_V14: case BOARD_HELLORADIOSKY_V16: + case BOARD_RADIOMASTER_TX15: case BOARD_IFLIGHT_COMMANDO8: case BOARD_JUMPER_BUMBLEBEE: case BOARD_JUMPER_T12MAX: @@ -803,6 +817,8 @@ int Boards::getDefaultInternalModules(Board::Type board) case BOARD_FLYSKY_EL18: case BOARD_FLYSKY_PL18U: + case BOARD_FLYSKY_PA01: // ANT + case BOARD_FLYSKY_ST16: // ANT return (int)MODULE_TYPE_FLYSKY_AFHDS3; default: @@ -846,6 +862,7 @@ void Boards::getBattRange(Board::Type board, int& vmin, int& vmax, unsigned int& case BOARD_X10: case BOARD_X10_EXPRESS: case BOARD_RADIOMASTER_TX16S: + case BOARD_RADIOMASTER_TX15: case BOARD_JUMPER_T16: case BOARD_JUMPER_T18: case BOARD_JUMPER_T20: @@ -869,7 +886,8 @@ void Boards::getBattRange(Board::Type board, int& vmin, int& vmax, unsigned int& BR(35, 43, 37) break; case BOARD_FLYSKY_ST16: - BR(70, 86,80) + case BOARD_FLYSKY_PA01: + BR(70, 86, 80) break; case BOARD_IFLIGHT_COMMANDO8: BR(30, 42, 32) diff --git a/companion/src/firmwares/boards.h b/companion/src/firmwares/boards.h index 350b0ea4d47..d1af535225f 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -64,6 +64,7 @@ namespace Board { BOARD_JUMPER_T15, BOARD_JUMPER_T16, BOARD_RADIOMASTER_TX16S, + BOARD_RADIOMASTER_TX15, BOARD_JUMPER_T18, BOARD_JUMPER_T20, BOARD_RADIOMASTER_TX12, @@ -74,6 +75,7 @@ namespace Board { BOARD_JUMPER_TLITE, BOARD_JUMPER_TLITE_F4, BOARD_FLYSKY_NV14, + BOARD_FLYSKY_PA01, BOARD_FLYSKY_PL18, BOARD_FLYSKY_PL18EV, BOARD_FLYSKY_PL18U, @@ -561,6 +563,11 @@ inline bool IS_RADIOMASTER_TX16S(Board::Type board) return board == Board::BOARD_RADIOMASTER_TX16S; } +inline bool IS_RADIOMASTER_TX15(Board::Type board) +{ + return board == Board::BOARD_RADIOMASTER_TX15; +} + inline bool IS_RADIOMASTER_TX12(Board::Type board) { return board == Board::BOARD_RADIOMASTER_TX12; @@ -623,12 +630,13 @@ inline bool IS_DUMBORC_DRO1(Board::Type board) inline bool IS_FAMILY_T16(Board::Type board) { - return board == Board::BOARD_JUMPER_T15 || + return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_FATFISH_F16 || board == Board::BOARD_HELLORADIOSKY_V16 || + board == Board::BOARD_RADIOMASTER_TX15 || board == Board::BOARD_DUMBORC_DRO1; } @@ -668,6 +676,11 @@ inline bool IS_FLYSKY_EL18(Board::Type board) return (board == Board::BOARD_FLYSKY_EL18); } +inline bool IS_FLYSKY_PA01(Board::Type board) +{ + return (board == Board::BOARD_FLYSKY_PA01); +} + inline bool IS_FLYSKY_PL18(Board::Type board) { return (board == Board::BOARD_FLYSKY_PL18); @@ -772,7 +785,7 @@ inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board) { return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board)/*generally*/ || IS_FLYSKY_EL18(board)/*generally*/ - || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board)/*generally*/; + || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board)/*generally*/ || IS_FLYSKY_PA01(board)/*generally*/; } inline bool IS_HORUS_OR_TARANIS(Board::Type board) diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 63ec013b770..ea11d9a3f9e 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -326,7 +326,8 @@ int OpenTxFirmware::getCapability(::Capability capability) IS_JUMPER_T15(board) || IS_JUMPER_T18(board) || IS_JUMPER_T20(board) || IS_JUMPER_TPRO(board) || IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_GX12(board) || IS_RADIOMASTER_MT12(board) || IS_RADIOMASTER_POCKET(board) || IS_RADIOMASTER_TX12(board) || IS_RADIOMASTER_TX12_MK2(board) || - IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_ZORRO(board) || IS_DUMBORC_DRO1(board)); + IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_ZORRO(board) || IS_RADIOMASTER_TX15(board) || + IS_DUMBORC_DRO1(board)); case HasSoftwareSerialPower: return IS_RADIOMASTER_TX16S(board) || IS_DUMBORC_DRO1(board); case HasIntModuleMulti: @@ -496,6 +497,12 @@ void registerOpenTxFirmwares() addOpenTxRfOptions(firmware, FLEX + AFHDS2A + AFHDS3); registerOpenTxFirmware(firmware); + /* FlySky PA01 board */ + firmware = new OpenTxFirmware(FIRMWAREID("pa01"), Firmware::tr("FlySky PA01"), BOARD_FLYSKY_PA01); + addOpenTxFrskyOptions(firmware); + addOpenTxRfOptions(firmware, FLEX + AFHDS3); + registerOpenTxFirmware(firmware); + /* FlySky PL18 board */ firmware = new OpenTxFirmware(FIRMWAREID("pl18"), Firmware::tr("FlySky PL18"), BOARD_FLYSKY_PL18); addOpenTxFrskyOptions(firmware); @@ -812,6 +819,13 @@ void registerOpenTxFirmwares() registerOpenTxFirmware(firmware); addOpenTxRfOptions(firmware, FLEX); + /* Radiomaster TX15 board */ + firmware = new OpenTxFirmware(FIRMWAREID("tx15"), Firmware::tr("Radiomaster TX15"), BOARD_RADIOMASTER_TX15); + addOpenTxFrskyOptions(firmware); + addOpenTxRfOptions(firmware, FLEX); + firmware->addOptionsGroup({opt_bt, opt_internal_gps}); + registerOpenTxFirmware(firmware); + /* Radiomaster TX16S board */ firmware = new OpenTxFirmware(FIRMWAREID("tx16s"), Firmware::tr("Radiomaster TX16S / SE / Hall / Masterfire"), BOARD_RADIOMASTER_TX16S); addOpenTxFrskyOptions(firmware); diff --git a/fw.json b/fw.json index 7bcfb2c2192..7ddbffb3d06 100644 --- a/fw.json +++ b/fw.json @@ -2,11 +2,12 @@ "targets": [ ["Fatfish F16","f16-"], ["Flysky EL18", "el18-"], + ["Flysky NB4+", "nb4p-"], ["Flysky NV14", "nv14-"], + ["Flysky PA01", "pa01-"], ["Flysky PL18", "pl18-"], ["Flysky PL18EV", "pl18ev-"], ["Flysky PL18U", "pl18u-"], - ["Flysky NB4+", "nb4p-"], ["Flysky ST16", "st16-"], ["FrSky Horus X10", "x10-"], ["FrSky Horus X10 Express", "x10express-"], @@ -20,6 +21,8 @@ ["HelloRadioSky V16", "v16-"], ["iFlight Commando 8", "commando8-"], ["Jumper Bumblebee", "bumblebee-"], + ["Jumper T-Pro S", "tpros-"], + ["Jumper T-Pro V2", "tprov2-"], ["Jumper T12 MAX", "t12max-"], ["Jumper T14", "t14-"], ["Jumper T15", "t15-"], @@ -27,15 +30,14 @@ ["Jumper T18", "t18-"], ["Jumper T20", "t20-"], ["Jumper T20 V2", "t20v2-"], - ["Jumper T-Pro V2", "tprov2-"], - ["Jumper T-Pro S", "tpros-"], ["RadioMaster Boxer", "boxer-"], + ["RadioMaster GX12", "gx12-"], ["RadioMaster MT12","mt12-"], ["RadioMaster Pocket", "pocket-"], ["RadioMaster TX12MK2", "tx12mk2-"], + ["RadioMaster TX15", "tx15-"], ["RadioMaster TX16S", "tx16s-"], ["RadioMaster Zorro","zorro-"], - ["RadioMaster GX12", "gx12-"], ["DumboRC DRO1", "dro1-"] ], "changelog": "- Major initial bug fixes" diff --git a/radio/src/targets/horus/usb_descriptor.h b/radio/src/targets/horus/usb_descriptor.h index b9085a8b419..8c2529c22b6 100644 --- a/radio/src/targets/horus/usb_descriptor.h +++ b/radio/src/targets/horus/usb_descriptor.h @@ -45,14 +45,14 @@ #define USB_NAME "Fatfish F16" #define USB_MANUFACTURER 'F', 'A', 'T', 'F', 'I', 'S', 'H', ' ' /* 8 bytes */ #define USB_PRODUCT 'F', 'F', ' ', 'F', '1', '6', ' ', ' ' /* 8 Bytes */ -#elif defined(PCBX10) - #define USB_NAME "FrSky X10" - #define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */ - #define USB_PRODUCT 'X', '1', '0', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */ #elif defined(RADIO_V16) #define USB_NAME "HelloRadioSky V16" #define USB_MANUFACTURER 'H', 'R', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */ #define USB_PRODUCT 'V', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */ +#elif defined(PCBX10) + #define USB_NAME "FrSky X10" + #define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */ + #define USB_PRODUCT 'X', '1', '0', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */ #elif defined(RADIO_DRO1) #define USB_NAME "DumboRC DRO1" #define USB_MANUFACTURER 'D', 'U', 'M', 'B', 'O', 'R', 'C', ' ' /* 8 bytes */ diff --git a/radio/util/hw_defs/pot_config.py b/radio/util/hw_defs/pot_config.py index 4649d87a0b7..2078b11dd85 100644 --- a/radio/util/hw_defs/pot_config.py +++ b/radio/util/hw_defs/pot_config.py @@ -142,6 +142,10 @@ "SL1": {"default": "SLIDER"}, "SL2": {"default": "SLIDER"} }, + "tx15": { + "P1": {"default": "POT"}, + "P2": {"default": "POT"}, + }, "tx16s": { "P1": {"default": "POT_CENTER"}, "P2": {"default": "MULTIPOS"}, @@ -244,6 +248,10 @@ "SL1": {"default": "SLIDER"}, "SL2": {"default": "SLIDER"}, }, + "pa01": { + "SL1": {"default": "SLIDER"}, + "SL2": {"default": "SLIDER"}, + }, "dro1": { "P1": {"default": "POT"}, "P2": {"default": "MULTIPOS"}, diff --git a/tools/build-common.sh b/tools/build-common.sh index 0025f38fbf6..7e819139cdb 100644 --- a/tools/build-common.sh +++ b/tools/build-common.sh @@ -116,6 +116,9 @@ get_target_build_options() { t18) BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=T18" ;; + tx15) + BUILD_OPTIONS+="-DPCB=TX15 -DNANO=NO" + ;; tx16s) BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=TX16S" ;; @@ -158,6 +161,9 @@ get_target_build_options() { st16) BUILD_OPTIONS+="-DPCB=ST16 -DNANO=NO" ;; + pa01) + BUILD_OPTIONS+="-DPCB=PA01 -DNANO=NO" + ;; dro1) BUILD_OPTIONS+="-DPCB=X10 -DPCBREV=DRO1" ;; diff --git a/tools/generate-hw-defs.sh b/tools/generate-hw-defs.sh index c775aba1d9d..16f5b3fbf24 100755 --- a/tools/generate-hw-defs.sh +++ b/tools/generate-hw-defs.sh @@ -9,7 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" : "${SRCDIR:=$(dirname "$(pwd)/$0")/..}" -: ${FLAVOR:="nv14;el18;pl18;pl18ev;nb4p;st16;t12;t12max;t15;t16;t18;t8;zorro;pocket;commando8;tlite;tpro;tprov2;tpros;bumblebee;t20;t20v2;t14;lr3pro;mt12;gx12;tx12;tx12mk2;boxer;tx16s;x10;x10express;x12s;x7;x7access;x9d;x9dp;x9dp2019;x9e;x9lite;x9lites;xlite;xlites;f16;v14;v12;dro1"} +: ${FLAVOR:="nv14;el18;pl18;pl18ev;nb4p;st16;t12;t12max;t15;t16;t18;t8;zorro;pocket;commando8;tlite;tpro;tprov2;tpros;bumblebee;t20;t20v2;t14;lr3pro;mt12;gx12;tx12;tx12mk2;boxer;tx16s;x10;x10express;x12s;x7;x7access;x9d;x9dp;x9dp2019;x9e;x9lite;x9lites;xlite;xlites;f16;v14;v12;tx15;dro1"} : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_RULE_MESSAGES=OFF -Wno-dev -DCMAKE_MESSAGE_LOG_LEVEL=WARNING"} # wipe build directory clean diff --git a/tools/generate-yaml.sh b/tools/generate-yaml.sh index bde5045c9ce..1813a7f06c1 100755 --- a/tools/generate-yaml.sh +++ b/tools/generate-yaml.sh @@ -11,7 +11,7 @@ if [[ -n ${GCC_ARM} ]] ; then export PATH=${GCC_ARM}:$PATH fi -: ${FLAVOR:="t15;tx16s;pl18;nv14;pl18u;nb4p;x9d;x9dp2019;x9e;xlite;xlites;x7;tpro;t20;f16;gx12;st16;dro1"} +: ${FLAVOR:="t15;tx16s;pl18;nv14;pl18u;nb4p;x9d;x9dp2019;x9e;xlite;xlites;x7;tpro;t20;f16;gx12;st16;pa01;tx15;dro1"} : ${SRCDIR:=$(dirname "$(pwd)/$0")/..} : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_RULE_MESSAGES=OFF -Wno-dev -DDISABLE_COMPANION=YES -DCMAKE_MESSAGE_LOG_LEVEL=WARNING"} diff --git a/tools/msys2_fetch_and_build_all.sh b/tools/msys2_fetch_and_build_all.sh index 554c465546c..881b228b1db 100644 --- a/tools/msys2_fetch_and_build_all.sh +++ b/tools/msys2_fetch_and_build_all.sh @@ -9,7 +9,7 @@ # ----------------------------------------------------------------------------- export BRANCH_NAME="main" # main|2.9|... -export RADIO_TYPE="tx16s" # tx16s|x10|x10express|x12s|x9d|x9dp|x9lite|x9lites|x7|x7access|t12|t12max|tx12|tx12mk2|mt12|gx12|boxer|t8|zorro|pocket|tlite|tpro|t20|t20v2|t14|lr3pro|xlite|xlites|x9dp2019|x9e|x9e-hall|t15|t16|t18|nv14|commando8|dro1 +export RADIO_TYPE="tx16s" # tx16s|x10|x10express|x12s|x9d|x9dp|x9lite|x9lites|x7|x7access|t12|t12max|tx12|tx12mk2|mt12|gx12|boxer|t8|zorro|pocket|tlite|tpro|t20|t20v2|t14|lr3pro|xlite|xlites|x9dp2019|x9e|x9e-hall|t15|t16|t18|nv14|commando8|tx15|dro1 export BUILD_OPTIONS="-DDEFAULT_MODE=2 -DGVARS=YES" @@ -114,6 +114,9 @@ case $RADIO_TYPE in t18) BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T18" ;; + tx15) + BUILD_OPTIONS+=" -DPCB=TX15" + ;; tx16s) BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=TX16S" ;; From 525ec5e24a2697fef967db1f528cdf514fe118f6 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Tue, 9 Sep 2025 02:45:40 +0800 Subject: [PATCH 07/22] fix(radio) : Configure ADC channel direction. --- radio/src/targets/horus/hal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index e3eef51f0d2..2b9f8a90762 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -634,10 +634,12 @@ #define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 } #elif defined(RADIO_T18) #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 } -#elif defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_DRO1) +#elif defined(RADIO_TX16S) || defined(RADIO_F16) #define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 } #elif defined(RADIO_V16) #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 } +#elif defined(RADIO_DRO1) + #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1, 1,1,-1,1} #elif defined(PCBX10) #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, 1,-1,1,1, 1,-1 } #elif defined(PCBX12S) From cf59be0948a3d2582f7124e7c3f12704632a3bc6 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 3 Nov 2025 19:16:07 +0800 Subject: [PATCH 08/22] fix(DRO1) : Fix the order of 'DRO1' in the 'fw.json' file. --- fw.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fw.json b/fw.json index 78a9dbbc092..b58807d7e55 100644 --- a/fw.json +++ b/fw.json @@ -1,5 +1,6 @@ { "targets": [ + ["DumboRC DRO1", "dro1-"], ["Fatfish F16","f16-"], ["Flysky EL18", "el18-"], ["Flysky NB4+", "nb4p-"], @@ -38,8 +39,7 @@ ["RadioMaster TX12MK2", "tx12mk2-"], ["RadioMaster TX15", "tx15-"], ["RadioMaster TX16S", "tx16s-"], - ["RadioMaster Zorro","zorro-"], - ["DumboRC DRO1", "dro1-"] + ["RadioMaster Zorro","zorro-"] ], "changelog": "- Major initial bug fixes" } From 82d0ab0647a8ae0fb450f89d1c35280689159989 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 8 Dec 2025 00:27:47 +0800 Subject: [PATCH 09/22] fix(DRO1) : Resolve merge conflicts for deleted files (tools/msys2_fetch_and_build_all.sh). --- tools/msys2_fetch_and_build_all.sh | 290 ----------------------------- 1 file changed, 290 deletions(-) delete mode 100644 tools/msys2_fetch_and_build_all.sh diff --git a/tools/msys2_fetch_and_build_all.sh b/tools/msys2_fetch_and_build_all.sh deleted file mode 100644 index 19dd3d9345a..00000000000 --- a/tools/msys2_fetch_and_build_all.sh +++ /dev/null @@ -1,290 +0,0 @@ -#! /usr/bin/env bash - -## Bash script to show how to get EdgeTX source from GitHub, -## how to build TX16S firmware, Companion, Simulator, radio simulator -## library and how to create an installation package. -## Let it run as normal user in MSYS2 MinGW 64-bit console (blue icon). -## -## Note: This script is tested to work properly only for the branch it stems from. - -# ----------------------------------------------------------------------------- -export BRANCH_NAME="main" # main|2.9|... -export RADIO_TYPE="tx16s" # tx16s|x10|x10express|x12s|x9d|x9dp|x9lite|x9lites|x7|x7access|t12|t12max|tx12|tx12mk2|mt12|gx12|boxer|t8|zorro|pocket|tlite|tpro|t20|t20v2|t14|lr3pro|xlite|xlites|x9dp2019|x9e|x9e-hall|t15|t15pro|t16|t18|nv14|commando8|tx15|dro1 - -export BUILD_OPTIONS="-DDEFAULT_MODE=2 -DGVARS=YES" - -echo "Building ${fw_name}" -case $RADIO_TYPE in - x9lite) - BUILD_OPTIONS+=" -DPCB=X9LITE" - ;; - x9lites) - BUILD_OPTIONS+=" -DPCB=X9LITES" - ;; - x7) - BUILD_OPTIONS+=" -DPCB=X7" - ;; - x7access) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=ACCESS -DPXX1=YES" - ;; - t12) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T12 -DINTERNAL_MODULE_MULTI=ON" - ;; - mt12) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=MT12 -DINTERNAL_MODULE_MULTI=ON" - ;; - gx12) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=GX12 -DINTERNAL_MODULE_MULTI=ON" - ;; - tx12) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TX12" - ;; - tx12mk2) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TX12MK2" - ;; - boxer) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=BOXER" - ;; - t8) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T8" - ;; - zorro) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=ZORRO" - ;; - pocket) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=POCKET" - ;; - tlite) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TLITE" - ;; - tpro) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=TPRO" - ;; - t20) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T20" - ;; - t20v2) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T20V2" - ;; - t12max) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T12MAX" - ;; - t14) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=T14" - ;; - lr3pro) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=LR3PRO" - ;; - xlite) - BUILD_OPTIONS+=" -DPCB=XLITE" - ;; - xlites) - BUILD_OPTIONS+=" -DPCB=XLITES" - ;; - x9d) - BUILD_OPTIONS+=" -DPCB=X9D" - ;; - x9dp) - BUILD_OPTIONS+=" -DPCB=X9D+" - ;; - x9dp2019) - BUILD_OPTIONS+=" -DPCB=X9D+ -DPCBREV=2019" - ;; - x9e) - BUILD_OPTIONS+=" -DPCB=X9E" - ;; - x9e-hall) - BUILD_OPTIONS+=" -DPCB=X9E -DSTICKS=HORUS" - ;; - x10) - BUILD_OPTIONS+=" -DPCB=X10" - ;; - x10express) - BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=EXPRESS -DPXX1=YES" - ;; - x12s) - BUILD_OPTIONS+=" -DPCB=X12S" - ;; - t15) - BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T15 -DINTERNAL_MODULE_CRSF=ON" - ;; - t15pro) - BUILD_OPTIONS+=" -DPCB=T15PRO -DINTERNAL_MODULE_CRSF=ON" - ;; - t16) - BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=ON" - ;; - t18) - BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=T18" - ;; - tx15) - BUILD_OPTIONS+=" -DPCB=TX15" - ;; - tx16s) - BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=TX16S" - ;; - nv14) - BUILD_OPTIONS+=" -DPCB=NV14" - ;; - commando8) - BUILD_OPTIONS+=" -DPCB=X7 -DPCBREV=COMMANDO8" - ;; - dro1) - BUILD_OPTIONS+=" -DPCB=X10 -DPCBREV=DRO1" - ;; - *) - echo "Unknown target: $RADIO_TYPE" - exit 1 - ;; -esac - -PAUSEAFTEREACHLINE="false" # true|false -# ----------------------------------------------------------------------------- - -export PROJ_DIR="${HOME}/edgetx" -export SOURCE_DIR="${HOME}/edgetx/edgetx_${BRANCH_NAME}" -export BUILD_OUTPUT_DIR="${SOURCE_DIR}/build-output-${RADIO_TYPE}" - -function log() { - echo "" - echo "=== [INFO] $*" -} -function fail() { - echo "=== [ERROR] $*" - exit 1 -} -function check_command() { - result=$1 - cli_info=$2 - if [[ $result -ne 0 ]]; then - fail "${cli_info} (exit-code=$result)" - else - log "${cli_info} - OK" - return 0 - fi -} - -echo "RADIO_TYPE: ${RADIO_TYPE}" -echo "BRANCH_NAME: ${BRANCH_NAME}" -echo "SOURCE_DIR: ${SOURCE_DIR}" -echo "BUILD_OUTPUT_DIR: ${BUILD_OUTPUT_DIR}" -echo "BUILD_OPTIONS: ${BUILD_OPTIONS}" - -# Parse argument(s) -for arg in "$@" -do - if [[ $arg == "--pause" ]]; then - PAUSEAFTEREACHLINE="true" - fi -done - -STEP=1 -echo "=== Step $((STEP++)): Creating a directory for EdgeTX ===" -mkdir -p ${PROJ_DIR} && cd ${PROJ_DIR} -check_command $? "mkdir -p ${PROJ_DIR} && cd ${PROJ_DIR}" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -if [[ ! -d "${SOURCE_DIR}" ]]; then - echo "=== Step $((STEP++)): Fetching EdgeTX source tree (${BRANCH_NAME} branch) from GitHub ===" - git clone --recursive -b ${BRANCH_NAME} https://github.com/EdgeTX/edgetx.git ${SOURCE_DIR} - check_command $? "git clone --recursive -b ${BRANCH_NAME} https://github.com/EdgeTX/edgetx.git ${SOURCE_DIR}" - cd ${SOURCE_DIR} -else - echo "=== Step $((STEP++)): updating EdgeTX source tree (${BRANCH_NAME} branch) from GitHub ===" - cd ${SOURCE_DIR} - check_command $? "cd ${SOURCE_DIR}" - git checkout ${BRANCH_NAME} - check_command $? "git checkout ${BRANCH_NAME}" - git pull - check_command $? "git pull" - git submodule update --init --recursive - check_command $? "git submodule update --init --recursive" -fi -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Creating build output directory ===" -[[ -d ${BUILD_OUTPUT_DIR} ]] && rm -rf ${BUILD_OUTPUT_DIR} -mkdir -p ${BUILD_OUTPUT_DIR} && cd ${BUILD_OUTPUT_DIR} -check_command $? "mkdir -p ${BUILD_OUTPUT_DIR} && cd ${BUILD_OUTPUT_DIR}" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Running CMake for ${RADIO_TYPE} as an example ===" -cmake -G "MSYS Makefiles" -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/6.9.0/mingw_64 ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../ -check_command $? "cmake -G MSYS Makefiles -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/6.9.0/mingw_64 -DSDL2_LIBRARY_PATH=/mingw64/bin/ ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Running Make configure ===" -make configure -check_command $? "make configure" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Building firmware binary ===" -make -C arm-none-eabi -j`nproc` firmware -check_command $? "make -C arm-none-eabi -j`nproc` firmware" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Renaming firmware binary ===" -mv arm-none-eabi/firmware.bin arm-none-eabi/fw_${RADIO_TYPE}_release.bin -check_command $? "mv arm-none-eabi/firmware.bin arm-none-eabi/fw_${RADIO_TYPE}_release.bin" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Building radio simulator library ===" -make -C native -j`nproc` libsimulator -check_command $? "make -C native -j`nproc` libsimulator" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Building Companion ===" -make -C native -j`nproc` companion -check_command $? "make -C native -j`nproc` companion" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Building Simulator ===" -make -C native -j`nproc` simulator -check_command $? "make -C native -j`nproc` simulator" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." - read -fi - -echo "=== Step $((STEP++)): Making an installer ===" -make -C native installer -check_command $? "make -C native installer" -if [[ $PAUSEAFTEREACHLINE == "true" ]]; then - echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." -fi - -echo "Done. \n\n" -echo "RADIO_TYPE=${RADIO_TYPE}" -echo "" -echo "firmware (${RADIO_TYPE}): ${BUILD_OUTPUT_DIR}/arm-none-eabi/fw_${RADIO_TYPE}_release.bin" -echo "Companion installer: ${BUILD_OUTPUT_DIR}/native/companion/companion-windows-x.x.x.exe" -echo "Companion : ${BUILD_OUTPUT_DIR}/native/Release/companion.exe" -echo "Simulator : ${BUILD_OUTPUT_DIR}/native/Release/simulator.exe" -echo "Simulator library : ${BUILD_OUTPUT_DIR}/native/Release/libedgetx-${RADIO_TYPE}-simulator.dll" From 565fd84b3f3bd5f04ac783316abff143bba1e04a Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Wed, 7 Jan 2026 20:28:06 +0800 Subject: [PATCH 10/22] feat(DRO1) : Supports the latest displayer. --- radio/src/targets/horus/tp_gt911.cpp | 186 +++++++++++++-------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/radio/src/targets/horus/tp_gt911.cpp b/radio/src/targets/horus/tp_gt911.cpp index b1af20f8306..52a380bf3a3 100644 --- a/radio/src/targets/horus/tp_gt911.cpp +++ b/radio/src/targets/horus/tp_gt911.cpp @@ -233,19 +233,19 @@ const uint8_t TOUCH_GT911_Cfg[] = { #elif defined (RADIO_DRO1) const uint8_t TOUCH_GT911_Cfg[] = { GT911_CFG_NUMBER, // 0x8047 Config version - 0xE0, // 0x8048 X output map : x 480 + 0xE0, // 0x8048 X output map : x 480 0x01, 0x10, // 0x804A Y ouptut max : y 272 0x01, GT911_MAX_TP, // 0x804C Touch number - 0xCC, // 0x804D Module switch 1 : 180° rotation - 0x20, // 0x804E Module switch 2 + 0x0C, // 0x804D Module switch 1 : 180° rotation + 0x00, // 0x804E Module switch 2 0x01, // 0x804F Shake_Count - 0x0A, // 0x8050 Filter + 0x08, // 0x8050 Filter 0x28, // 0x8051 Larger touch - 0x0F, // 0x8052 Noise reduction - 0x5A, // 0x8053 Screen touch level - 0x3C, // 0x8054 Screen touch leave + 0x05, // 0x8052 Noise reduction + 0x50, // 0x8053 Screen touch level + 0x32, // 0x8054 Screen touch leave 0x03, // 0x8055 Low power control 0x05, // 0x8056 Refresh rate 0x00, // 0x8057 X threshold @@ -254,60 +254,60 @@ const uint8_t TOUCH_GT911_Cfg[] = { 0x00, // 0x805A Reserved 0x00, // 0x805B Space (top, bottom) 0x00, // 0x805C Space (left, right) - 0x05, // 0x805D Mini filter + 0x00, // 0x805D Mini filter 0x00, // 0x805E Strech R0 0x00, // 0x805F Strech R1 0x00, // 0x8060 Strech R2 0x00, // 0x8061 Strech RM - 0x8A, // 0x8062 Drv groupA num - 0x2A, // 0x8063 Drv groupB num + 0x8B, // 0x8062 Drv groupA num + 0x2B, // 0x8063 Drv groupB num 0x0C, // 0x8064 Sensor num - 0x32, // 0x8065 FreqA factor - 0x34, // 0x8066 FreqB factor - 0x0C, // 0x8067 Panel bit freq - 0x08, + 0x17, // 0x8065 FreqA factor + 0x15, // 0x8066 FreqB factor + 0x31, // 0x8067 Panel bit freq + 0x0D, 0x00, // 0x8069 Reserved 0x00, - 0x00, // 0x806B Panel tx gain - 0x03, // 0x806C Panel rx gain - 0x02, // 0x806D Panel dump shift - 0x25, // 0x806E Drv frame control + 0x01, // 0x806B Panel tx gain + 0x9A, // 0x806C Panel rx gain + 0x04, // 0x806D Panel dump shift + 0x2C, // 0x806E Drv frame control 0x00, // 0x806F Charging level up 0x00, // 0x8070 Module switch 3 0x00, // 0x8071 Gesture distance 0x00, // 0x8072 Gesture long press time 0x00, // 0x8073 X/Y slope adjust - 0x00, // 0x8074 Gesture control - 0x00, // 0x8075 Gesture switch 1 - 0x00, // 0x8076 Gesture switch 2 + 0x03, // 0x8074 Gesture control + 0x64, // 0x8075 Gesture switch 1 + 0x32, // 0x8076 Gesture switch 2 0x00, // 0x8077 Gesture refresh rate 0x00, // 0x8078 Gesture touch level 0x00, // 0x8079 New green wake up level - 0x28, // 0x807A Freq hopping start - 0x55, // 0x807B Freq hopping end - 0x94, // 0x807C Noise detect time - 0xC5, // 0x807D Hopping flag - 0x02, // 0x807E Hopping flag - 0x07, // 0x807F Noise threshold + 0x00, // 0x807A Freq hopping start + 0x00, // 0x807B Freq hopping end + 0x00, // 0x807C Noise detect time + 0xC0, // 0x807D Hopping flag + 0x00, // 0x807E Hopping flag + 0x00, // 0x807F Noise threshold 0x00, // 0x8080 Nois min threshold old 0x00, // 0x8081 Reserved - 0x04, // 0x8082 Hopping sensor group - 0x8D, // 0x8083 Hopping Seg1 normalize - 0x2B, // 0x8084 Hopping Seg1 factor + 0x00, // 0x8082 Hopping sensor group + 0x9B, // 0x8083 Hopping Seg1 normalize + 0x11, // 0x8084 Hopping Seg1 factor 0x00, // 0x8085 Main clock adjust - 0x80, // 0x8086 Hopping Seg2 normalize - 0x32, // 0x8087 Hopping Seg2 factor + 0x59, // 0x8086 Hopping Seg2 normalize + 0x1F, // 0x8087 Hopping Seg2 factor 0x00, // 0x8088 Reserved - 0x75, // 0x8089 Hopping Seg3 normalize - 0x3A, // 0x808A Hopping Seg3 factor + 0x35, // 0x8089 Hopping Seg3 normalize + 0x37, // 0x808A Hopping Seg3 factor 0x00, // 0x808B Reserved - 0x6C, // 0x808C Hopping Seg4 normalize - 0x43, // 0x808D Hopping Seg4 factor + 0x22, // 0x808C Hopping Seg4 normalize + 0x61, // 0x808D Hopping Seg4 factor 0x00, // 0x808E Reserved - 0x64, // 0x808F Hopping Seg5 normalize - 0x4F, // 0x8090 Hopping Seg5 factor + 0x1B, // 0x808F Hopping Seg5 normalize + 0xAB, // 0x8090 Hopping Seg5 factor 0x00, // 0x8091 Reserved - 0x64, // 0x8092 Hopping Seg6 normalize + 0x1B, // 0x8092 Hopping Seg6 normalize 0x00, // 0x8093 Key1 0x00, // 0x8094 Key2 0x00, // 0x8095 Key3 @@ -358,64 +358,64 @@ const uint8_t TOUCH_GT911_Cfg[] = { 0x02, // 0x80C2 Sensor CH11 0xFF, // 0x80C3 Sensor CH12 0xFF, // 0x80C4 Sensor CH13 - 0x00, // 0x80C5 Reserved - 0x00, // 0x80C6 Reserved - 0x00, // 0x80C7 Reserved - 0x00, // 0x80C8 Reserved - 0x00, // 0x80C9 Reserved - 0x00, // 0x80CA Reserved - 0x00, // 0x80CB Reserved - 0x00, // 0x80CC Reserved - 0x00, // 0x80CD Reserved - 0x00, // 0x80CE Reserved - 0x00, // 0x80CF Reserved - 0x00, // 0x80D0 Reserved - 0x00, // 0x80D1 Reserved - 0x00, // 0x80D2 Reserved - 0x00, // 0x80D3 Reserved - 0x00, // 0x80D4 Reserved - 0x24, // 0x80D5 Driver CH0 - 0x22, // 0x80D6 Driver CH1 - 0x21, // 0x80D7 Driver CH2 - 0x20, // 0x80D8 Driver CH3 - 0x1F, // 0x80D9 Driver CH4 - 0x1E, // 0x80DA Driver CH5 - 0x1D, // 0x80DB Driver CH6 - 0x1C, // 0x80DC Driver CH7 - 0x18, // 0x80DD Driver CH8 - 0x16, // 0x80DE Driver CH9 - 0x13, // 0x80DF Driver CH10 - 0x12, // 0x80E0 Driver CH11 - 0x10, // 0x80E1 Driver CH12 - 0x0F, // 0x80E2 Driver CH13 - 0x0A, // 0x80E3 Driver CH14 - 0x08, // 0x80E4 Driver CH15 - 0x06, // 0x80E5 Driver CH16 - 0x04, // 0x80E6 Driver CH17 - 0x02, // 0x80E7 Driver CH18 - 0x00, // 0x80E8 Driver CH19 - 0xFF, // 0x80E9 Driver CH20 - 0xFF, // 0x80EA Driver CH21 + 0xFF, // 0x80C5 Reserved + 0xFF, // 0x80C6 Reserved + 0xFF, // 0x80C7 Reserved + 0xFF, // 0x80C8 Reserved + 0xFF, // 0x80C9 Reserved + 0xFF, // 0x80CA Reserved + 0xFF, // 0x80CB Reserved + 0xFF, // 0x80CC Reserved + 0xFF, // 0x80CD Reserved + 0xFF, // 0x80CE Reserved + 0xFF, // 0x80CF Reserved + 0xFF, // 0x80D0 Reserved + 0xFF, // 0x80D1 Reserved + 0xFF, // 0x80D2 Reserved + 0xFF, // 0x80D3 Reserved + 0xFF, // 0x80D4 Reserved + 0x26, // 0x80D5 Driver CH0 + 0x24, // 0x80D6 Driver CH1 + 0x22, // 0x80D7 Driver CH2 + 0x21, // 0x80D8 Driver CH3 + 0x20, // 0x80D9 Driver CH4 + 0x1F, // 0x80DA Driver CH5 + 0x1E, // 0x80DB Driver CH6 + 0x1D, // 0x80DC Driver CH7 + 0x1C, // 0x80DD Driver CH8 + 0x18, // 0x80DE Driver CH9 + 0x16, // 0x80DF Driver CH10 + 0x13, // 0x80E0 Driver CH11 + 0x12, // 0x80E1 Driver CH12 + 0x10, // 0x80E2 Driver CH13 + 0x0F, // 0x80E3 Driver CH14 + 0x0C, // 0x80E4 Driver CH15 + 0x0A, // 0x80E5 Driver CH16 + 0x08, // 0x80E6 Driver CH17 + 0x06, // 0x80E7 Driver CH18 + 0x04, // 0x80E8 Driver CH19 + 0x02, // 0x80E9 Driver CH20 + 0x00, // 0x80EA Driver CH21 0xFF, // 0x80EB Driver CH22 0xFF, // 0x80EC Driver CH23 0xFF, // 0x80ED Driver CH24 0xFF, // 0x80EE Driver CH25 - 0x00, // 0x80EF Reserved - 0x00, // 0x80F0 Reserved - 0x00, // 0x80F1 Reserved - 0x00, // 0x80F2 Reserved - 0x00, // 0x80F3 Reserved - 0x00, // 0x80F4 Reserved - 0x00, // 0x80F5 Reserved - 0x00, // 0x80F6 Reserved - 0x00, // 0x80F7 Reserved - 0x00, // 0x80F8 Reserved - 0x00, // 0x80F9 Reserved - 0x00, // 0x80FA Reserved - 0x00, // 0x80FB Reserved - 0x00, // 0x80FC Reserved - 0x00, // 0x80FD Reserved - 0x00 // 0x80FE Reserved + 0xFF, // 0x80EF Reserved + 0xFF, // 0x80F0 Reserved + 0xFF, // 0x80F1 Reserved + 0xFF, // 0x80F2 Reserved + 0xFF, // 0x80F3 Reserved + 0xFF, // 0x80F4 Reserved + 0xFF, // 0x80F5 Reserved + 0xFF, // 0x80F6 Reserved + 0xFF, // 0x80F7 Reserved + 0xFF, // 0x80F8 Reserved + 0xFF, // 0x80F9 Reserved + 0xFF, // 0x80FA Reserved + 0xFF, // 0x80FB Reserved + 0xFF, // 0x80FC Reserved + 0xFF, // 0x80FD Reserved + 0xFF // 0x80FE Reserved }; #else From 155e4aa98ae2e1e6ccbaf166f308340aa70abd2a Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Tue, 17 Mar 2026 19:35:55 +0800 Subject: [PATCH 11/22] fix(DRO1): Resolve conflicts between the repository and this branch. --- radio/src/CMakeLists.txt | 22 +- radio/src/boards/hw_defs/boxer.json | 333 +++++++++++ radio/src/boards/hw_defs/bumblebee.json | 402 +++++++++++++ radio/src/boards/hw_defs/commando8.json | 282 ++++++++++ radio/src/boards/hw_defs/dro1.json | 474 ++++++++++++++++ radio/src/boards/hw_defs/el18.json | 347 ++++++++++++ radio/src/boards/hw_defs/f16.json | 441 +++++++++++++++ radio/src/boards/hw_defs/gx12.json | 443 +++++++++++++++ radio/src/boards/hw_defs/lr3pro.json | 262 +++++++++ radio/src/boards/hw_defs/mt12.json | 311 +++++++++++ radio/src/boards/hw_defs/nb4p.json | 174 ++++++ radio/src/boards/hw_defs/nv14.json | 347 ++++++++++++ radio/src/boards/hw_defs/pa01.json | 310 +++++++++++ radio/src/boards/hw_defs/pl18.json | 318 +++++++++++ radio/src/boards/hw_defs/pl18ev.json | 362 ++++++++++++ radio/src/boards/hw_defs/pl18u.json | 333 +++++++++++ radio/src/boards/hw_defs/pocket.json | 296 ++++++++++ radio/src/boards/hw_defs/st16.json | 410 ++++++++++++++ radio/src/boards/hw_defs/t12.json | 338 +++++++++++ radio/src/boards/hw_defs/t12max.json | 296 ++++++++++ radio/src/boards/hw_defs/t14.json | 296 ++++++++++ radio/src/boards/hw_defs/t15.json | 376 +++++++++++++ radio/src/boards/hw_defs/t15pro.json | 380 +++++++++++++ radio/src/boards/hw_defs/t16.json | 455 +++++++++++++++ radio/src/boards/hw_defs/t18.json | 457 +++++++++++++++ radio/src/boards/hw_defs/t20.json | 535 ++++++++++++++++++ radio/src/boards/hw_defs/t20v2.json | 535 ++++++++++++++++++ radio/src/boards/hw_defs/t8.json | 278 +++++++++ radio/src/boards/hw_defs/tlite.json | 262 +++++++++ radio/src/boards/hw_defs/tpro.json | 368 ++++++++++++ radio/src/boards/hw_defs/tpros.json | 296 ++++++++++ radio/src/boards/hw_defs/tprov2.json | 396 +++++++++++++ radio/src/boards/hw_defs/tx12.json | 348 ++++++++++++ radio/src/boards/hw_defs/tx12mk2.json | 325 +++++++++++ radio/src/boards/hw_defs/tx15.json | 350 ++++++++++++ radio/src/boards/hw_defs/tx16s.json | 463 +++++++++++++++ radio/src/boards/hw_defs/tx16smk3.json | 464 +++++++++++++++ radio/src/boards/hw_defs/v12.json | 359 ++++++++++++ radio/src/boards/hw_defs/v14.json | 359 ++++++++++++ radio/src/boards/hw_defs/v16.json | 461 +++++++++++++++ radio/src/boards/hw_defs/x10.json | 461 +++++++++++++++ radio/src/boards/hw_defs/x10express.json | 461 +++++++++++++++ radio/src/boards/hw_defs/x12s.json | 454 +++++++++++++++ radio/src/boards/hw_defs/x7.json | 328 +++++++++++ radio/src/boards/hw_defs/x7access.json | 314 +++++++++++ radio/src/boards/hw_defs/x9d+.json | 381 +++++++++++++ radio/src/boards/hw_defs/x9d+2019.json | 369 ++++++++++++ radio/src/boards/hw_defs/x9d.json | 370 ++++++++++++ radio/src/boards/hw_defs/x9e.json | 573 +++++++++++++++++++ radio/src/boards/hw_defs/x9lite.json | 273 +++++++++ radio/src/boards/hw_defs/x9lites.json | 301 ++++++++++ radio/src/boards/hw_defs/xlite.json | 279 ++++++++++ radio/src/boards/hw_defs/xlites.json | 307 ++++++++++ radio/src/boards/hw_defs/zorro.json | 349 ++++++++++++ radio/src/targets/horus/CMakeLists.txt | 9 - radio/src/targets/horus/hal.h | 564 +------------------ radio/util/hw_defs/README.md | 47 +- radio/util/hw_defs/generator.py | 94 ++-- radio/util/hw_defs/hal_adc.py | 291 ---------- radio/util/hw_defs/hal_json.py | 113 ++-- radio/util/hw_defs/hal_keys.py | 226 -------- radio/util/hw_defs/hal_misc.py | 16 +- radio/util/hw_defs/hal_switches.py | 140 ----- radio/util/hw_defs/json_validator.py | 116 ++++ radio/util/hw_defs/legacy_names.py | 2 +- radio/util/hw_defs/logging_dict.py | 98 ++++ radio/util/hw_defs/models.py | 297 ++++++++++ radio/util/hw_defs/pot_config.py | 303 ---------- radio/util/hw_defs/switch_config.py | 681 ----------------------- tools/build-common.sh | 3 - tools/build-jumper.py | 5 - tools/define_remover.py | 143 +++++ tools/define_usage_checker.py | 196 +++++++ tools/generate-hw-defs.sh | 7 +- 74 files changed, 20433 insertions(+), 2402 deletions(-) create mode 100644 radio/src/boards/hw_defs/boxer.json create mode 100644 radio/src/boards/hw_defs/bumblebee.json create mode 100644 radio/src/boards/hw_defs/commando8.json create mode 100644 radio/src/boards/hw_defs/dro1.json create mode 100644 radio/src/boards/hw_defs/el18.json create mode 100644 radio/src/boards/hw_defs/f16.json create mode 100644 radio/src/boards/hw_defs/gx12.json create mode 100644 radio/src/boards/hw_defs/lr3pro.json create mode 100644 radio/src/boards/hw_defs/mt12.json create mode 100644 radio/src/boards/hw_defs/nb4p.json create mode 100644 radio/src/boards/hw_defs/nv14.json create mode 100644 radio/src/boards/hw_defs/pa01.json create mode 100644 radio/src/boards/hw_defs/pl18.json create mode 100644 radio/src/boards/hw_defs/pl18ev.json create mode 100644 radio/src/boards/hw_defs/pl18u.json create mode 100644 radio/src/boards/hw_defs/pocket.json create mode 100644 radio/src/boards/hw_defs/st16.json create mode 100644 radio/src/boards/hw_defs/t12.json create mode 100644 radio/src/boards/hw_defs/t12max.json create mode 100644 radio/src/boards/hw_defs/t14.json create mode 100644 radio/src/boards/hw_defs/t15.json create mode 100644 radio/src/boards/hw_defs/t15pro.json create mode 100644 radio/src/boards/hw_defs/t16.json create mode 100644 radio/src/boards/hw_defs/t18.json create mode 100644 radio/src/boards/hw_defs/t20.json create mode 100644 radio/src/boards/hw_defs/t20v2.json create mode 100644 radio/src/boards/hw_defs/t8.json create mode 100644 radio/src/boards/hw_defs/tlite.json create mode 100644 radio/src/boards/hw_defs/tpro.json create mode 100644 radio/src/boards/hw_defs/tpros.json create mode 100644 radio/src/boards/hw_defs/tprov2.json create mode 100644 radio/src/boards/hw_defs/tx12.json create mode 100644 radio/src/boards/hw_defs/tx12mk2.json create mode 100644 radio/src/boards/hw_defs/tx15.json create mode 100644 radio/src/boards/hw_defs/tx16s.json create mode 100644 radio/src/boards/hw_defs/tx16smk3.json create mode 100644 radio/src/boards/hw_defs/v12.json create mode 100644 radio/src/boards/hw_defs/v14.json create mode 100644 radio/src/boards/hw_defs/v16.json create mode 100644 radio/src/boards/hw_defs/x10.json create mode 100644 radio/src/boards/hw_defs/x10express.json create mode 100644 radio/src/boards/hw_defs/x12s.json create mode 100644 radio/src/boards/hw_defs/x7.json create mode 100644 radio/src/boards/hw_defs/x7access.json create mode 100644 radio/src/boards/hw_defs/x9d+.json create mode 100644 radio/src/boards/hw_defs/x9d+2019.json create mode 100644 radio/src/boards/hw_defs/x9d.json create mode 100644 radio/src/boards/hw_defs/x9e.json create mode 100644 radio/src/boards/hw_defs/x9lite.json create mode 100644 radio/src/boards/hw_defs/x9lites.json create mode 100644 radio/src/boards/hw_defs/xlite.json create mode 100644 radio/src/boards/hw_defs/xlites.json create mode 100644 radio/src/boards/hw_defs/zorro.json delete mode 100644 radio/util/hw_defs/hal_adc.py delete mode 100644 radio/util/hw_defs/hal_keys.py delete mode 100644 radio/util/hw_defs/hal_switches.py create mode 100644 radio/util/hw_defs/json_validator.py create mode 100644 radio/util/hw_defs/logging_dict.py create mode 100644 radio/util/hw_defs/models.py delete mode 100644 radio/util/hw_defs/pot_config.py delete mode 100644 radio/util/hw_defs/switch_config.py create mode 100644 tools/define_remover.py create mode 100644 tools/define_usage_checker.py diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 5c7fd5624b0..524cc81e91e 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -109,11 +109,18 @@ else() message(FATAL_ERROR "Unknown PCB '${PCB}'") endif() -set(HW_DESC_JSON ${FLAVOUR}.json) -AddHardwareDefTarget(${HW_DESC_JSON}) +# Add RADIO_xxx definition +string(TOUPPER ${FLAVOUR} RADIO_NAME) +string(REPLACE "+" "P" RADIO_NAME ${RADIO_NAME}) +string(CONCAT RADIO_NAME "RADIO_" ${RADIO_NAME}) +add_definitions(-D${RADIO_NAME}) +set(${RADIO_NAME} YES) + +add_definitions( + -DCPU_TYPE=${CPU_TYPE} -DCPU_TYPE_FULL=${CPU_TYPE_FULL} +) -# enable generating JSON definition separately for debugging -add_custom_target(hardware_defs DEPENDS ${HW_DESC_JSON} ${HW_DESC_JSON}.h) +set(HW_DESC_JSON ${FLAVOUR}.json) include(hal/CMakeLists.txt) @@ -141,6 +148,11 @@ if(ARCH STREQUAL ARM) include(targets/common/arm/CMakeLists.txt) endif() +# Generate hardware definitions from hal.h +# Must be after all add_definitions() so the preprocessor sees all flags +AddHardwareDefTarget(${HW_DESC_JSON}) +add_custom_target(hardware_defs DEPENDS ${HW_DESC_JSON}.h) + include_directories(targets/${TARGET_DIR} ${THIRDPARTY_DIR}) if(NATIVE_BUILD) @@ -787,5 +799,3 @@ if(CPU_FAMILY STREQUAL STM32) endif() PrintTargetReport("firmware") - -AddHardwareDefTarget(hardware_defs ${RADIO_DIRECTORY}/src/targets/hw_defs/${FLAVOUR}.json) diff --git a/radio/src/boards/hw_defs/boxer.json b/radio/src/boards/hw_defs/boxer.json new file mode 100644 index 00000000000..c632f83d5e2 --- /dev/null +++ b/radio/src/boards/hw_defs/boxer.json @@ -0,0 +1,333 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5", + "label": "6P", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_1", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/bumblebee.json b/radio/src/boards/hw_defs/bumblebee.json new file mode 100644 index 00000000000..7040bf08d1b --- /dev/null +++ b/radio/src/boards/hw_defs/bumblebee.json @@ -0,0 +1,402 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_9", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_15", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "inc": { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/commando8.json b/radio/src/boards/hw_defs/commando8.json new file mode 100644 index 00000000000..132c798a334 --- /dev/null +++ b/radio/src/boards/hw_defs/commando8.json @@ -0,0 +1,282 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "pwm_channel": 1, + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "pwm_channel": 0 + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "pwm_channel": 2, + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "pwm_channel": 3 + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOC", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "BCK" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "Left" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "Right" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_PLUS", + "name": "PLUS", + "label": "Up" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "active_low": true, + "key": "KEY_MINUS", + "name": "MINUS", + "label": "Down" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_0", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_1", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/dro1.json b/radio/src/boards/hw_defs/dro1.json new file mode 100644 index 00000000000..4a971a38210 --- /dev/null +++ b/radio/src/boards/hw_defs/dro1.json @@ -0,0 +1,474 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "EXT1", + "short_label": "E1", + "default": "SLIDER" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2", + "default": "SLIDER" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "EXT3", + "short_label": "E3", + "default": "NONE" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4", + "default": "NONE" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOH", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_8", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 30, + "has_ext_module_support": 1, + "has_int_module_support": 0, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/el18.json b/radio/src/boards/hw_defs/el18.json new file mode 100644 index 00000000000..b853a0598ef --- /dev/null +++ b/radio/src/boards/hw_defs/el18.json @@ -0,0 +1,347 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_4" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWA", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6" + }, + { + "name": "SWC", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWD", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_10", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true + }, + { + "name": "SWG", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true + }, + { + "name": "SWH", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWA", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWC", + "is_cfs": false + }, + { + "name": "SD", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWD", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWF", + "is_cfs": false + }, + { + "name": "SG", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWG", + "is_cfs": false + }, + { + "name": "SH", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "adc_input": "SWH", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_11", + "active_low": false, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": false, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_2", + "active_low": false + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": false + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": false + }, + "inc": { + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_7", + "active_low": false + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_0", + "active_low": false + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_15", + "active_low": false + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": false + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_10", + "active_low": false + }, + "active_low": true + } + ], + "display": { + "w": 320, + "h": 480, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/f16.json b/radio/src/boards/hw_defs/f16.json new file mode 100644 index 00000000000..ee4dc9dca63 --- /dev/null +++ b/radio/src/boards/hw_defs/f16.json @@ -0,0 +1,441 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/gx12.json b/radio/src/boards/hw_defs/gx12.json new file mode 100644 index 00000000000..db423db05f5 --- /dev/null +++ b/radio/src/boards/hw_defs/gx12.json @@ -0,0 +1,443 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "P1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true, + "label": "P2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "S1", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5", + "inverted": true, + "label": "S2", + "short_label": "S2", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_14", + "is_cfs": true, + "cfs_idx": 7 + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": null, + "pin_high": "PCA95XX_PIN_10", + "gpio_low": null, + "pin_low": "PCA95XX_PIN_11", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": null, + "pin_high": "PCA95XX_PIN_5", + "gpio_low": null, + "pin_low": "PCA95XX_PIN_4", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_1", + "is_cfs": true, + "cfs_idx": 6 + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": null, + "pin_high": "PCA95XX_PIN_12", + "gpio_low": null, + "pin_low": "PCA95XX_PIN_13", + "is_cfs": false + }, + { + "name": "SF", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": null, + "pin_high": "PCA95XX_PIN_3", + "gpio_low": null, + "pin_low": "PCA95XX_PIN_2", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 2 + ], + "gpio": null, + "pin": "PCA95XX_PIN_15", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": null, + "pin": "PCA95XX_PIN_0", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_0", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_1", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_2", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_3", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_4", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_5", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 1, + "groups": 4 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/lr3pro.json b/radio/src/boards/hw_defs/lr3pro.json new file mode 100644 index 00000000000..9991bacf54d --- /dev/null +++ b/radio/src/boards/hw_defs/lr3pro.json @@ -0,0 +1,262 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_9", + "active_low": true, + "key": "KEY_UP", + "name": "UP", + "label": "Up" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_DOWN", + "name": "DOWN", + "label": "Down" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_LEFT", + "name": "LEFT", + "label": "Left" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_RIGHT", + "name": "RIGHT", + "label": "Right" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/mt12.json b/radio/src/boards/hw_defs/mt12.json new file mode 100644 index 00000000000..6b9d001e687 --- /dev/null +++ b/radio/src/boards/hw_defs/mt12.json @@ -0,0 +1,311 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "ST", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "TH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5", + "label": "S3", + "short_label": "3", + "default": "NONE" + }, + { + "name": "P4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S4", + "short_label": "4", + "default": "NONE" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 7, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 1, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/nb4p.json b/radio/src/boards/hw_defs/nb4p.json new file mode 100644 index 00000000000..17d7a725c5a --- /dev/null +++ b/radio/src/boards/hw_defs/nb4p.json @@ -0,0 +1,174 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "ST", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "TH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "VR1L", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7", + "label": "VR1R", + "short_label": "2", + "default": "POT" + }, + { + "name": "RAW1", + "type": "RAW", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11" + }, + { + "name": "RAW2", + "type": "RAW", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RAW3", + "type": "RAW", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6" + }, + { + "name": "RAW4", + "type": "RAW", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "is_cfs": false + }, + { + "name": "SB", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "is_cfs": false + } + ], + "keys": [ + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + } + ], + "display": { + "w": 320, + "h": 480, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 4, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/nv14.json b/radio/src/boards/hw_defs/nv14.json new file mode 100644 index 00000000000..f7ed73bf164 --- /dev/null +++ b/radio/src/boards/hw_defs/nv14.json @@ -0,0 +1,347 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_4" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWA", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6" + }, + { + "name": "SWC", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWD", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_10", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true + }, + { + "name": "SWG", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true + }, + { + "name": "SWH", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWA", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "adc_input": "SWC", + "is_cfs": false + }, + { + "name": "SD", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWD", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWF", + "is_cfs": false + }, + { + "name": "SG", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWG", + "is_cfs": false + }, + { + "name": "SH", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "adc_input": "SWH", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_11", + "active_low": false, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": false, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_2", + "active_low": false + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": false + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": false + }, + "inc": { + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_7", + "active_low": false + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_0", + "active_low": false + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_15", + "active_low": false + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": false + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_10", + "active_low": false + }, + "active_low": true + } + ], + "display": { + "w": 320, + "h": 480, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/pa01.json b/radio/src/boards/hw_defs/pa01.json new file mode 100644 index 00000000000..f6b9563b761 --- /dev/null +++ b/radio/src/boards/hw_defs/pa01.json @@ -0,0 +1,310 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC1", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_64CYCLES_5" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC3", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_64CYCLES_5" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_15", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_19", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true + }, + { + "name": "SWC", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWC", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "AW9523B_PIN_0", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "AW9523B_PIN_1", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "AW9523B_PIN_2", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "AW9523B_PIN_3", + "is_cfs": true, + "cfs_idx": 3 + } + ], + "keys": [ + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + } + ], + "display": { + "w": 320, + "h": 240, + "phys_w": 320, + "phys_h": 240, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 1, + "groups": 2 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 4, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" + } +} diff --git a/radio/src/boards/hw_defs/pl18.json b/radio/src/boards/hw_defs/pl18.json new file mode 100644 index 00000000000..1be590ac6ae --- /dev/null +++ b/radio/src/boards/hw_defs/pl18.json @@ -0,0 +1,318 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "S3", + "short_label": "3", + "default": "POT" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7", + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true + }, + { + "name": "SWD", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWG", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9" + }, + { + "name": "SWH", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_10", + "channel": "LL_ADC_CHANNEL_8" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_9", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWD", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWF", + "is_cfs": false + }, + { + "name": "SG", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWG", + "is_cfs": false + }, + { + "name": "SH", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "adc_input": "SWH", + "is_cfs": false + } + ], + "keys": [], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + }, + { + "name": "T5" + }, + { + "name": "T6" + }, + { + "name": "T7" + }, + { + "name": "T8" + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 4, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/pl18ev.json b/radio/src/boards/hw_defs/pl18ev.json new file mode 100644 index 00000000000..3b735b429e0 --- /dev/null +++ b/radio/src/boards/hw_defs/pl18ev.json @@ -0,0 +1,362 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "S3", + "short_label": "3", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7", + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5", + "label": "EXT1", + "short_label": "E1", + "default": "POT_CENTER" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "label": "EXT2", + "short_label": "E2", + "default": "POT_CENTER" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "label": "EXT3", + "short_label": "E3", + "default": "MULTIPOS" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4", + "default": "MULTIPOS" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true + }, + { + "name": "SWD", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWG", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9" + }, + { + "name": "SWH", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_10", + "channel": "LL_ADC_CHANNEL_8" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_9", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWD", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWF", + "is_cfs": false + }, + { + "name": "SG", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWG", + "is_cfs": false + }, + { + "name": "SH", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWH", + "is_cfs": false + } + ], + "keys": [], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + }, + { + "name": "T5" + }, + { + "name": "T6" + }, + { + "name": "T7" + }, + { + "name": "T8" + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 4, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/pl18u.json b/radio/src/boards/hw_defs/pl18u.json new file mode 100644 index 00000000000..90817a7b144 --- /dev/null +++ b/radio/src/boards/hw_defs/pl18u.json @@ -0,0 +1,333 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": null + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "S3", + "short_label": "3", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true + }, + { + "name": "SWD", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWG", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9", + "inverted": true + }, + { + "name": "SWH", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_10", + "channel": "LL_ADC_CHANNEL_8" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_6", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_14", + "gpio_low": "GPIOH", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWD", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWF", + "is_cfs": false + }, + { + "name": "SG", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWG", + "is_cfs": false + }, + { + "name": "SH", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "adc_input": "SWH", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": null, + "pin": null, + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + }, + { + "name": "T5" + }, + { + "name": "T6" + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 4, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/pocket.json b/radio/src/boards/hw_defs/pocket.json new file mode 100644 index 00000000000..f965d84be6a --- /dev/null +++ b/radio/src/boards/hw_defs/pocket.json @@ -0,0 +1,296 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/st16.json b/radio/src/boards/hw_defs/st16.json new file mode 100644 index 00000000000..05b8cafaa9a --- /dev/null +++ b/radio/src/boards/hw_defs/st16.json @@ -0,0 +1,410 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC1", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC3", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_15" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_16" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_17" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_3", + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_5", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_9", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWA", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "SWC", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "SWD", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_7" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWA", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "adc_input": "SWC", + "is_cfs": false + }, + { + "name": "SD", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWD", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "adc_input": "SWF", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_6", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_0", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_1", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_2", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_3", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_4", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_PIN_5", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_14", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "MENU" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 1, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 12, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" + } +} diff --git a/radio/src/boards/hw_defs/t12.json b/radio/src/boards/hw_defs/t12.json new file mode 100644 index 00000000000..85e3a903e71 --- /dev/null +++ b/radio/src/boards/hw_defs/t12.json @@ -0,0 +1,338 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_10", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_9", + "active_low": true, + "key": "KEY_UP", + "name": "UP", + "label": "Up" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_DOWN", + "name": "DOWN", + "label": "Down" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_LEFT", + "name": "LEFT", + "label": "Left" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_RIGHT", + "name": "RIGHT", + "label": "Right" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/t12max.json b/radio/src/boards/hw_defs/t12max.json new file mode 100644 index 00000000000..575854e0b4f --- /dev/null +++ b/radio/src/boards/hw_defs/t12max.json @@ -0,0 +1,296 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SB", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t14.json b/radio/src/boards/hw_defs/t14.json new file mode 100644 index 00000000000..1c82eff9155 --- /dev/null +++ b/radio/src/boards/hw_defs/t14.json @@ -0,0 +1,296 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SB", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 1, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t15.json b/radio/src/boards/hw_defs/t15.json new file mode 100644 index 00000000000..8640d9f9296 --- /dev/null +++ b/radio/src/boards/hw_defs/t15.json @@ -0,0 +1,376 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOH", + "pin_low": "LL_GPIO_PIN_9", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOH", + "pin_low": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOI", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOH", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_7", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 480, + "phys_h": 320, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t15pro.json b/radio/src/boards/hw_defs/t15pro.json new file mode 100644 index 00000000000..e259a1699e8 --- /dev/null +++ b/radio/src/boards/hw_defs/t15pro.json @@ -0,0 +1,380 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC1", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC3", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_16" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_15", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_17" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_14", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_8" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOC", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOJ", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOJ", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_14", + "gpio_low": "GPIOH", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_11", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_9", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_10", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_12", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_10", + "active_low": true + }, + "inc": { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 480, + "phys_h": 320, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 1, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 1, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" + } +} diff --git a/radio/src/boards/hw_defs/t16.json b/radio/src/boards/hw_defs/t16.json new file mode 100644 index 00000000000..ad6b59bbc40 --- /dev/null +++ b/radio/src/boards/hw_defs/t16.json @@ -0,0 +1,455 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t18.json b/radio/src/boards/hw_defs/t18.json new file mode 100644 index 00000000000..436a336f76c --- /dev/null +++ b/radio/src/boards/hw_defs/t18.json @@ -0,0 +1,457 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t20.json b/radio/src/boards/hw_defs/t20.json new file mode 100644 index 00000000000..485d7d64e1b --- /dev/null +++ b/radio/src/boards/hw_defs/t20.json @@ -0,0 +1,535 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "inverted": true, + "label": "S3", + "short_label": "3", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S4", + "short_label": "4", + "default": "SLIDER" + }, + { + "name": "SL3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "inverted": true, + "label": "SL", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_9", + "inverted": true, + "label": "SR", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": true, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "2POS", + "flags": 0, + "inverted": true, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 4 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 4 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_15", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "inc": { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_10", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T7", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + }, + { + "name": "T8", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t20v2.json b/radio/src/boards/hw_defs/t20v2.json new file mode 100644 index 00000000000..0cd2f349ac3 --- /dev/null +++ b/radio/src/boards/hw_defs/t20v2.json @@ -0,0 +1,535 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "inverted": true, + "label": "S3", + "short_label": "3", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S4", + "short_label": "4", + "default": "SLIDER" + }, + { + "name": "SL3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "inverted": true, + "label": "SL", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_9", + "inverted": true, + "label": "SR", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": true, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "2POS", + "flags": 0, + "inverted": true, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 4 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 4 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_15", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "inc": { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_10", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T7", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + }, + { + "name": "T8", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/t8.json b/radio/src/boards/hw_defs/t8.json new file mode 100644 index 00000000000..3489f713c45 --- /dev/null +++ b/radio/src/boards/hw_defs/t8.json @@ -0,0 +1,278 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "ENT" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_9", + "active_low": true, + "key": "KEY_PLUS", + "name": "PLUS", + "label": "(+)" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_MINUS", + "name": "MINUS", + "label": "(-)" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 0, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/tlite.json b/radio/src/boards/hw_defs/tlite.json new file mode 100644 index 00000000000..0f40cfc9388 --- /dev/null +++ b/radio/src/boards/hw_defs/tlite.json @@ -0,0 +1,262 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "ENT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_9", + "active_low": true, + "key": "KEY_UP", + "name": "UP", + "label": "Up" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_DOWN", + "name": "DOWN", + "label": "Down" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_LEFT", + "name": "LEFT", + "label": "Left/SYS" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_RIGHT", + "name": "RIGHT", + "label": "Right/MDL" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/tpro.json b/radio/src/boards/hw_defs/tpro.json new file mode 100644 index 00000000000..bb88c752a29 --- /dev/null +++ b/radio/src/boards/hw_defs/tpro.json @@ -0,0 +1,368 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_8", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 2 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_10", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_9", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_6", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_5", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_4", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/tpros.json b/radio/src/boards/hw_defs/tpros.json new file mode 100644 index 00000000000..02e15a693ac --- /dev/null +++ b/radio/src/boards/hw_defs/tpros.json @@ -0,0 +1,296 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/tprov2.json b/radio/src/boards/hw_defs/tprov2.json new file mode 100644 index 00000000000..2473a3b1daf --- /dev/null +++ b/radio/src/boards/hw_defs/tprov2.json @@ -0,0 +1,396 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_8", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SC", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_10", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_9", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_6", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_5", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_4", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/tx12.json b/radio/src/boards/hw_defs/tx12.json new file mode 100644 index 00000000000..287b88c9b36 --- /dev/null +++ b/radio/src/boards/hw_defs/tx12.json @@ -0,0 +1,348 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SF", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/tx12mk2.json b/radio/src/boards/hw_defs/tx12mk2.json new file mode 100644 index 00000000000..308933a179d --- /dev/null +++ b/radio/src/boards/hw_defs/tx12mk2.json @@ -0,0 +1,325 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_14", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SF", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/tx15.json b/radio/src/boards/hw_defs/tx15.json new file mode 100644 index 00000000000..11ce991a384 --- /dev/null +++ b/radio/src/boards/hw_defs/tx15.json @@ -0,0 +1,350 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC1", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC3", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_4" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_5", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "EXT", + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P15", + "gpio_low": null, + "pin_low": "PCA95XX_P14", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P13", + "gpio_low": null, + "pin_low": "PCA95XX_P12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P11", + "gpio_low": null, + "pin_low": "PCA95XX_P10", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P7", + "gpio_low": null, + "pin_low": "PCA95XX_P6", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P17", + "gpio_low": null, + "pin_low": "PCA95XX_P16", + "is_cfs": false + }, + { + "name": "SF", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P4", + "gpio_low": null, + "pin_low": "PCA95XX_P5", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P0", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P1", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P2", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P3", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P4", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P5", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + } + ], + "display": { + "w": 480, + "h": 320, + "phys_w": 320, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 1, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 20, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" + } +} diff --git a/radio/src/boards/hw_defs/tx16s.json b/radio/src/boards/hw_defs/tx16s.json new file mode 100644 index 00000000000..524b953f975 --- /dev/null +++ b/radio/src/boards/hw_defs/tx16s.json @@ -0,0 +1,463 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/tx16smk3.json b/radio/src/boards/hw_defs/tx16smk3.json new file mode 100644 index 00000000000..4bdcbb695ec --- /dev/null +++ b/radio/src/boards/hw_defs/tx16smk3.json @@ -0,0 +1,464 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC1", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMAMUX1_REQ_ADC3", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_8CYCLES_5" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_4" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_5", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_13", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7", + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_19", + "label": "EXT1", + "short_label": "E1", + "default": "NONE" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_16", + "label": "EXT2", + "short_label": "E2", + "default": "NONE" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "EXT", + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_14" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "LUX", + "type": "LUX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_9" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P15", + "gpio_low": null, + "pin_low": "PCA95XX_P14", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P13", + "gpio_low": null, + "pin_low": "PCA95XX_P12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P11", + "gpio_low": null, + "pin_low": "PCA95XX_P10", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P7", + "gpio_low": null, + "pin_low": "PCA95XX_P6", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P16", + "gpio_low": null, + "pin_low": "PCA95XX_P17", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P1", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "PCA95XX_P4", + "gpio_low": null, + "pin_low": "PCA95XX_P5", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P0", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": null, + "pin": "PCA95XX_P2", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": null, + "pin": "PCA95XX_P3", + "is_cfs": false + }, + { + "name": "SW1", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P0", + "is_cfs": true, + "cfs_idx": 0 + }, + { + "name": "SW2", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P1", + "is_cfs": true, + "cfs_idx": 1 + }, + { + "name": "SW3", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P2", + "is_cfs": true, + "cfs_idx": 2 + }, + { + "name": "SW4", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P3", + "is_cfs": true, + "cfs_idx": 3 + }, + { + "name": "SW5", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P4", + "is_cfs": true, + "cfs_idx": 4 + }, + { + "name": "SW6", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": null, + "pin": "PCA95XX_P5", + "is_cfs": true, + "cfs_idx": 5 + } + ], + "keys": [ + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_15", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6" + } + ], + "display": { + "w": 800, + "h": 480, + "phys_w": 800, + "phys_h": 480, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 1, + "groups": 3 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 20, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32H750xB", + "cpu_type": "STM32H7" + } +} diff --git a/radio/src/boards/hw_defs/v12.json b/radio/src/boards/hw_defs/v12.json new file mode 100644 index 00000000000..c5b5b2537f9 --- /dev/null +++ b/radio/src/boards/hw_defs/v12.json @@ -0,0 +1,359 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S3", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "SWC", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "adc_input": "SWC", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "adc_input": "SWF", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_1", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/v14.json b/radio/src/boards/hw_defs/v14.json new file mode 100644 index 00000000000..f79d83c3893 --- /dev/null +++ b/radio/src/boards/hw_defs/v14.json @@ -0,0 +1,359 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S3", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + }, + { + "name": "SWB", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "SWC", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "SWE", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_7" + }, + { + "name": "SWF", + "type": "SWITCH", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 0 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "adc_input": "SWB", + "is_cfs": false + }, + { + "name": "SC", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "adc_input": "SWC", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "adc_input": "SWE", + "is_cfs": false + }, + { + "name": "SF", + "type": "ADC", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "adc_input": "SWF", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_1", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 1, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 32, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xG", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/v16.json b/radio/src/boards/hw_defs/v16.json new file mode 100644 index 00000000000..3170004fe4d --- /dev/null +++ b/radio/src/boards/hw_defs/v16.json @@ -0,0 +1,461 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_5", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true, + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 34, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x10.json b/radio/src/boards/hw_defs/x10.json new file mode 100644 index 00000000000..9f188f4d338 --- /dev/null +++ b/radio/src/boards/hw_defs/x10.json @@ -0,0 +1,461 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "pwm_channel": 0 + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "pwm_channel": 1, + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "pwm_channel": 3 + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "pwm_channel": 2, + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true, + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PgUp/Dn" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x10express.json b/radio/src/boards/hw_defs/x10express.json new file mode 100644 index 00000000000..9f188f4d338 --- /dev/null +++ b/radio/src/boards/hw_defs/x10express.json @@ -0,0 +1,461 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "pwm_channel": 0 + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "pwm_channel": 1, + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "pwm_channel": 3 + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "pwm_channel": 2, + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_4", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_13", + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "label": "EXT1", + "short_label": "E1" + }, + { + "name": "EXT2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "EXT2", + "short_label": "E2" + }, + { + "name": "EXT3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "label": "EXT3", + "short_label": "E3" + }, + { + "name": "EXT4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true, + "label": "EXT4", + "short_label": "E4" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_7", + "channel": "LL_ADC_CHANNEL_5" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": true, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_15", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PgUp/Dn" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x12s.json b/radio/src/boards/hw_defs/x12s.json new file mode 100644 index 00000000000..06e02f7daea --- /dev/null +++ b/radio/src/boards/hw_defs/x12s.json @@ -0,0 +1,454 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "SPI", + "adc": "SPI4", + "gpio_pin_miso": "GPIO_PIN(GPIOE, 5)", + "gpio_pin_mosi": "GPIO_PIN(GPIOE, 6)", + "gpio_pin_sck": "GPIO_PIN(GPIOE, 2)", + "gpio_pin_cs": "GPIO_PIN(GPIOE, 4)" + }, + { + "name": "MAIN", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + }, + { + "name": "EXT", + "adc": "ADC1", + "dma": null, + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "SPI", + "channel": 0 + }, + { + "name": "LV", + "type": "STICK", + "adc": "SPI", + "channel": 1, + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "SPI", + "channel": 2 + }, + { + "name": "RH", + "type": "STICK", + "adc": "SPI", + "channel": 3, + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "SPI", + "channel": 4, + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "SPI", + "channel": 5, + "label": "6POS", + "short_label": "3", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "SPI", + "channel": 6, + "inverted": true, + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "SPI", + "channel": 7, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "SPI", + "channel": 8, + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "SL3", + "type": "FLEX", + "adc": "SPI", + "channel": 11, + "inverted": true, + "label": "L1", + "short_label": "1", + "default": "SLIDER" + }, + { + "name": "SL4", + "type": "FLEX", + "adc": "SPI", + "channel": 10, + "inverted": true, + "label": "L2", + "short_label": "2", + "default": "SLIDER" + }, + { + "name": "JSx", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": 6, + "label": "JSx", + "short_label": "X", + "default": "AXIS_X" + }, + { + "name": "JSy", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": 7, + "label": "JSy", + "short_label": "Y", + "default": "AXIS_Y" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "SPI", + "channel": 9 + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "EXT", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOI", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_12", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOJ", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOH", + "pin_high": "LL_GPIO_PIN_4", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": true, + "default": "2POS", + "display": null, + "gpio": "GPIOH", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_6", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": null, + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": null, + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_6", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PgUp" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PgDn" + }, + { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_12", + "active_low": true + }, + "inc": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "inc": { + "gpio": "GPIOI", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T5", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T6", + "dec": { + "gpio": "GPIOJ", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 480, + "h": 272, + "phys_w": 480, + "phys_h": 272, + "depth": 16, + "color": 1, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F429xI", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x7.json b/radio/src/boards/hw_defs/x7.json new file mode 100644 index 00000000000..3678ba3e429 --- /dev/null +++ b/radio/src/boards/hw_defs/x7.json @@ -0,0 +1,328 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_0", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SJ", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_10", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/x7access.json b/radio/src/boards/hw_defs/x7access.json new file mode 100644 index 00000000000..1c56aa292bd --- /dev/null +++ b/radio/src/boards/hw_defs/x7access.json @@ -0,0 +1,314 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_10", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_2", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x9d+.json b/radio/src/boards/hw_defs/x9d+.json new file mode 100644 index 00000000000..c1432a45b0d --- /dev/null +++ b/radio/src/boards/hw_defs/x9d+.json @@ -0,0 +1,381 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9", + "inverted": true, + "label": "S3", + "short_label": "3" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 2 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 3 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "ENT" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_PLUS", + "name": "PLUS", + "label": "(+)" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MINUS", + "name": "MINUS", + "label": "(-)" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 212, + "h": 64, + "phys_w": 212, + "phys_h": 64, + "depth": 4, + "color": 0, + "oled": 0, + "backlight_color": 1 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 0, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/x9d+2019.json b/radio/src/boards/hw_defs/x9d+2019.json new file mode 100644 index 00000000000..eef3abf5a0c --- /dev/null +++ b/radio/src/boards/hw_defs/x9d+2019.json @@ -0,0 +1,369 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "inverted": true, + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 2 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 3 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SI", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 4 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_10", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "ENT" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 212, + "h": 64, + "phys_w": 212, + "phys_h": 64, + "depth": 4, + "color": 0, + "oled": 0, + "backlight_color": 1 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 0, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x9d.json b/radio/src/boards/hw_defs/x9d.json new file mode 100644 index 00000000000..89056ea4b4b --- /dev/null +++ b/radio/src/boards/hw_defs/x9d.json @@ -0,0 +1,370 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "label": "S2", + "short_label": "2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 2 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 3 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "ENT" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_PLUS", + "name": "PLUS", + "label": "(+)" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MINUS", + "name": "MINUS", + "label": "(-)" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 212, + "h": 64, + "phys_w": 212, + "phys_h": 64, + "depth": 4, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 0, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/x9e.json b/radio/src/boards/hw_defs/x9e.json new file mode 100644 index 00000000000..9b016edcf4c --- /dev/null +++ b/radio/src/boards/hw_defs/x9e.json @@ -0,0 +1,573 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + }, + { + "name": "EXT", + "adc": "ADC3", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_2", + "dma_stream": "LL_DMA_STREAM_0", + "dma_stream_irq": "DMA2_Stream0_IRQn", + "dma_stream_irq_handler": "DMA2_Stream0_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_56CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_8", + "channel": "LL_ADC_CHANNEL_6", + "inverted": true, + "label": "F1", + "short_label": "F1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "F2", + "short_label": "F2", + "default": "POT_CENTER" + }, + { + "name": "P3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "channel": "LL_ADC_CHANNEL_15", + "inverted": true, + "label": "F3", + "short_label": "F3", + "default": "NONE" + }, + { + "name": "P4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "channel": "LL_ADC_CHANNEL_14", + "label": "F4", + "short_label": "F4", + "default": "NONE" + }, + { + "name": "SL1", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_10", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "S1", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "adc": "EXT", + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_9", + "channel": "LL_ADC_CHANNEL_7", + "label": "S2", + "short_label": "S2", + "default": "SLIDER" + }, + { + "name": "SL3", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "LS", + "short_label": "L", + "default": "SLIDER" + }, + { + "name": "SL4", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_9", + "inverted": true, + "label": "RS", + "short_label": "R", + "default": "SLIDER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_10", + "gpio_low": "GPIOD", + "pin_low": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_10", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOF", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOF", + "pin_low": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 2 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 3 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "is_cfs": false + }, + { + "name": "SG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio_high": "GPIOF", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOF", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SI", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 4 + ], + "gpio_high": "GPIOF", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SJ", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 4 + ], + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SK", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 5 + ], + "gpio_high": "GPIOG", + "pin_high": "LL_GPIO_PIN_13", + "gpio_low": "GPIOG", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SL", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 5 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_9", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SM", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 6 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_15", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SN", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 6 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SO", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 7 + ], + "gpio_high": "GPIOF", + "pin_high": "LL_GPIO_PIN_7", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_10", + "is_cfs": false + }, + { + "name": "SP", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 7 + ], + "gpio_high": "GPIOF", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOF", + "pin_low": "LL_GPIO_PIN_12", + "is_cfs": false + }, + { + "name": "SQ", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 0, + 8 + ], + "gpio_high": "GPIOF", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOF", + "pin_low": "LL_GPIO_PIN_6", + "is_cfs": false + }, + { + "name": "SR", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "NONE", + "display": [ + 1, + 8 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOF", + "pin": "LL_GPIO_PIN_0", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOG", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 212, + "h": 64, + "phys_w": 212, + "phys_h": 64, + "depth": 4, + "color": 0, + "oled": 0, + "backlight_color": 1 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 0, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/boards/hw_defs/x9lite.json b/radio/src/boards/hw_defs/x9lite.json new file mode 100644 index 00000000000..37b358cb441 --- /dev/null +++ b/radio/src/boards/hw_defs/x9lite.json @@ -0,0 +1,273 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_9", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/x9lites.json b/radio/src/boards/hw_defs/x9lites.json new file mode 100644 index 00000000000..cab935be9c9 --- /dev/null +++ b/radio/src/boards/hw_defs/x9lites.json @@ -0,0 +1,301 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3" + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "label": "S1", + "short_label": "1", + "default": "POT_CENTER" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_MENU", + "name": "MENU", + "label": "MENU" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_9", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_9", + "active_low": true + }, + "inc": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_8", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/xlite.json b/radio/src/boards/hw_defs/xlite.json new file mode 100644 index 00000000000..ec1e33fb61b --- /dev/null +++ b/radio/src/boards/hw_defs/xlite.json @@ -0,0 +1,279 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "pwm_channel": 0 + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "pwm_channel": 1, + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "pwm_channel": 3, + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "pwm_channel": 2 + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_6", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_UP", + "name": "UP", + "label": "Up" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "active_low": true, + "key": "KEY_DOWN", + "name": "DOWN", + "label": "Down" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_LEFT", + "name": "LEFT", + "label": "Left" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_RIGHT", + "name": "RIGHT", + "label": "Right" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_SHIFT", + "name": "SHIFT", + "label": "Shift" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3" + }, + { + "name": "T4" + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/xlites.json b/radio/src/boards/hw_defs/xlites.json new file mode 100644 index 00000000000..0a698390874 --- /dev/null +++ b/radio/src/boards/hw_defs/xlites.json @@ -0,0 +1,307 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0", + "pwm_channel": 0 + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "pwm_channel": 1, + "inverted": true + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "pwm_channel": 3, + "inverted": true + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2", + "pwm_channel": 2 + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_11", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_12", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_1", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOA", + "pin_low": "LL_GPIO_PIN_6", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 1 + ], + "gpio_high": "GPIOE", + "pin_high": "LL_GPIO_PIN_3", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_2", + "is_cfs": false + }, + { + "name": "SD", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 1 + ], + "gpio_high": "GPIOB", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOB", + "pin_low": "LL_GPIO_PIN_4", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 2 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "EXIT" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_10", + "active_low": true, + "key": "KEY_UP", + "name": "UP", + "label": "Up" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "active_low": true, + "key": "KEY_DOWN", + "name": "DOWN", + "label": "Down" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_12", + "active_low": true, + "key": "KEY_LEFT", + "name": "LEFT", + "label": "Left" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_RIGHT", + "name": "RIGHT", + "label": "Right" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "active_low": true, + "key": "KEY_SHIFT", + "name": "SHIFT", + "label": "Shift" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "inc": { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3" + }, + { + "name": "T4" + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 0, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 250000, + "surface": 0, + "cpu": "STM32F205xE", + "cpu_type": "STM32F2" + } +} diff --git a/radio/src/boards/hw_defs/zorro.json b/radio/src/boards/hw_defs/zorro.json new file mode 100644 index 00000000000..93b405fc34b --- /dev/null +++ b/radio/src/boards/hw_defs/zorro.json @@ -0,0 +1,349 @@ +{ + "adc_inputs": { + "adcs": [ + { + "name": "MAIN", + "adc": "ADC1", + "dma": "DMA2", + "dma_channel": "LL_DMA_CHANNEL_0", + "dma_stream": "LL_DMA_STREAM_4", + "dma_stream_irq": "DMA2_Stream4_IRQn", + "dma_stream_irq_handler": "DMA2_Stream4_IRQHandler", + "sample_time": "LL_ADC_SAMPLINGTIME_28CYCLES" + } + ], + "inputs": [ + { + "name": "LH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_3", + "channel": "LL_ADC_CHANNEL_3", + "inverted": true + }, + { + "name": "LV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_2", + "channel": "LL_ADC_CHANNEL_2" + }, + { + "name": "RV", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_0" + }, + { + "name": "RH", + "type": "STICK", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_1", + "channel": "LL_ADC_CHANNEL_1", + "inverted": true + }, + { + "name": "P1", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_8", + "inverted": true, + "label": "S1", + "short_label": "1", + "default": "POT" + }, + { + "name": "P2", + "type": "FLEX", + "adc": "MAIN", + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_6", + "channel": "LL_ADC_CHANNEL_6", + "label": "S2", + "short_label": "2", + "default": "POT" + }, + { + "name": "VBAT", + "type": "VBAT", + "adc": "MAIN", + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_0", + "channel": "LL_ADC_CHANNEL_10" + }, + { + "name": "RTC_BAT", + "type": "RTC_BAT", + "adc": "MAIN", + "gpio": null, + "pin": null, + "channel": "LL_ADC_CHANNEL_VBAT" + } + ] + }, + "switches": [ + { + "name": "SA", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 1 + ], + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_13", + "is_cfs": false + }, + { + "name": "SB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 0, + 0 + ], + "gpio_high": "GPIOA", + "pin_high": "LL_GPIO_PIN_5", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_15", + "is_cfs": false + }, + { + "name": "SC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": [ + 1, + 0 + ], + "gpio_high": "GPIOD", + "pin_high": "LL_GPIO_PIN_11", + "gpio_low": "GPIOE", + "pin_low": "LL_GPIO_PIN_0", + "is_cfs": false + }, + { + "name": "SD", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 1 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_8", + "is_cfs": false + }, + { + "name": "SE", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 0, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_7", + "is_cfs": false + }, + { + "name": "SF", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "2POS", + "display": [ + 1, + 2 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_1", + "is_cfs": false + }, + { + "name": "SG", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 0, + 3 + ], + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + }, + { + "name": "SH", + "type": "2POS", + "flags": 0, + "inverted": false, + "default": "TOGGLE", + "display": [ + 1, + 3 + ], + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_14", + "is_cfs": false + } + ], + "keys": [ + { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_5", + "active_low": true, + "key": "KEY_EXIT", + "name": "EXIT", + "label": "RTN" + }, + { + "gpio": "GPIOA", + "pin": "LL_GPIO_PIN_13", + "active_low": true, + "key": "KEY_ENTER", + "name": "ENTER", + "label": "Enter" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_3", + "active_low": true, + "key": "KEY_PAGEUP", + "name": "PAGEUP", + "label": "PAGE<" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_7", + "active_low": true, + "key": "KEY_PAGEDN", + "name": "PAGEDN", + "label": "PAGE>" + }, + { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_11", + "active_low": true, + "key": "KEY_MODEL", + "name": "MDL", + "label": "MDL" + }, + { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_2", + "active_low": true, + "key": "KEY_TELE", + "name": "TELE", + "label": "TELE" + }, + { + "gpio": "GPIOB", + "pin": "LL_GPIO_PIN_4", + "active_low": true, + "key": "KEY_SYS", + "name": "SYS", + "label": "SYS" + } + ], + "trims": [ + { + "name": "T1", + "dec": { + "gpio": "GPIOD", + "pin": "LL_GPIO_PIN_15", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_1", + "active_low": true + }, + "active_low": true + }, + { + "name": "T2", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_6", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_5", + "active_low": true + }, + "active_low": true + }, + { + "name": "T3", + "dec": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOC", + "pin": "LL_GPIO_PIN_2", + "active_low": true + }, + "active_low": true + }, + { + "name": "T4", + "dec": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_3", + "active_low": true + }, + "inc": { + "gpio": "GPIOE", + "pin": "LL_GPIO_PIN_4", + "active_low": true + }, + "active_low": true + } + ], + "display": { + "w": 128, + "h": 64, + "phys_w": 128, + "phys_h": 64, + "depth": 1, + "color": 0, + "oled": 0, + "backlight_color": 0 + }, + "custom_switches": { + "rgb_led": 0, + "groups": 0 + }, + "hardware": { + "has_audio_mute": 1, + "has_bling_leds": 0, + "has_ext_module_support": 1, + "has_int_module_support": 1, + "sport_max_baudrate": 400000, + "surface": 0, + "cpu": "STM32F407xE", + "cpu_type": "STM32F4" + } +} diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index eccc9f84cb3..3778ab7ec48 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -55,11 +55,9 @@ if (PCB STREQUAL X10) set(BLUETOOTH ON) set(AUX_SERIAL OFF) add_definitions(-DHARDWARE_POWER_MANAGEMENT_UNIT) - add_definitions(-DRADIO_X10E) add_definitions(-DMANUFACTURER_FRSKY) elseif (PCBREV STREQUAL T15) set(FLAVOUR t15) - add_definitions(-DRADIO_T15) add_definitions(-DRADIO_FAMILY_T16) set(FUNCTION_SWITCHES ON) set(DEFAULT_INTERNAL_MODULE CROSSFIRE CACHE STRING "Default internal module") @@ -76,7 +74,6 @@ if (PCB STREQUAL X10) set(LCD_DRIVER lcd_st7796s_driver.cpp) elseif (PCBREV STREQUAL T16) set(FLAVOUR t16) - add_definitions(-DRADIO_T16) add_definitions(-DRADIO_FAMILY_T16) set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module") option(BLUETOOTH "Support for bluetooth module" OFF) @@ -87,7 +84,6 @@ if (PCB STREQUAL X10) set(FLYSKY_GIMBAL ON) elseif (PCBREV STREQUAL TX16S) set(FLAVOUR tx16s) - add_definitions(-DRADIO_TX16S) add_definitions(-DRADIO_FAMILY_T16) # Uncomment the line below to enable bootloader support for SPI flash @@ -105,7 +101,6 @@ if (PCB STREQUAL X10) set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches") elseif (PCBREV STREQUAL F16) set(FLAVOUR f16) - add_definitions(-DRADIO_F16) add_definitions(-DRADIO_FAMILY_T16) set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module") option(BLUETOOTH "Support for bluetooth module" OFF) @@ -114,7 +109,6 @@ if (PCB STREQUAL X10) set(VIDEO_SWITCH ON) elseif (PCBREV STREQUAL V16) set(FLAVOUR v16) - add_definitions(-DRADIO_V16) add_definitions(-DRADIO_FAMILY_T16) set(DEFAULT_INTERNAL_MODULE CROSSFIRE CACHE STRING "Default internal module") option(BLUETOOTH "Support for bluetooth module" OFF) @@ -129,7 +123,6 @@ if (PCB STREQUAL X10) endif() elseif (PCBREV STREQUAL T18) set(FLAVOUR t18) - add_definitions(-DRADIO_T18) add_definitions(-DRADIO_FAMILY_T16) set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module") option(BLUETOOTH "Support for bluetooth module" OFF) @@ -140,7 +133,6 @@ if (PCB STREQUAL X10) set(FLYSKY_GIMBAL ON) elseif (PCBREV STREQUAL DRO1) set(FLAVOUR dro1) - add_definitions(-DRADIO_DRO1) add_definitions(-DRADIO_FAMILY_T16) # Uncomment the line below to enable bootloader support for SPI flash @@ -162,7 +154,6 @@ if (PCB STREQUAL X10) set(FLAVOUR x10) set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module") set(BLUETOOTH ON) - add_definitions(-DRADIO_X10) add_definitions(-DMANUFACTURER_FRSKY) endif() elseif (PCB STREQUAL X12S) diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index 0027c29577d..6871a926a5e 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -29,65 +29,6 @@ #define TELEMETRY_EXTI_PRIO 0 // required for soft serial -// Keys -#if defined(PCBX12S) - #define KEYS_GPIO_REG_PAGEUP GPIOC - #define KEYS_GPIO_PIN_PAGEUP LL_GPIO_PIN_13 // PC.13 - #define KEYS_GPIO_REG_PAGEDN GPIOI - #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_8 // PI.08 - #define KEYS_GPIO_REG_SYS GPIOI - #define KEYS_GPIO_PIN_SYS LL_GPIO_PIN_7 // PI.07 - #define KEYS_GPIO_REG_ENTER GPIOC - #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_1 // PC.01 - #define KEYS_GPIO_REG_MDL GPIOG - #define KEYS_GPIO_PIN_MDL LL_GPIO_PIN_13 // PG.13 - #define KEYS_GPIO_REG_EXIT GPIOI - #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_6 // PI.06 - #define KEYS_GPIO_REG_TELE GPIOC - #define KEYS_GPIO_PIN_TELE LL_GPIO_PIN_4 // PC.04 -#elif defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_DRO1) - #define KEYS_GPIO_REG_ENTER GPIOI - #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_8 // PI.08 - #define KEYS_GPIO_REG_PAGEUP GPIOC - #define KEYS_GPIO_PIN_PAGEUP LL_GPIO_PIN_13 // PC.13 - #define KEYS_GPIO_REG_PAGEDN GPIOI - #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_11 // PI.11 - #define KEYS_GPIO_REG_MDL GPIOI - #define KEYS_GPIO_PIN_MDL LL_GPIO_PIN_6 // PI.06 - #define KEYS_GPIO_REG_EXIT GPIOI - #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_4 // PI.04 - #define KEYS_GPIO_REG_SYS GPIOI - #define KEYS_GPIO_PIN_SYS LL_GPIO_PIN_7 // PI.07 - #define KEYS_GPIO_REG_TELE GPIOI - #define KEYS_GPIO_PIN_TELE LL_GPIO_PIN_5 // PI.05 -#elif defined(RADIO_T15) - #define KEYS_GPIO_REG_ENTER GPIOI - #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_8 // PI.08 - #define KEYS_GPIO_REG_PAGEDN GPIOI - #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_11 // PI.11 - #define KEYS_GPIO_REG_MDL GPIOI - #define KEYS_GPIO_PIN_MDL LL_GPIO_PIN_6 // PI.06 - #define KEYS_GPIO_REG_EXIT GPIOI - #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_5 // PI.05 - #define KEYS_GPIO_REG_SYS GPIOI - #define KEYS_GPIO_PIN_SYS LL_GPIO_PIN_7 // PI.07 - #define KEYS_GPIO_REG_TELE GPIOI - #define KEYS_GPIO_PIN_TELE LL_GPIO_PIN_4 // PI.04 -#elif defined(PCBX10) - #define KEYS_GPIO_REG_ENTER GPIOI - #define KEYS_GPIO_PIN_ENTER LL_GPIO_PIN_8 // PI.08 - #define KEYS_GPIO_REG_PAGEDN GPIOI - #define KEYS_GPIO_PIN_PAGEDN LL_GPIO_PIN_11 // PI.11 - #define KEYS_GPIO_REG_MDL GPIOI - #define KEYS_GPIO_PIN_MDL LL_GPIO_PIN_4 // PI.04 - #define KEYS_GPIO_REG_EXIT GPIOI - #define KEYS_GPIO_PIN_EXIT LL_GPIO_PIN_6 // PI.06 - #define KEYS_GPIO_REG_SYS GPIOI - #define KEYS_GPIO_PIN_SYS LL_GPIO_PIN_7 // PI.07 - #define KEYS_GPIO_REG_TELE GPIOI - #define KEYS_GPIO_PIN_TELE LL_GPIO_PIN_5 // PI.05 -#endif - // Rotary Encoder #define ROTARY_ENCODER_GPIO GPIOH #define ROTARY_ENCODER_GPIO_PIN_A LL_GPIO_PIN_11 // PH.11 @@ -107,184 +48,7 @@ #define ROTARY_ENCODER_TIMER_IRQHandler TIM8_BRK_TIM12_IRQHandler #if defined(RADIO_T15) - #define ROTARY_ENCODER_INVERTED -#endif - -// Switches -#if defined(RADIO_T15) - #define STORAGE_SWITCH_A - #define HARDWARE_SWITCH_A - #define SWITCHES_GPIO_REG_A_H GPIOG - #define SWITCHES_GPIO_PIN_A_H LL_GPIO_PIN_3 // PG.03 - #define SWITCHES_GPIO_REG_A_L GPIOD - #define SWITCHES_GPIO_PIN_A_L LL_GPIO_PIN_11 // PD.11 - #define SWITCHES_A_INVERTED - - #define STORAGE_SWITCH_B - #define HARDWARE_SWITCH_B - #define SWITCHES_GPIO_REG_B_H GPIOB - #define SWITCHES_GPIO_PIN_B_H LL_GPIO_PIN_12 // PB.12 - #define SWITCHES_GPIO_REG_B_L GPIOH - #define SWITCHES_GPIO_PIN_B_L LL_GPIO_PIN_9 // PH.09 - - #define STORAGE_SWITCH_C - #define HARDWARE_SWITCH_C - #define SWITCHES_GPIO_REG_C_H GPIOG - #define SWITCHES_GPIO_PIN_C_H LL_GPIO_PIN_2 // PG.02 - #define SWITCHES_GPIO_REG_C_L GPIOH - #define SWITCHES_GPIO_PIN_C_L LL_GPIO_PIN_14 // PH.14 - #define SWITCHES_C_INVERTED - - #define STORAGE_SWITCH_D - #define HARDWARE_SWITCH_D - #define SWITCHES_GPIO_REG_D_H GPIOI - #define SWITCHES_GPIO_PIN_D_H LL_GPIO_PIN_15 // PI.15 - #define SWITCHES_GPIO_REG_D_L GPIOH - #define SWITCHES_GPIO_PIN_D_L LL_GPIO_PIN_15 // PH.15 - - #define STORAGE_SWITCH_E - #define HARDWARE_SWITCH_E - #define SWITCHES_GPIO_REG_E GPIOB - #define SWITCHES_GPIO_PIN_E LL_GPIO_PIN_15 // PB.15 - #define STORAGE_SWITCH_F - #define HARDWARE_SWITCH_F - #define SWITCHES_GPIO_REG_F GPIOH - #define SWITCHES_GPIO_PIN_F LL_GPIO_PIN_12 // PH.12 - //SW1 - #define FUNCTION_SWITCH_1 SG - #define STORAGE_SWITCH_G - #define HARDWARE_SWITCH_G - #define SWITCHES_GPIO_REG_G GPIOB - #define SWITCHES_GPIO_PIN_G LL_GPIO_PIN_14 // PB.14 - #define SWITCHES_G_CFS_IDX 0 - //SW2 - #define FUNCTION_SWITCH_2 SH - #define STORAGE_SWITCH_H - #define HARDWARE_SWITCH_H - #define SWITCHES_GPIO_REG_H GPIOD - #define SWITCHES_GPIO_PIN_H LL_GPIO_PIN_13 // PD.13 - #define SWITCHES_H_CFS_IDX 1 - //SW3 - #define FUNCTION_SWITCH_3 SI - #define STORAGE_SWITCH_I - #define HARDWARE_SWITCH_I - #define SWITCHES_GPIO_REG_I GPIOJ - #define SWITCHES_GPIO_PIN_I LL_GPIO_PIN_7 // PJ.07 - #define SWITCHES_I_CFS_IDX 2 - //SW4 - #define FUNCTION_SWITCH_4 SJ - #define STORAGE_SWITCH_J - #define HARDWARE_SWITCH_J - #define SWITCHES_GPIO_REG_J GPIOG - #define SWITCHES_GPIO_PIN_J LL_GPIO_PIN_13 // PG.13 - #define SWITCHES_J_CFS_IDX 3 - //SW5 - #define FUNCTION_SWITCH_5 SK - #define STORAGE_SWITCH_K - #define HARDWARE_SWITCH_K - #define SWITCHES_GPIO_REG_K GPIOJ - #define SWITCHES_GPIO_PIN_K LL_GPIO_PIN_8 // PJ.08 - #define SWITCHES_K_CFS_IDX 4 - //SW6 - #define FUNCTION_SWITCH_6 SL - #define STORAGE_SWITCH_L - #define HARDWARE_SWITCH_L - #define SWITCHES_GPIO_REG_L GPIOB - #define SWITCHES_GPIO_PIN_L LL_GPIO_PIN_13 // PB.13 - #define SWITCHES_L_CFS_IDX 5 -#else - #define STORAGE_SWITCH_A - #define HARDWARE_SWITCH_A - #define SWITCHES_GPIO_REG_A_H GPIOH - #define SWITCHES_GPIO_PIN_A_H LL_GPIO_PIN_9 // PH.09 - #define SWITCHES_GPIO_REG_A_L GPIOI - #define SWITCHES_GPIO_PIN_A_L LL_GPIO_PIN_15 // PI.15 - #define STORAGE_SWITCH_B - #define HARDWARE_SWITCH_B - #define SWITCHES_GPIO_REG_B_H GPIOH - #define SWITCHES_GPIO_PIN_B_H LL_GPIO_PIN_12 // PH.12 - #define SWITCHES_GPIO_REG_B_L GPIOB - #define SWITCHES_GPIO_PIN_B_L LL_GPIO_PIN_12 // PB.12 - #define STORAGE_SWITCH_C - #define HARDWARE_SWITCH_C - #define SWITCHES_GPIO_REG_C_H GPIOD - #define SWITCHES_GPIO_PIN_C_H LL_GPIO_PIN_11 // PD.11 - #define SWITCHES_GPIO_REG_C_L GPIOB - #define SWITCHES_GPIO_PIN_C_L LL_GPIO_PIN_15 // PB.15 - #define STORAGE_SWITCH_D - #define HARDWARE_SWITCH_D - #define SWITCHES_GPIO_REG_D_H GPIOJ - #define SWITCHES_GPIO_PIN_D_H LL_GPIO_PIN_7 // PJ.07 - #define SWITCHES_GPIO_REG_D_L GPIOG - #define SWITCHES_GPIO_PIN_D_L LL_GPIO_PIN_2 // PG.02 - #define STORAGE_SWITCH_E - #define HARDWARE_SWITCH_E - #define SWITCHES_GPIO_REG_E_H GPIOH - #define SWITCHES_GPIO_PIN_E_H LL_GPIO_PIN_4 // PH.04 - #define SWITCHES_GPIO_REG_E_L GPIOE - #define SWITCHES_GPIO_PIN_E_L LL_GPIO_PIN_3 // PE.03 - #define STORAGE_SWITCH_F - #define HARDWARE_SWITCH_F - #define SWITCHES_GPIO_REG_F GPIOH - #define SWITCHES_GPIO_PIN_F LL_GPIO_PIN_3 // PH.03 - #define STORAGE_SWITCH_G - #define HARDWARE_SWITCH_G - #define SWITCHES_GPIO_REG_G_H GPIOG - #define SWITCHES_GPIO_PIN_G_H LL_GPIO_PIN_6 // PG.06 - #define SWITCHES_GPIO_REG_G_L GPIOG - #define SWITCHES_GPIO_PIN_G_L LL_GPIO_PIN_3 // PG.03 - #define STORAGE_SWITCH_H - #define HARDWARE_SWITCH_H - #define SWITCHES_GPIO_REG_H GPIOG - #define SWITCHES_GPIO_PIN_H LL_GPIO_PIN_7 // PG.07 - - #if defined(PCBX12S) - #define SWITCHES_F_INVERTED - #elif defined(RADIO_DRO1) - #undef SWITCHES_GPIO_REG_F - #undef SWITCHES_GPIO_PIN_F - #undef SWITCHES_GPIO_REG_H - #undef SWITCHES_GPIO_PIN_H - #define SWITCHES_GPIO_REG_F_H GPIOH - #define SWITCHES_GPIO_PIN_F_H LL_GPIO_PIN_7 // PH.07 - #define SWITCHES_GPIO_REG_F_L GPIOH - #define SWITCHES_GPIO_PIN_F_L LL_GPIO_PIN_3 // PH.03 - #define SWITCHES_GPIO_REG_H_H GPIOH - #define SWITCHES_GPIO_PIN_H_H LL_GPIO_PIN_8 // PH.08 - #define SWITCHES_GPIO_REG_H_L GPIOG - #define SWITCHES_GPIO_PIN_H_L LL_GPIO_PIN_7 // PG.07 - #define SWITCHES_B_INVERTED - #define SWITCHES_D_INVERTED - #define SWITCHES_G_INVERTED - #elif defined(PCBX10) - #define SWITCHES_B_INVERTED - #define SWITCHES_D_INVERTED - #define SWITCHES_E_INVERTED - #endif - - #if defined(PCBX10) && !defined(RADIO_F16) - // Gimbal switch left - #define STORAGE_SWITCH_I - #define HARDWARE_SWITCH_I - #define SWITCHES_GPIO_REG_I GPIOH - #define SWITCHES_GPIO_PIN_I LL_GPIO_PIN_14 // PH.14 - // Gimbal switch right - #define STORAGE_SWITCH_J - #define HARDWARE_SWITCH_J - #define SWITCHES_GPIO_REG_J GPIOH - #define SWITCHES_GPIO_PIN_J LL_GPIO_PIN_15 // PH.15 - #elif defined(PCBX12S) - // Gimbal switch left - #define STORAGE_SWITCH_I - #define HARDWARE_SWITCH_I - #define SWITCHES_GPIO_REG_I GPIOB - #define SWITCHES_GPIO_PIN_I LL_GPIO_PIN_1 // PB.01 - // Gimbal switch right - #define STORAGE_SWITCH_J - #define HARDWARE_SWITCH_J - #define SWITCHES_GPIO_REG_J GPIOB - #define SWITCHES_GPIO_PIN_J LL_GPIO_PIN_0 // PB.00 - #endif + #define ROTARY_ENCODER_INVERTED #endif // 6POS SW @@ -300,256 +64,13 @@ #define SIXPOS_LED_BLUE 0 #endif -// Trims -#if defined(RADIO_T15) - #define TRIMS_GPIO_REG_LHL GPIOD - #define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_3 // PD.03 - #define TRIMS_GPIO_REG_LHR GPIOD - #define TRIMS_GPIO_PIN_LHR LL_GPIO_PIN_7 // PD.07 - #define TRIMS_GPIO_REG_LVU GPIOJ - #define TRIMS_GPIO_PIN_LVU LL_GPIO_PIN_12 // PJ.12 - #define TRIMS_GPIO_REG_LVD GPIOJ - #define TRIMS_GPIO_PIN_LVD LL_GPIO_PIN_13 // PJ.13 - #define TRIMS_GPIO_REG_RVD GPIOG - #define TRIMS_GPIO_PIN_RVD LL_GPIO_PIN_12 // PG.12 - #define TRIMS_GPIO_REG_RHL GPIOA - #define TRIMS_GPIO_PIN_RHL LL_GPIO_PIN_6 // PA.06 - #define TRIMS_GPIO_REG_RVU GPIOJ - #define TRIMS_GPIO_PIN_RVU LL_GPIO_PIN_14 // PJ.14 - #define TRIMS_GPIO_REG_RHR GPIOC - #define TRIMS_GPIO_PIN_RHR LL_GPIO_PIN_4 // PC.04 -#elif defined(PCBX12S) - #define TRIMS_GPIO_REG_RHL GPIOC - #define TRIMS_GPIO_PIN_RHL LL_GPIO_PIN_0 // PC.00 - #define TRIMS_GPIO_REG_RHR GPIOI - #define TRIMS_GPIO_PIN_RHR LL_GPIO_PIN_4 // PI.04 - #define TRIMS_GPIO_REG_RVD GPIOG - #define TRIMS_GPIO_PIN_RVD LL_GPIO_PIN_12 // PG.12 - #define TRIMS_GPIO_REG_RVU GPIOJ - #define TRIMS_GPIO_PIN_RVU LL_GPIO_PIN_14 // PJ.14 - #define TRIMS_GPIO_REG_LVD GPIOJ - #define TRIMS_GPIO_PIN_LVD LL_GPIO_PIN_13 // PJ.13 - #define TRIMS_GPIO_REG_LHL GPIOD - #define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_3 // PD.03 - #define TRIMS_GPIO_REG_LVU GPIOJ - #define TRIMS_GPIO_PIN_LVU LL_GPIO_PIN_12 // PJ.12 - #define TRIMS_GPIO_REG_LHR GPIOD - #define TRIMS_GPIO_PIN_LHR LL_GPIO_PIN_7 // PD.07 - #define TRIMS_GPIO_REG_RSD GPIOJ - #define TRIMS_GPIO_PIN_RSD LL_GPIO_PIN_8 // PJ.08 - #define TRIMS_GPIO_REG_RSU GPIOD - #define TRIMS_GPIO_PIN_RSU LL_GPIO_PIN_13 // PD.13 - #define TRIMS_GPIO_REG_LSD GPIOB - #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_14 // PB.14 - #define TRIMS_GPIO_REG_LSU GPIOB - #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_13 // PB.13 -#elif defined(RADIO_DRO1) - #define TRIMS_GPIO_REG_RHL GPIOA - #define TRIMS_GPIO_PIN_RHL LL_GPIO_PIN_6 // PA.06 - #define TRIMS_GPIO_REG_RHR GPIOC - #define TRIMS_GPIO_PIN_RHR LL_GPIO_PIN_4 // PC.04 - #define TRIMS_GPIO_REG_RVD GPIOG - #define TRIMS_GPIO_PIN_RVD LL_GPIO_PIN_12 // PG.12 - #define TRIMS_GPIO_REG_RVU GPIOJ - #define TRIMS_GPIO_PIN_RVU LL_GPIO_PIN_14 // PJ.14 - #define TRIMS_GPIO_REG_LVD GPIOJ - #define TRIMS_GPIO_PIN_LVD LL_GPIO_PIN_13 // PJ.13 - #define TRIMS_GPIO_REG_LHL GPIOD - #define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_3 // PD.03 - #define TRIMS_GPIO_REG_LVU GPIOJ - #define TRIMS_GPIO_PIN_LVU LL_GPIO_PIN_12 // PJ.12 - #define TRIMS_GPIO_REG_LHR GPIOD - #define TRIMS_GPIO_PIN_LHR LL_GPIO_PIN_7 // PD.07 - #define TRIMS_GPIO_REG_LSU GPIOD - #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_13 // PD.13 - #define TRIMS_GPIO_REG_LSD GPIOJ - #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_8 // PJ.08 - #define TRIMS_GPIO_REG_RSU GPIOB - #define TRIMS_GPIO_PIN_RSU LL_GPIO_PIN_14 // PB.14 - #define TRIMS_GPIO_REG_RSD GPIOB - #define TRIMS_GPIO_PIN_RSD LL_GPIO_PIN_13 // PB.13 -#elif defined(PCBX10) - // Left/Right Horizontal trims (LHL/LHR) - #if defined(RADIO_TX16S) || defined(RADIO_F16) || defined(RADIO_V16) - #define TRIMS_GPIO_REG_LHL GPIOA - #define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_6 // PA.06 - #define TRIMS_GPIO_REG_LHR GPIOC - #define TRIMS_GPIO_PIN_LHR LL_GPIO_PIN_4 // PC.04 - #else - #define TRIMS_GPIO_REG_LHL GPIOB - #define TRIMS_GPIO_PIN_LHL LL_GPIO_PIN_8 // PB.08 - #define TRIMS_GPIO_REG_LHR GPIOB - #define TRIMS_GPIO_PIN_LHR LL_GPIO_PIN_9 // PB.09 - #endif - - // Vertical trims - common across all PCBX10 variants - #define TRIMS_GPIO_REG_LVD GPIOG - #define TRIMS_GPIO_PIN_LVD LL_GPIO_PIN_12 // PG.12 - #define TRIMS_GPIO_REG_LVU GPIOJ - #define TRIMS_GPIO_PIN_LVU LL_GPIO_PIN_14 // PJ.14 - #define TRIMS_GPIO_REG_RVD GPIOJ - #define TRIMS_GPIO_PIN_RVD LL_GPIO_PIN_13 // PJ.13 - #define TRIMS_GPIO_REG_RVU GPIOJ - #define TRIMS_GPIO_PIN_RVU LL_GPIO_PIN_12 // PJ.12 - - // Right Horizontal trims - common across all PCBX10 variants - #define TRIMS_GPIO_REG_RHL GPIOD - #define TRIMS_GPIO_PIN_RHL LL_GPIO_PIN_3 // PD.03 - #define TRIMS_GPIO_REG_RHR GPIOD - #define TRIMS_GPIO_PIN_RHR LL_GPIO_PIN_7 // PD.07 - - // T5/T6 trim assignments - #if defined(RADIO_V16) - // T5/T6 trims are in exchanged positions to other handsets - #define TRIMS_GPIO_REG_LSU GPIOB - #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_14 // PB.14 - #define TRIMS_GPIO_REG_LSD GPIOB - #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_13 // PB.13 - #define TRIMS_GPIO_REG_RSU GPIOD - #define TRIMS_GPIO_PIN_RSU LL_GPIO_PIN_13 // PD.13 - #define TRIMS_GPIO_REG_RSD GPIOJ - #define TRIMS_GPIO_PIN_RSD LL_GPIO_PIN_8 // PJ.08 - #elif defined(RADIO_FAMILY_T16) - #define TRIMS_GPIO_REG_LSU GPIOD - #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_13 // PD.13 - #define TRIMS_GPIO_REG_LSD GPIOJ - #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_8 // PJ.08 - #define TRIMS_GPIO_REG_RSU GPIOB - #define TRIMS_GPIO_PIN_RSU LL_GPIO_PIN_14 // PB.14 - #define TRIMS_GPIO_REG_RSD GPIOB - #define TRIMS_GPIO_PIN_RSD LL_GPIO_PIN_13 // PB.13 - #else // Other PCBX10 variants - #define TRIMS_GPIO_REG_LSU GPIOJ - #define TRIMS_GPIO_PIN_LSU LL_GPIO_PIN_8 // PJ.08 - #define TRIMS_GPIO_REG_LSD GPIOD - #define TRIMS_GPIO_PIN_LSD LL_GPIO_PIN_13 // PD.13 - #define TRIMS_GPIO_REG_RSU GPIOB - #define TRIMS_GPIO_PIN_RSU LL_GPIO_PIN_14 // PB.14 - #define TRIMS_GPIO_REG_RSD GPIOB - #define TRIMS_GPIO_PIN_RSD LL_GPIO_PIN_13 // PB.13 - #endif -#endif - - // ADC #if defined(PCBX12S) - #define ADC_SPI SPI4 - #define ADC_SPI_GPIO_PIN_SCK GPIO_PIN(GPIOE, 2) // PE.02 - #define ADC_SPI_GPIO_PIN_CS GPIO_PIN(GPIOE, 4) // PE.04 - #define ADC_SPI_GPIO_PIN_MOSI GPIO_PIN(GPIOE, 6) // PE.06 - #define ADC_SPI_GPIO_PIN_MISO GPIO_PIN(GPIOE, 5) // PE.05 - - #define ADC_SPI_STICK_LH 0 - #define ADC_SPI_STICK_LV 1 - #define ADC_SPI_STICK_RV 2 - #define ADC_SPI_STICK_RH 3 - #define ADC_SPI_POT1 4 - #define ADC_SPI_POT2 5 - #define ADC_SPI_POT3 6 - #define ADC_SPI_SLIDER1 7 - #define ADC_SPI_SLIDER2 8 - #define ADC_SPI_BATT 9 - #define ADC_SPI_SLIDER3 11 - #define ADC_SPI_SLIDER4 10 - - #define ADC_MAIN ADC3 - #define ADC_GPIO_PIN_MOUSE1 LL_GPIO_PIN_8 // PF.08 ADC3_IN6 J5 MOUSE_X - #define ADC_GPIO_PIN_MOUSE2 LL_GPIO_PIN_9 // PF.09 ADC3_IN7 J6 MOUSE_Y - #define ADC_GPIO_MOUSE GPIOF - #define ADC_CHANNEL_MOUSE1 6 - #define ADC_CHANNEL_MOUSE2 7 - #define ADC_GPIOF_PINS (ADC_GPIO_PIN_MOUSE1 | ADC_GPIO_PIN_MOUSE2) - #define ADC_EXT ADC1 - #define ADC_EXT_SAMPTIME LL_ADC_SAMPLINGTIME_56CYCLES - #define ADC_CHANNEL_RTC_BAT LL_ADC_CHANNEL_VBAT // ADC1_IN16 - #define ADC_EXT_CHANNELS { ADC_CHANNEL_RTC_BATT } - #define ADC_DMA DMA2 - #define ADC_DMA_CHANNEL LL_DMA_CHANNEL_2 - // TODO: use for SPI1_RX instead? - #define ADC_DMA_STREAM LL_DMA_STREAM_0 - #define ADC_DMA_STREAM_IRQ DMA2_Stream0_IRQn - #define ADC_DMA_STREAM_IRQHandler DMA2_Stream0_IRQHandler - #define ADC_SAMPTIME LL_ADC_SAMPLINGTIME_56CYCLES + #define USE_ADS79XX #define ADC_VREF_PREC2 300 #elif defined(RADIO_V16) - #define ADC_GPIO_PIN_STICK_LH LL_GPIO_PIN_0 // PA.00 - #define ADC_GPIO_PIN_STICK_LV LL_GPIO_PIN_1 // PA.01 - #define ADC_GPIO_PIN_STICK_RV LL_GPIO_PIN_3 // PA.03 - #define ADC_GPIO_PIN_STICK_RH LL_GPIO_PIN_2 // PA.02 - #define ADC_GPIO_PIN_POT1 LL_GPIO_PIN_2 // PC.00 // ADC123_IN10 -> ADC3_IN10 - #define ADC_GPIO_PIN_POT2 LL_GPIO_PIN_1 // PC.02 // ADC123_IN12 -> ADC3_IN12 - #define ADC_GPIO_PIN_POT3 LL_GPIO_PIN_0 // PC.01 // ADC123_IN11 -> ADC3_IN11 - #define ADC_GPIO_PIN_SLIDER1 LL_GPIO_PIN_5 // PA.05 - #define ADC_GPIO_PIN_SLIDER2 LL_GPIO_PIN_3 // PC.03 - #define ADC_GPIO_PIN_BATT LL_GPIO_PIN_7 // PF.07 - #define ADC_GPIO_PIN_EXT1 LL_GPIO_PIN_8 // PF.08 - #define ADC_GPIO_PIN_EXT2 LL_GPIO_PIN_9 // PF.09 - #define ADC_GPIO_PIN_EXT3 ADC_GPIO_PIN_STICK_RH - #define ADC_GPIO_PIN_EXT4 ADC_GPIO_PIN_STICK_RV - #define ADC_GPIOA_PINS_FS (LL_GPIO_PIN_2 | LL_GPIO_PIN_3) - #define ADC_GPIOA_PINS (ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_RV | ADC_GPIO_PIN_SLIDER1) - #define ADC_GPIOC_PINS (ADC_GPIO_PIN_POT1 | ADC_GPIO_PIN_POT2 | ADC_GPIO_PIN_POT3 | ADC_GPIO_PIN_SLIDER2) - #define ADC_GPIOF_PINS (ADC_GPIO_PIN_EXT1 | ADC_GPIO_PIN_EXT2) - #define ADC_CHANNEL_STICK_LH LL_ADC_CHANNEL_0 // ADC123_IN0 -> ADC3_IN0 - #define ADC_CHANNEL_STICK_LV LL_ADC_CHANNEL_1 // ADC123_IN1 -> ADC3_IN1 - #define ADC_CHANNEL_STICK_RH LL_ADC_CHANNEL_2 // ADC123_IN2 -> ADC3_IN2 - #define ADC_CHANNEL_STICK_RV LL_ADC_CHANNEL_3 // ADC123_IN3 -> ADC3_IN3 - #define ADC_CHANNEL_POT1 LL_ADC_CHANNEL_12 // ADC123_IN10 -> ADC3_IN10 - #define ADC_CHANNEL_POT2 LL_ADC_CHANNEL_11 // ADC123_IN12 -> ADC3_IN12 - #define ADC_CHANNEL_POT3 LL_ADC_CHANNEL_10 // ADC123_IN11 -> ADC3_IN11 - #define ADC_CHANNEL_SLIDER1 LL_ADC_CHANNEL_5 // ADC12_IN5 -> ADC1_IN5 - #define ADC_CHANNEL_SLIDER2 LL_ADC_CHANNEL_13 // ADC123_IN13 -> ADC1_IN13 - #define ADC_CHANNEL_EXT1 LL_ADC_CHANNEL_6 // ADC3_IN6 -> ADC3_IN6 - #define ADC_CHANNEL_EXT2 LL_ADC_CHANNEL_7 // ADC3_IN7 -> ADC3_IN7 - #define ADC_CHANNEL_EXT3 LL_ADC_CHANNEL_2 // ADC3_IN2: same as RH - #define ADC_CHANNEL_EXT4 LL_ADC_CHANNEL_3 // ADC3_IN3: same as RV - #define ADC_CHANNEL_RTC_BAT LL_ADC_CHANNEL_VBAT // ADC1_IN18 - #define ADC_MAIN ADC3 - #define ADC_EXT ADC1 - #define ADC_EXT_CHANNELS { ADC_CHANNEL_SLIDER1, ADC_CHANNEL_SLIDER2, ADC_CHANNEL_RTC_BAT } - #define ADC_EXT_DMA DMA2 - #define ADC_EXT_DMA_CHANNEL LL_DMA_CHANNEL_0 - #define ADC_EXT_DMA_STREAM LL_DMA_STREAM_4 - #define ADC_EXT_DMA_STREAM_IRQ DMA2_Stream4_IRQn - #define ADC_EXT_DMA_STREAM_IRQHandler DMA2_Stream4_IRQHandler - #define ADC_EXT_SAMPTIME LL_ADC_SAMPLINGTIME_56CYCLES - #define ADC_SAMPTIME LL_ADC_SAMPLINGTIME_56CYCLES - #define ADC_DMA DMA2 - #define ADC_DMA_CHANNEL LL_DMA_CHANNEL_2 - #define ADC_DMA_STREAM LL_DMA_STREAM_0 - #define ADC_DMA_STREAM_IRQ DMA2_Stream0_IRQn - #define ADC_DMA_STREAM_IRQHandler DMA2_Stream0_IRQHandler #define ADC_VREF_PREC2 330 #elif defined(PCBX10) -#if defined(RADIO_T15) - #define ADC_GPIO_PIN_STICK_LH LL_GPIO_PIN_1 // PA.01 - #define ADC_GPIO_PIN_STICK_LV LL_GPIO_PIN_0 // PA.00 - #define ADC_GPIO_PIN_STICK_RV LL_GPIO_PIN_2 // PA.02 - #define ADC_GPIO_PIN_STICK_RH LL_GPIO_PIN_3 // PA.03 - #define ADC_GPIO_PIN_POT1 LL_GPIO_PIN_2 // PC.02 - #define ADC_GPIO_PIN_POT2 LL_GPIO_PIN_0 // PC.00 - #define ADC_CHANNEL_POT1 LL_ADC_CHANNEL_12 // ADC3_IN12 - #define ADC_CHANNEL_POT2 LL_ADC_CHANNEL_10 // ADC3_IN10 -#else - #define ADC_GPIO_PIN_STICK_LH LL_GPIO_PIN_0 // PA.00 - #define ADC_GPIO_PIN_STICK_LV LL_GPIO_PIN_1 // PA.01 - #define ADC_GPIO_PIN_STICK_RV LL_GPIO_PIN_3 // PA.03 - #define ADC_GPIO_PIN_STICK_RH LL_GPIO_PIN_2 // PA.02 - #define ADC_GPIO_PIN_POT1 LL_GPIO_PIN_0 // PC.00 - #define ADC_GPIO_PIN_POT2 LL_GPIO_PIN_1 // PC.01 - #define ADC_CHANNEL_POT1 LL_ADC_CHANNEL_10 // ADC3_IN10 - #define ADC_CHANNEL_POT2 LL_ADC_CHANNEL_11 // ADC3_IN11 -#endif - #define ADC_GPIO_PIN_BATT LL_GPIO_PIN_7 // PF.07 -#if !defined(RADIO_T15) - #define ADC_GPIO_PIN_POT3 LL_GPIO_PIN_2 // PC.02 // - #define ADC_GPIO_PIN_SLIDER1 LL_GPIO_PIN_6 // PF.06 - #define ADC_GPIO_PIN_SLIDER2 LL_GPIO_PIN_3 // PC.03 // - #define ADC_GPIO_PIN_EXT1 LL_GPIO_PIN_8 // PF.08 - #define ADC_GPIO_PIN_EXT2 LL_GPIO_PIN_9 // PF.09 - #define ADC_GPIO_PIN_EXT3 ADC_GPIO_PIN_STICK_RH - #define ADC_GPIO_PIN_EXT4 ADC_GPIO_PIN_STICK_RV -#endif #if defined(RADIO_X10) || defined(RADIO_X10E) #define PWM_STICKS #define PWM_TIMER TIM5 @@ -558,66 +79,8 @@ #define PWM_GPIO_AF GPIO_AF2 #define PWM_IRQHandler TIM5_IRQHandler #define PWM_IRQn TIM5_IRQn - #define PWM_GPIOA_PINS (ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_RV) - #define STICK_PWM_CHANNEL_LH 0 - #define STICK_PWM_CHANNEL_LV 1 - #define STICK_PWM_CHANNEL_RV 3 - #define STICK_PWM_CHANNEL_RH 2 - #endif -#if defined(RADIO_T15) - #define ADC_CHANNEL_STICK_LH LL_ADC_CHANNEL_1 // ADC3_IN1 - #define ADC_CHANNEL_STICK_LV LL_ADC_CHANNEL_0 // ADC3_IN0 - #define ADC_CHANNEL_STICK_RH LL_ADC_CHANNEL_3 // ADC3_IN3 - #define ADC_CHANNEL_STICK_RV LL_ADC_CHANNEL_2 // ADC3_IN2 - #define ADC_CHANNEL_BATT LL_ADC_CHANNEL_5 // ADC3_IN5 -#else - #define ADC_CHANNEL_STICK_LH LL_ADC_CHANNEL_0 // ADC3_IN0 - #define ADC_CHANNEL_STICK_LV LL_ADC_CHANNEL_1 // ADC3_IN1 - #define ADC_CHANNEL_STICK_RH LL_ADC_CHANNEL_2 // ADC3_IN2 - #define ADC_CHANNEL_STICK_RV LL_ADC_CHANNEL_3 // ADC3_IN3 - #define ADC_CHANNEL_BATT LL_ADC_CHANNEL_5 // ADC3_IN5 -#endif -#if !defined(RADIO_T15) - #define ADC_CHANNEL_POT3 LL_ADC_CHANNEL_12 // ADC3_IN12 - #define ADC_CHANNEL_SLIDER1 LL_ADC_CHANNEL_4 // ADC3_IN4 - #define ADC_CHANNEL_SLIDER2 LL_ADC_CHANNEL_13 // ADC3_IN13 - #define ADC_CHANNEL_EXT1 LL_ADC_CHANNEL_6 // ADC3_IN6 - #define ADC_CHANNEL_EXT2 LL_ADC_CHANNEL_7 // ADC3_IN7 - #define ADC_CHANNEL_EXT3 LL_ADC_CHANNEL_2 // ADC3_IN2: same as RH - #define ADC_CHANNEL_EXT4 LL_ADC_CHANNEL_3 // ADC3_IN3: same as RV -#endif -#if defined(RADIO_T15) - #define ADC_GPIOA_PINS (ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_RV) - #define ADC_GPIOC_PINS (ADC_GPIO_PIN_POT1 | ADC_GPIO_PIN_POT2) - #define ADC_GPIOF_PINS (ADC_GPIO_PIN_BATT) -#else - #define ADC_GPIOA_PINS_FS (LL_GPIO_PIN_2 | LL_GPIO_PIN_3) - #define ADC_GPIOA_PINS (ADC_GPIO_PIN_STICK_LH | ADC_GPIO_PIN_STICK_LV | ADC_GPIO_PIN_STICK_RH | ADC_GPIO_PIN_STICK_RV) - #define ADC_GPIOC_PINS (ADC_GPIO_PIN_POT1 | ADC_GPIO_PIN_POT2 | ADC_GPIO_PIN_POT3 | ADC_GPIO_PIN_SLIDER2) - #define ADC_GPIOF_PINS (ADC_GPIO_PIN_SLIDER1 | ADC_GPIO_PIN_BATT | ADC_GPIO_PIN_EXT1 | ADC_GPIO_PIN_EXT2) -#endif - #define ADC_CHANNEL_RTC_BAT LL_ADC_CHANNEL_VBAT // ADC1_IN18 - #define ADC_MAIN ADC3 - #define ADC_EXT ADC1 - #if defined(RADIO_V16) - #define ADC_EXT_CHANNELS { ADC_CHANNEL_SLIDER1, ADC_CHANNEL_SLIDER2, ADC_CHANNEL_RTC_BAT } - // Required DMA for more than one channel for EXT_ADC - #define ADC_EXT_DMA DMA2 - #define ADC_EXT_DMA_CHANNEL LL_DMA_CHANNEL_0 - #define ADC_EXT_DMA_STREAM LL_DMA_STREAM_4 - #define ADC_EXT_DMA_STREAM_IRQ DMA2_Stream4_IRQn - #define ADC_EXT_DMA_STREAM_IRQHandler DMA2_Stream4_IRQHandler - #else - #define ADC_EXT_CHANNELS { ADC_CHANNEL_RTC_BAT } + #define PWM_GPIOA_PINS (LL_GPIO_PIN_0 | LL_GPIO_PIN_1 | LL_GPIO_PIN_2 | LL_GPIO_PIN_3) #endif - #define ADC_EXT_SAMPTIME LL_ADC_SAMPLINGTIME_56CYCLES - #define ADC_SAMPTIME LL_ADC_SAMPLINGTIME_56CYCLES - #define ADC_DMA DMA2 - #define ADC_DMA_CHANNEL LL_DMA_CHANNEL_2 - #define ADC_DMA_STREAM LL_DMA_STREAM_0 - #define ADC_DMA_STREAM_IRQ DMA2_Stream0_IRQn - #define ADC_DMA_STREAM_IRQHandler DMA2_Stream0_IRQHandler - // VBat divider is /4 on F42x and F43x devices #if defined(RADIO_TX16S) || defined(RADIO_T15) || defined(RADIO_F16) || defined(RADIO_V16) || defined(RADIO_T18) || defined(RADIO_DRO1) #define ADC_VREF_PREC2 330 @@ -628,31 +91,10 @@ #endif #endif -#if defined(RADIO_T15) - #define ADC_DIRECTION {1,-1,1,-1, 1,1} -#elif defined(RADIO_T16) - #define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 } -#elif defined(RADIO_T18) - #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 } -#elif defined(RADIO_TX16S) || defined(RADIO_F16) - #define ADC_DIRECTION {1,-1,1,-1, 1,1,1, -1,1,1,1, -1,1 } -#elif defined(RADIO_V16) - #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1,1,1, -1,1 } -#elif defined(RADIO_DRO1) - #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, -1,1, 1,1,-1,1} -#elif defined(PCBX10) - #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, 1,-1,1,1, 1,-1 } -#elif defined(PCBX12S) - #define ADC_DIRECTION {1,-1,1,-1, -1,1,-1, 1,-1, -1,-1, 0,0,0} -#else - #error "Missing ADC_DIRECTION array" -#endif - #if defined(RADIO_TX16S) #define DEFAULT_6POS_CALIB {3, 12, 21, 30, 38} #define DEFAULT_6POS_IDX 5 #endif - // Power #if defined(RADIO_T18) diff --git a/radio/util/hw_defs/README.md b/radio/util/hw_defs/README.md index 3b34f0a38e6..016030c5049 100644 --- a/radio/util/hw_defs/README.md +++ b/radio/util/hw_defs/README.md @@ -1,43 +1,18 @@ # Hardware Definitions -The Python scripts in this directory are responsible for 2 different tasks: -- generating a JSON definition file for each target, -- and generating different include files used to describe the hardware to the software. +The Python scripts in this directory are responsible for generating different +include files used to describe the hardware to the software. -While the exact format is still moving, the goal of this file is to replace the various -hardware definitions used in EdgeTx at various places and offer a simpler way to define -new targets. +## Data model -At the end of the process, the JSON definition will be the *master copy* used by: -- radio firmware, -- radio simlator, -- and Companion. +The data model supported is described `models.py`. A script +(`json_validator.py`) is available that validates the JSON files based on this +model. -## JSON Definition +## Code generator -Currently, the JSON definition file is still generated during the build process using -the target's `hal.h` and various Python scripts: +The various include files are generated based on Jinja2 templates and `generator.py` +provided with a JSON target definition. -- `generate_hw_def.py`: command line to generate JSON file as well as process - the JSON file into include files. - -- `hal_json.py`: reads the `#define ...` definitions coming from `hal.h` into a dictionary (AVPs). - -- `hal_adc.py`: parse ADC definitions and related analog inputs. - -- `legacy_names.py`: hard-coded definitions providing additional information not present in `hal.h` - related to analog inputs (by target; mostly names and labels). - -- `pot_config.py`: provides default configuration of pots and sliders for each target. - -- `hal_keys.py`: parse keys & trims. - -- `hal_switches.py`: parse switches. - -- `switch_config.py`: default switch configuration (all targets) as well as display positions - (only `stdlcd` targets). - -Once the format is stable enough and does not require editing each target separately -to add or rename each attribute, the JSON definition for each target will be generated -and added to version control. Then the Python scripts will obsoleted and removed. The -target's `hal.h` should be cleaned-up as well with the definitions present in JSON removed. +`legacy_names.py` contains some hard-coded definitions providing additional +information related to analog inputs (by target; mostly names and labels). diff --git a/radio/util/hw_defs/generator.py b/radio/util/hw_defs/generator.py index 616ed5302c9..a9ba622bfae 100644 --- a/radio/util/hw_defs/generator.py +++ b/radio/util/hw_defs/generator.py @@ -1,101 +1,77 @@ - import json import jinja2 import legacy_names import json_index +from models import KeyEnum + MAIN_CONTROL_LUT = { # 2 Gimbal radios - "LH": { "str": "Rud", "local": "STR_STICK_NAMES0" }, - "LV": { "str": "Ele", "local": "STR_STICK_NAMES1" }, - "RV": { "str": "Thr", "local": "STR_STICK_NAMES2" }, - "RH": { "str": "Ail", "local": "STR_STICK_NAMES3" }, + "LH": {"str": "Rud", "local": "STR_STICK_NAMES0"}, + "LV": {"str": "Ele", "local": "STR_STICK_NAMES1"}, + "RV": {"str": "Thr", "local": "STR_STICK_NAMES2"}, + "RH": {"str": "Ail", "local": "STR_STICK_NAMES3"}, # Surface radios - "ST": { "str": "ST", "local": "STR_SURFACE_NAMES0" }, - "TH": { "str": "TH", "local": "STR_SURFACE_NAMES1" }, + "ST": {"str": "ST", "local": "STR_SURFACE_NAMES0"}, + "TH": {"str": "TH", "local": "STR_SURFACE_NAMES1"}, } -# MUST be the same order as 'EnumKeys' -KEYS_LUT = [ - "KEY_MENU", - "KEY_EXIT", - "KEY_ENTER", - - "KEY_PAGEUP", - "KEY_PAGEDN", - - "KEY_UP", - "KEY_DOWN", - - "KEY_LEFT", - "KEY_RIGHT", - - "KEY_PLUS", - "KEY_MINUS", - - "KEY_MODEL", - "KEY_TELE", - "KEY_SYS", - - "KEY_SHIFT", - "KEY_BIND", -] - # def eprint(*args, **kwargs): # from sys import stderr # print(*args, file=stderr, **kwargs) -def is_ext_input(input): - if input.get('type') != 'FLEX': +def is_ext_input(input): + if input.get("type") != "FLEX": return False - name = input.get('name') - if name and name.startswith('EXT'): + name = input.get("name") + if name and name.startswith("EXT"): return True return False def generate_from_template(json_filename, template_filename, target): - with open(json_filename) as json_file: with open(template_filename) as template_file: - root_obj = json.load(json_file) - adc_inputs = root_obj.get('adc_inputs') + adc_inputs = root_obj.get("adc_inputs") adc_index = json_index.build_adc_index(adc_inputs) adc_gpios = json_index.build_adc_gpio_port_index(adc_inputs) - switches = root_obj.get('switches') + switches = root_obj.get("switches") switch_gpios = json_index.build_switch_gpio_port_index(switches) - keys = root_obj.get('keys') + keys = root_obj.get("keys") key_gpios = json_index.build_key_gpio_port_index(keys) - trims = root_obj.get('trims') + trims = root_obj.get("trims") trim_gpios = json_index.build_trim_gpio_port_index(trims) - + legacy_inputs = legacy_names.inputs_by_target(target) - - env = jinja2.Environment( - lstrip_blocks=True, - trim_blocks=True - ) - env.tests['ext_input'] = is_ext_input + env = jinja2.Environment(lstrip_blocks=True, trim_blocks=True) + + env.tests["ext_input"] = is_ext_input template_str = template_file.read() template = env.from_string(template_str) - print(template.render(root_obj, - adc_index=adc_index, - adc_gpios=adc_gpios, - switch_gpios=switch_gpios, - key_gpios=key_gpios, - trim_gpios=trim_gpios, - legacy_inputs=legacy_inputs, - main_labels=MAIN_CONTROL_LUT, - key_index=KEYS_LUT)) + key_index = list([str(i) for i in KeyEnum]) + + print( + template.render( + root_obj, + adc_index=adc_index, + adc_gpios=adc_gpios, + switch_gpios=switch_gpios, + key_gpios=key_gpios, + trim_gpios=trim_gpios, + legacy_inputs=legacy_inputs, + main_labels=MAIN_CONTROL_LUT, + key_index=key_index, + ) + ) diff --git a/radio/util/hw_defs/hal_adc.py b/radio/util/hw_defs/hal_adc.py deleted file mode 100644 index 51b86500d19..00000000000 --- a/radio/util/hw_defs/hal_adc.py +++ /dev/null @@ -1,291 +0,0 @@ -from pot_config import pot_cfg_by_target - -MAX_POTS = 4 -MAX_SLIDERS = 4 -MAX_EXTS = 4 -MAX_RAWS = 4 - - -def eprint(*args, **kwargs): - from sys import stderr - print(*args, file=stderr, **kwargs) - -class ADCInput: - - TYPE_STICK = 'STICK' - TYPE_FLEX = 'FLEX' - TYPE_SWITCH = 'SWITCH' - TYPE_RAW = 'RAW' - # TYPE_BATT = 'BATT' - - def __init__(self, name, adc_input_type, adc, gpio, pin, channel): - self.name = name - self.type = adc_input_type - self.adc = adc - self.gpio = gpio - self.pin = pin - self.channel = channel - -class SPI_ADCInput: - - def __init__(self, name, adc_input_type, channel): - self.name = name - self.type = adc_input_type - self.adc = 'SPI' - self.channel = channel - -class ADC: - def __init__(self, name, adc): - self.name = name - self.adc = adc - -class MouseName: - AXIS = ['x','y'] - def format(self, idx): - axis = self.AXIS[idx - 1] - return f'JS{axis}' - -def AZ_seq(): - return [chr(i) for i in range(ord('A'), ord('Z') + 1)] - -class ADCInputParser: - - ADC_MAIN = 'MAIN' - ADC_EXT = 'EXT' - - ADC_INPUTS = [ - { - 'range': ['LH','LV','RV','RH','ST','TH'], - 'type': ADCInput.TYPE_STICK, - 'suffix': 'STICK_{}', - 'name': '{}', - }, - { - 'range': range(1, MAX_POTS + 1), - 'type': ADCInput.TYPE_FLEX, - 'suffix': 'POT{}', - 'name': 'P{}', - }, - { - 'range': range(1, MAX_SLIDERS + 1), - 'type': ADCInput.TYPE_FLEX, - 'suffix': 'SLIDER{}', - 'name': 'SL{}', - }, - { - 'range': range(1, MAX_EXTS + 1), - 'type': ADCInput.TYPE_FLEX, - 'suffix': 'EXT{}', - 'name': 'EXT{}', - }, - { - 'range': range(1, MAX_RAWS + 1), - 'type': ADCInput.TYPE_RAW, - 'suffix': 'RAW{}', - 'name': 'RAW{}', - }, - { - 'range': range(1, 2 + 1), - 'type': ADCInput.TYPE_FLEX, - 'suffix': 'MOUSE{}', - 'name': MouseName(), - }, - { - 'type': 'VBAT', - 'name': 'VBAT', - 'suffix': 'BATT', - }, - { - 'type': 'RTC_BAT', - 'name': 'RTC_BAT', - 'suffix': 'RTC_BAT', - }, - { - 'type': 'LUX', - 'name': 'LUX', - 'suffix': 'LUX', - }, - { - 'range': AZ_seq(), - 'type': ADCInput.TYPE_SWITCH, - 'suffix': 'SW{}', - 'name': 'SW{}', - }, - ] - - - def __init__(self, target, hw_defs, labels): - self.target = target - self.hw_defs = hw_defs - self.labels = labels - self.regs = self._parse_regs() - self.dirs = self._parse_dirs() - self.adcs = [] - - def _parse_regs(self): - - regs = {} - for reg in AZ_seq(): - reg = f'GPIO{reg}' - pins_def = f'ADC_{reg}_PINS' - if pins_def in self.hw_defs: - regs[reg] = self.hw_defs[pins_def] - - return regs - - def _parse_dirs(self): - - ret = [] - dirs = self.hw_defs.get('ADC_DIRECTION') or '' - if dirs: - dirs = dirs.strip('{} ').split(',') - # eprint(dirs) - for i in dirs: - ret.append(int(i)) - - return ret - - def _find_adc(self, channel_def): - - if (self.ext_list is None) or (channel_def not in self.ext_list): - return self.ADC_MAIN - else: - return self.ADC_EXT - - def _find_gpio(self, pin): - gpio = None - for reg, pins_def in self.regs.items(): - if pins_def and (pin in pins_def): - gpio = reg - - return gpio - - - def _parse_adc(self, name, periph, prefix): - - adc_periph = self.hw_defs.get(periph) - if not adc_periph: - return None - - adc = ADC(name, adc_periph) - adc.dma = self.hw_defs.get(f'{prefix}_DMA') - if adc.dma: - adc.dma_channel = self.hw_defs[f'{prefix}_DMA_CHANNEL'] - adc.dma_stream = self.hw_defs[f'{prefix}_DMA_STREAM'] - adc.dma_stream_irq = self.hw_defs[f'{prefix}_DMA_STREAM_IRQ'] - adc.dma_stream_irq_handler = self.hw_defs[f'{prefix}_DMA_STREAM_IRQHandler'] - - adc.sample_time = self.hw_defs[f'{prefix}_SAMPTIME'] - return adc - - def _parse_adcs(self): - - adcs = [] - - adc_spi = self.hw_defs.get('ADC_SPI') - if adc_spi: - #eprint('## Found SPI ADC') - adc = ADC('SPI', adc_spi) - adc.gpio_pin_miso = self.hw_defs['ADC_SPI_GPIO_PIN_MISO'] - adc.gpio_pin_mosi = self.hw_defs['ADC_SPI_GPIO_PIN_MOSI'] - adc.gpio_pin_sck = self.hw_defs['ADC_SPI_GPIO_PIN_SCK'] - adc.gpio_pin_cs = self.hw_defs['ADC_SPI_GPIO_PIN_CS'] - adcs.append(adc) - - adc_main = self._parse_adc('MAIN', 'ADC_MAIN', 'ADC') - if adc_main: - adcs.append(adc_main) - - self.ext_list = None - adc_ext = self._parse_adc('EXT', 'ADC_EXT', 'ADC_EXT') - if adc_ext: - self.ext_list = self.hw_defs['ADC_EXT_CHANNELS'] - adcs.append(adc_ext) - - return adcs - - def _parse_input_type(self, input_type, name, suffix): - - gpio = None - pin = None - d = 1 # non-inverted - - # search for SPI input first - spi_def = f'ADC_SPI_{suffix}' - if spi_def in self.hw_defs: - #eprint('## Found SPI ADC Input:', spi_def) - channel = self.hw_defs[spi_def] - return SPI_ADCInput(name, input_type, channel) - - if name != 'RTC_BAT': - pin_def = f'ADC_GPIO_PIN_{suffix}' - pin = self.hw_defs[pin_def] - gpio = self._find_gpio(pin_def) - - # check if 'pin' is maybe an alias - alias = self.hw_defs.get(pin) - if alias is not None: - alias_gpio = self._find_gpio(pin) - gpio = alias_gpio if alias_gpio else gpio - pin = alias - - channel_def = f'ADC_CHANNEL_{suffix}' - channel = self.hw_defs[channel_def] - adc = self._find_adc(channel_def) - - return ADCInput(name, input_type, adc, gpio, pin, channel) - - def _add_input(self, adc_input): - if adc_input is not None: - idx = len(self.inputs) - if adc_input.type == 'STICK': - if 'PWM_STICKS' in self.hw_defs: - ch = self.hw_defs.get(f'STICK_PWM_CHANNEL_{adc_input.name}') - adc_input.pwm_channel = idx if ch is None else ch - if adc_input.type != 'VBAT' and adc_input.type != 'RTC_BAT' and adc_input.type != 'LUX': - d = self.dirs[idx] - if d < 0: - adc_input.inverted = True - if adc_input.type == 'FLEX': - input_labels = self.labels[adc_input.name] - adc_input.label = input_labels.get('label') - adc_input.short_label = input_labels.get('short_label') - cfg = pot_cfg_by_target(self.target,adc_input.name) - if cfg: - adc_input.default = cfg.get('default') - - self.inputs.append(adc_input) - - def parse_inputs(self): - - self.adcs = self._parse_adcs() - self.inputs = [] - - for adc_input in self.ADC_INPUTS: - input_type = adc_input['type'] - input_range = adc_input.get('range') - - if input_range is not None: - for i in input_range: - name = adc_input['name'].format(i) - suffix = adc_input['suffix'].format(i) - try: - self._add_input(self._parse_input_type(input_type, name, suffix)) - except KeyError: - pass - else: - # type, name, suffix - name = adc_input['name'] - suffix = adc_input['suffix'] - try: - self._add_input(self._parse_input_type(input_type, name, suffix)) - except KeyError: - pass - - return { 'adcs': self.adcs, 'inputs': self.inputs } - - def find_input(self, name): - for adc_input in self.inputs: - if adc_input.name == name: - return adc_input - return None diff --git a/radio/util/hw_defs/hal_json.py b/radio/util/hw_defs/hal_json.py index 4da2ed67368..53b7c52cad7 100644 --- a/radio/util/hw_defs/hal_json.py +++ b/radio/util/hw_defs/hal_json.py @@ -1,47 +1,38 @@ - import re import sys -import json - -from hal_switches import Switch, parse_switches -from hal_adc import ADCInput, SPI_ADCInput, ADC, ADCInputParser -from hal_keys import Key, Trim, parse_trims, parse_keys -from hal_lcd import Display, parse_lcd -from hal_cfs import CFS, parse_cfs -from hal_misc import Misc, parse_misc -import legacy_names # # Return a file handle or STDIN # def open_file(filename): - - if filename and not filename == '-': + if filename and not filename == "-": return open(filename) else: return sys.stdin + # # Read lines of defines into a dictionary # def parse_hw_defs(filename): - hw_defs = {} with open_file(filename) as file: for line in file.readlines(): - m = re.match(r'#define ([^\s]*)\s*(.*)', line.rstrip()) - name = m.group(1) - value = m.group(2) - if value.isnumeric(): - value = int(value) - elif not value: - value = None - hw_defs[name] = value + m = re.match(r"#define ([^\s]*)\s*(.*)", line.rstrip()) + if m: + name = m.group(1) + value = m.group(2) + if value.isnumeric(): + value = int(value) + elif not value: + value = None + hw_defs[name] = value return hw_defs + def prune_dict(d): # ret = {} # for k, v in d.items(): @@ -50,62 +41,38 @@ def prune_dict(d): # return ret return d -class DictEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, Switch): - return prune_dict(obj.__dict__) - if isinstance(obj, ADCInput): - return prune_dict(obj.__dict__) - if isinstance(obj, SPI_ADCInput): - return prune_dict(obj.__dict__) - if isinstance(obj, ADC): - return prune_dict(obj.__dict__) - if isinstance(obj, Trim): - return prune_dict(obj.__dict__) - if isinstance(obj, Key): - return prune_dict(obj.__dict__) - if isinstance(obj, Display): - return prune_dict(obj.__dict__) - if isinstance(obj, CFS): - return prune_dict(obj.__dict__) - if isinstance(obj, Misc): - return prune_dict(obj.__dict__) +# class DictEncoder(json.JSONEncoder): +# def default(self, o): +# if isinstance(o, Switch): +# return prune_dict(o.__dict__) +# if isinstance(o, ADCInput): +# return prune_dict(o.__dict__) +# if isinstance(o, SPI_ADCInput): +# return prune_dict(o.__dict__) +# if isinstance(o, ADC): +# return prune_dict(o.__dict__) +# if isinstance(o, Trim): +# return prune_dict(o.__dict__) +# if isinstance(o, Key): +# return prune_dict(o.__dict__) +# if isinstance(o, Display): +# return prune_dict(o.__dict__) +# if isinstance(o, CFS): +# return prune_dict(o.__dict__) +# if isinstance(o, Misc): +# return prune_dict(o.__dict__) + +# # Let the base class default method raise the TypeError +# return json.JSONEncoder.default(self, o) - # Let the base class default method raise the TypeError - return json.JSONEncoder.default(self, obj) # # Parse HAL defines into JSON # def parse_defines(filename, target): - - hw_defs = parse_hw_defs(filename) - out_defs = {} - - # parse ADC first, we might have switches using ADC - legacy_inputs = legacy_names.inputs_by_target(target) - adc_parser = ADCInputParser(target,hw_defs,legacy_inputs) - adc_inputs = adc_parser.parse_inputs() - out_defs["adc_inputs"] = adc_inputs - - switches = parse_switches(target, hw_defs, adc_parser) - out_defs["switches"] = switches - - keys = parse_keys(target, hw_defs) - out_defs["keys"] = keys - - trims = parse_trims(hw_defs) - out_defs["trims"] = trims - - display = parse_lcd(hw_defs) - out_defs["display"] = display - - cfs = parse_cfs(hw_defs) - out_defs["custom_switches"] = cfs - - misc = parse_misc(hw_defs) - out_defs["hardware"] = misc - - print(json.dumps(out_defs, cls=DictEncoder, indent=2)) - + # hw_defs = LoggingDict(parse_hw_defs(filename)) + # out_defs = {} + # + # print(json.dumps(out_defs, cls=DictEncoder, indent=2)) + pass diff --git a/radio/util/hw_defs/hal_keys.py b/radio/util/hw_defs/hal_keys.py deleted file mode 100644 index e6779e5af6a..00000000000 --- a/radio/util/hw_defs/hal_keys.py +++ /dev/null @@ -1,226 +0,0 @@ - -# Trims: -# TRIMS_GPIO_REG_[trim] -# TRIMS_GPIO_PIN_[trim] -# -# where 'trim' is one of: -# -# (-) (+) -# 'LHL', 'LHR', -# 'LVD', 'LVU', -# 'RVD', 'RVU', -# 'RHL', 'RHR', -# 'LSD', 'LSU', T4 -# 'RSD', 'RSU', T5 - -TRIMS = [ - # Air - { "name": "T1", "dec": "LHL", "inc": "LHR", "input": "LH" }, - { "name": "T2", "dec": "LVD", "inc": "LVU", "input": "LV" }, - { "name": "T3", "dec": "RVD", "inc": "RVU", "input": "RV" }, - { "name": "T4", "dec": "RHL", "inc": "RHR", "input": "RH" }, - { "name": "T5", "dec": "LSD", "inc": "LSU" }, - { "name": "T6", "dec": "RSD", "inc": "RSU" }, - { "name": "T7", "dec": "T7L", "inc": "T7R" }, - { "name": "T8", "dec": "T8D", "inc": "T8U" }, - # Surface - { "name": "T1", "dec": "T1L", "inc": "T1R", "input": "ST" }, - { "name": "T2", "dec": "T2L", "inc": "T2R", "input": "TH" }, - { "name": "T3", "dec": "T3L", "inc": "T3R"}, - { "name": "T4", "dec": "T4L", "inc": "T4R"}, - { "name": "T5", "dec": "T5L", "inc": "T5R" }, - { "name": "T6", "dec": "T6D", "inc": "T6U" }, -] - -KEYS = [ - { "name": "MENU", "key": "KEY_MENU", "label": "MENU" }, - { "name": "EXIT", "key": "KEY_EXIT", "label": "EXIT" }, - { "name": "ENTER", "key": "KEY_ENTER", "label": "Enter" }, - - { "name": "PAGEUP", "key": "KEY_PAGEUP", "label": "PAGE<" }, - { "name": "PAGEDN", "key": "KEY_PAGEDN", "label": "PAGE>" }, - - { "name": "UP", "key": "KEY_UP", "label": "Up" }, - { "name": "DOWN", "key": "KEY_DOWN", "label": "Down" }, - - { "name": "LEFT", "key": "KEY_LEFT", "label": "Left" }, - { "name": "RIGHT", "key": "KEY_RIGHT", "label": "Right" }, - - { "name": "PLUS", "key": "KEY_PLUS", "label": "(+)" }, - { "name": "MINUS", "key": "KEY_MINUS", "label": "(-)" }, - - { "name": "MDL", "key": "KEY_MODEL", "label": "MDL" }, - { "name": "TELE", "key": "KEY_TELE", "label": "TELE" }, - { "name": "SYS", "key": "KEY_SYS", "label": "SYS" }, - - { "name": "SHIFT", "key": "KEY_SHIFT", "label": "Shift" } -] - -KEY_LABELS = [ - { - "targets": {"boxer", "f16", "mt12", "gx12", "pocket", "tx12", "tx12mk2", "tx16s", "tx16smk3","v16", "zorro", "dro1"}, - "keys": { - "EXIT": { "label": "RTN" } - } - }, - { - "targets": {"bumblebee", "t12max", "t14", "t15", "t20", "t20v2", "tpro", "tpros", "tprov2"}, - "keys": { - "PAGEDN": { "label": "" }, - } - }, - { - "targets": {"x7", "x7access", "x9e"}, - "keys": { - "PAGEDN": { "label": "PAGE" }, - } - }, - { - "targets": {"t16", "t18"}, - "keys": { - "EXIT": { "label": "RTN" }, - "PAGEDN": {"label": "PAGE" } - } - }, - { - "targets": {"x9d", "x9d+", "x9d+2019"}, - "keys": { - "ENTER": { "label": "ENT" }, - "PAGEDN": { "label": "PAGE" } - } - }, - { - "targets": {"x10", "x10express"}, - "keys": { - "EXIT": { "label": "RTN" }, - "PAGEDN": { "label": "PgUp/Dn" } - } - }, - { - "targets": {"x12s"}, - "keys": { - "EXIT": { "label": "RTN" }, - "PAGEUP": { "label": "PgUp" }, - "PAGEDN": { "label": "PgDn" } - } - }, - { - "targets": {"t8"}, - "keys": { - "EXIT": { "label": "RTN" }, - "ENTER": { "label": "ENT" } - } - }, - { - "targets": {"tlite"}, - "keys": { - "EXIT": { "label": "RTN" }, - "ENTER": { "label": "ENT" }, - "LEFT": { "label": "Left/SYS" }, - "RIGHT": { "label": "Right/MDL" } - } - }, - { - "targets": {"commando8"}, - "keys": { - "EXIT": { "label": "BCK" }, - "PAGEUP": { "label": "Left" }, - "PAGEDN": { "label": "Right" }, - "PLUS": { "label": "Up" }, - "MINUS": { "label": "Down" }, - "MENU": { "label": "Menu" } - } - }, - { - "targets": {"st16"}, - "keys": { - "PAGEDN": { "label": "MENU" } - } - }, -] - -class Key: - - def __init__(self, gpio, pin): - self.gpio = gpio - self.pin = pin - self.active_low = True - -class Trim: - - def __init__(self, name, dec, inc): - self.name = name - if dec and dec.gpio and inc and inc.gpio: - self.dec = dec - self.inc = inc - self.active_low = True - -def get_trim_switch(hw_defs, tag): - - gpio = f'TRIMS_GPIO_REG_{tag}' - pin = f'TRIMS_GPIO_PIN_{tag}' - - if (gpio in hw_defs) and (pin in hw_defs): - key = Key(hw_defs[gpio], hw_defs[pin]) - if 'TRIMS_GPIO_ACTIVE_HIGH' in hw_defs: - key.active_low = False - return key - - return None - - -def parse_trims(hw_defs): - - trims = [] - for t in TRIMS: - - name = t['name'] - dec = get_trim_switch(hw_defs, t['dec']) - inc = get_trim_switch(hw_defs, t['inc']) - - if dec and inc: - trims.append(Trim(name, dec, inc)) - - elif t.get('input'): - input = t['input'] - if f'TRIMS_VIRTUAL_{input}' in hw_defs: - trims.append(Trim(name, None, None)) - - return trims - - -def key_label(target, name): - for d in KEY_LABELS: - if target in d['targets']: - keys = d.get('keys') - key = keys.get(name) - if key: - return key['label'] - - return None - - -def parse_keys(target, hw_defs): - - keys = [] - - for k in KEYS: - - name = k['name'] - gpio = f'KEYS_GPIO_REG_{name}' - pin = f'KEYS_GPIO_PIN_{name}' - - if (gpio in hw_defs) and (pin in hw_defs): - key = Key(hw_defs[gpio], hw_defs[pin]) - key.key = k['key'] - key.name = name - label = key_label(target, name) - if label: - key.label = label - else: - key.label = k['label'] - if 'KEYS_GPIO_ACTIVE_HIGH' in hw_defs: - key.active_low = False - keys.append(key) - - return keys diff --git a/radio/util/hw_defs/hal_misc.py b/radio/util/hw_defs/hal_misc.py index ae8f8322e69..e987b5dfb5c 100644 --- a/radio/util/hw_defs/hal_misc.py +++ b/radio/util/hw_defs/hal_misc.py @@ -1,13 +1,15 @@ class Misc: - def __init__(self, has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface): + def __init__(self, has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface, cpu, cpu_type): self.has_audio_mute = has_audio_mute self.has_bling_leds = has_bling_leds self.has_ext_module_support = has_ext_module_support self.has_int_module_support = has_int_module_support self.sport_max_baudrate = sport_max_baudrate self.surface = surface + self.cpu = cpu + self.cpu_type = cpu_type def parse_misc(hw_defs): @@ -41,4 +43,14 @@ def parse_misc(hw_defs): else: has_int_module_support = 1 - return Misc(has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface) + if f'CPU_TYPE_FULL' in hw_defs: + cpu = hw_defs[f'CPU_TYPE_FULL'] + else: + cpu = f'Unknown' + + if f'CPU_TYPE' in hw_defs: + cpu_type = hw_defs[f'CPU_TYPE'] + else: + cpu_type = f'Unknown' + + return Misc(has_audio_mute, has_bling_leds, has_ext_module_support, has_int_module_support, sport_max_baudrate, surface, cpu, cpu_type) diff --git a/radio/util/hw_defs/hal_switches.py b/radio/util/hw_defs/hal_switches.py deleted file mode 100644 index 7d1a40fb511..00000000000 --- a/radio/util/hw_defs/hal_switches.py +++ /dev/null @@ -1,140 +0,0 @@ -from switch_config import switch_cfg_by_target - -class Switch: - TYPE_2POS = "2POS" - TYPE_3POS = "3POS" - TYPE_ADC = "ADC" - - def __init__(self, name, sw_type, flags): - self.name = name - self.type = sw_type - self.flags = flags - self.inverted = False - self.default = None - self.display = None - - -class Switch2POS(Switch): - def __init__(self, name, gpio, pin, flags=0): - super(Switch2POS, self).__init__(name, Switch.TYPE_2POS, flags) - self.gpio = gpio - self.pin = pin - - -class Switch3POS(Switch): - def __init__(self, name, gpio_high, pin_high, gpio_low, pin_low, flags=0): - super(Switch3POS, self).__init__(name, Switch.TYPE_3POS, flags) - self.gpio_high = gpio_high - self.pin_high = pin_high - self.gpio_low = gpio_low - self.pin_low = pin_low - - -class SwitchADC(Switch): - def __init__(self, name, adc_input, flags=0): - super(SwitchADC, self).__init__(name, Switch.TYPE_ADC, flags) - self.adc_input = adc_input - - -class SwitchCustom(Switch): - def __init__(self, name, type, flags=0): - super(SwitchCustom, self).__init__(name, type, flags) - - -def AZ_seq(): - return [chr(i) for i in range(ord("A"), ord("Z") + 1)] - - -def eprint(*args, **kwargs): - from sys import stderr - - print(*args, file=stderr, **kwargs) - - -def prefixsearch(dictionary, prefix): - for k in dictionary.keys(): - if k.startswith(prefix): - return k[len(prefix) :] - - return None - - -# switches from A to Z -def parse_switches(target, hw_defs, adc_parser): - switches = [] - - def find_switch(name): - for sw in switches: - if name == sw.name: - return sw - return None - - for s in AZ_seq(): - name = f"S{s}" - - reg = f"SWITCHES_GPIO_REG_{s}" - reg_high = f"{reg}_H" - reg_low = f"{reg}_L" - - pin = f"SWITCHES_GPIO_PIN_{s}" - pin_high = f"{pin}_H" - pin_low = f"{pin}_L" - - inverted = f"SWITCHES_{s}_INVERTED" - - adc_input_name = f"SW{s}" - custom = f"SWITCHES_{s}_" - - cfs_idx = f"SWITCHES_{s}_CFS_IDX" - - switch = None - if reg in hw_defs: - # 2POS switch - reg = hw_defs[reg] - pin = hw_defs[pin] - switch = Switch2POS(name, reg, pin) - elif (reg_high in hw_defs) and (reg_low in hw_defs): - # 3POS switch - reg_high = hw_defs[reg_high] - pin_high = hw_defs[pin_high] - reg_low = hw_defs[reg_low] - pin_low = hw_defs[pin_low] - switch = Switch3POS(name, reg_high, pin_high, reg_low, pin_low) - elif adc_parser.find_input(adc_input_name): - # ADC switch - switch = SwitchADC(name, adc_input_name) - else: - type = prefixsearch(hw_defs, custom) - if type is not None: - switch = SwitchCustom(name, type) - - if switch: - if inverted in hw_defs: - switch.inverted = True - - if cfs_idx in hw_defs: - switch.is_cfs = True - switch.cfs_idx = hw_defs[cfs_idx] - else: - switch.is_cfs = False - - cfg = switch_cfg_by_target(target, name) - if cfg: - switch.default = cfg.get("default") - switch.display = cfg.get("display") - else: - switch.default = "NONE" - - switches.append(switch) - - for i in range(1, 6 + 1): - f_sw_marker = f"FUNCTION_SWITCH_{i}" - if f_sw_marker in hw_defs: - switch = find_switch(hw_defs[f_sw_marker]) - if switch: - switch.name = f"SW{i}" - else: - switch = SwitchCustom(f"SW{i}", Switch.TYPE_2POS) - switches.append(switch) - - return switches diff --git a/radio/util/hw_defs/json_validator.py b/radio/util/hw_defs/json_validator.py new file mode 100644 index 00000000000..4bb57e09c84 --- /dev/null +++ b/radio/util/hw_defs/json_validator.py @@ -0,0 +1,116 @@ +from json import JSONDecodeError +from pathlib import Path +from typing import List, Tuple +from typing_extensions import Type + +from pydantic import BaseModel, ValidationError + + +def validate_json_files( + directory: str, model_class: Type[BaseModel] +) -> Tuple[List[str], List[Tuple[str, str]]]: + """ + Validate all JSON files in a directory against a Pydantic model. + + Args: + directory: Path to the directory containing JSON files + model_class: Pydantic model class to validate against + + Returns: + Tuple of (valid_files, invalid_files_with_errors) + """ + directory_path = Path(directory) + + if not directory_path.exists(): + raise FileNotFoundError(f"Directory {directory} does not exist") + + valid_files = [] + invalid_files = [] + + # Find all JSON files in the directory + json_files = list(directory_path.glob("*.json")) + + if not json_files: + print(f"No JSON files found in {directory}") + return valid_files, invalid_files + + print(f"Found {len(json_files)} JSON files to validate") + + for json_file in json_files: + try: + # Read the JSON file + with open(json_file, "r", encoding="utf-8") as f: + json_data = f.read() + + # Validate against given model + model_class.model_validate_json(json_data) + + valid_files.append(str(json_file)) + print(f"✓ {json_file.name} - Valid") + + except ValidationError as e: + error_msg = str(e) + invalid_files.append((str(json_file), error_msg)) + print(f"✗ {json_file.name} - Validation Error:") + print(f" {error_msg}") + + except JSONDecodeError as e: + error_msg = f"Invalid JSON syntax: {e}" + invalid_files.append((str(json_file), error_msg)) + print(f"✗ {json_file.name} - JSON Decode Error:") + print(f" {error_msg}") + + except Exception as e: + error_msg = f"Unexpected error: {e}" + invalid_files.append((str(json_file), error_msg)) + print(f"✗ {json_file.name} - Unexpected Error:") + print(f" {error_msg}") + + return valid_files, invalid_files + + +def main(): + """Main function to run the validation""" + import argparse + + parser = argparse.ArgumentParser( + description="Validate JSON files against HardwareDefinition model" + ) + parser.add_argument( + "-v", "--verbose", action="store_true", help="Show detailed error messages" + ) + parser.add_argument( + "directory", help="Path to directory containing JSON files to validate" + ) + + args = parser.parse_args() + + try: + from models import HardwareDefinition + + valid_files, invalid_files = validate_json_files( + args.directory, HardwareDefinition + ) + + print("\n=== Validation Summary ===") + print(f"Total files processed: {len(valid_files) + len(invalid_files)}") + print(f"Valid files: {len(valid_files)}") + print(f"Invalid files: {len(invalid_files)}") + + if invalid_files: + print("\nInvalid files:") + for file_path, error in invalid_files: + if args.verbose: + print(f" - {Path(file_path).name}: {error}") + else: + print(f" - {Path(file_path).name}") + + return 0 if not invalid_files else 1 + + except Exception as e: + print(f"Error during validation: {e}") + return 1 + + +if __name__ == "__main__": + exit(main()) diff --git a/radio/util/hw_defs/legacy_names.py b/radio/util/hw_defs/legacy_names.py index 4065fe6ad05..16dd40fd57c 100644 --- a/radio/util/hw_defs/legacy_names.py +++ b/radio/util/hw_defs/legacy_names.py @@ -551,7 +551,7 @@ "lr3pro", "nv14", "el18", "t8", "t12", - "tlite", "tlitef4", "tpro", "tprov2", "tpros", "bumblebee", + "tlite", "tpro", "tprov2", "tpros", "bumblebee", "tx12", "tx12mk2", "x7", "x7access", "xlite", "xlites", diff --git a/radio/util/hw_defs/logging_dict.py b/radio/util/hw_defs/logging_dict.py new file mode 100644 index 00000000000..f3b0bf75aaa --- /dev/null +++ b/radio/util/hw_defs/logging_dict.py @@ -0,0 +1,98 @@ +import sys +from typing import Any, Dict, Iterator, KeysView, Optional, ValuesView, ItemsView + + +class LoggingDict: + """A dictionary wrapper that logs all lookups to stderr.""" + + def __init__(self, data: Optional[Dict[Any, Any]] = None): + self._data = data if data is not None else {} + + def __getitem__(self, key: Any) -> Any: + """Log the lookup and return the value.""" + print(f"{str(key)}", file=sys.stderr) + return self._data[key] + + def __setitem__(self, key: Any, value: Any) -> None: + """Set an item in the dictionary.""" + self._data[key] = value + + def __delitem__(self, key: Any) -> None: + """Delete an item from the dictionary.""" + del self._data[key] + + def __contains__(self, key: Any) -> bool: + """Check if key exists (this is also a lookup, so log it).""" + print(f"{str(key)}", file=sys.stderr) + return key in self._data + + def __len__(self) -> int: + """Return the length of the dictionary.""" + return len(self._data) + + def __iter__(self) -> Iterator: + """Return an iterator over the keys.""" + return iter(self._data) + + def __repr__(self) -> str: + """Return a string representation.""" + return f"LoggingDict({self._data})" + + def get(self, key: Any, default: Any = None) -> Any: + """Get a value with optional default (logs the lookup).""" + print(f"{str(key)}", file=sys.stderr) + return self._data.get(key, default) + + def keys(self) -> KeysView: + """Return dictionary keys.""" + return self._data.keys() + + def values(self) -> ValuesView: + """Return dictionary values.""" + return self._data.values() + + def items(self) -> ItemsView: + """Return dictionary items.""" + return self._data.items() + + def update(self, other: Dict[Any, Any]) -> None: + """Update the dictionary with another dictionary.""" + self._data.update(other) + + def clear(self) -> None: + """Clear all items from the dictionary.""" + self._data.clear() + + def pop(self, key: Any, default: Any = None) -> Any: + """Remove and return a value (logs the lookup).""" + print(f"{str(key)}", file=sys.stderr) + if default is None: + return self._data.pop(key) + return self._data.pop(key, default) + + def setdefault(self, key: Any, default: Any = None) -> Any: + """Get a value or set/return default (logs the lookup).""" + print(f"{str(key)}", file=sys.stderr) + return self._data.setdefault(key, default) + + +# Example usage +if __name__ == "__main__": + # Create a logging dictionary + d = LoggingDict({"a": 1, "b": 2, "c": 3}) + + # These operations will be logged to stderr + print("Value of 'a':", d["a"]) + print("Value of 'b':", d.get("b")) + print("Does 'c' exist?", "c" in d) + print("Does 'd' exist?", "d" in d) + + # Add new items + d["d"] = 4 + d["e"] = 5 + + # More logged lookups + print("Value of 'd':", d["d"]) + print("Popped 'e':", d.pop("e")) + + print("Final dictionary:", d) diff --git a/radio/util/hw_defs/models.py b/radio/util/hw_defs/models.py new file mode 100644 index 00000000000..0210bb02fc1 --- /dev/null +++ b/radio/util/hw_defs/models.py @@ -0,0 +1,297 @@ +from enum import Enum +from typing_extensions import List, Literal, Optional, Tuple, Union + +from pydantic import BaseModel, model_validator +from pydantic_core import from_json, PydanticCustomError + + +class StrEnum(str, Enum): + @staticmethod + def _generate_next_value_(name, start, count, last_values): + return name + + def __str__(self) -> str: + return self.value + + +ADCNameType = Literal["MAIN", "EXT", "SPI"] + + +class ADC(BaseModel): + name: ADCNameType + adc: str + sample_time: Optional[str] = None + dma: Optional[str] = None + dma_channel: Optional[str] = None + dma_stream: Optional[str] = None + dma_stream_irq: Optional[str] = None + dma_stream_irq_handler: Optional[str] = None + + +StickEnum = StrEnum( + "StickEnum", + ( + # 2 Gimbal radios + "LH", + "LV", + "RV", + "RH", + # Surface radios + "ST", + "TH", + ), +) + +MAX_POTS = 8 +MAX_SLIDERS = 8 +MAX_EXT = 16 +MAX_RAW = 8 + +FlexInputEnum = StrEnum( + "FlexInputEnum", + ( + [f"P{i}" for i in range(1, MAX_POTS)] + + [f"SL{i}" for i in range(1, MAX_SLIDERS)] + + [f"EXT{i}" for i in range(1, MAX_EXT)] + + ["JSx", "JSy"] + ), +) + +SwitchInputEnum = StrEnum( + "SwitchInputEnum", + list([f"SW{chr(i)}" for i in range(ord("A"), ord("Z") + 1)]), +) + +RawInputEnum = StrEnum("RawInputEnum", list([f"RAW{i}" for i in range(1, MAX_RAW)])) + +InputNameType = Union[StickEnum, FlexInputEnum, SwitchInputEnum, RawInputEnum] + +InputType = StrEnum( + "InputType", + ( + "STICK", + "FLEX", + "SWITCH", + "VBAT", + "RTC_BAT", + "RAW", + ), +) + +FlexType = StrEnum( + "FlexType", + ( + "NONE", + "POT", + "POT_CENTER", + "SLIDER", + "MULTIPOS", + "AXIS_X", + "AXIS_Y", + ), +) + + +class StickInput(BaseModel): + name: StickEnum + type: Literal["STICK"] + adc: Optional[ADCNameType] = None + gpio: Optional[str] = None + pin: Optional[str] = None + channel: Optional[Union[str, int]] = None + inverted: Optional[bool] = False + + +class FlexInput(BaseModel): + name: FlexInputEnum + type: Literal["FLEX"] + adc: ADCNameType + gpio: Optional[str] = None + pin: Optional[str] = None + channel: Optional[Union[str, int]] = None + inverted: Optional[bool] = False + default: Optional[FlexType] = FlexType.NONE + label: Optional[str] = None + short_label: Optional[str] = None + + +class SwitchInput(BaseModel): + name: SwitchInputEnum + type: Literal["SWITCH"] + adc: ADCNameType + gpio: Optional[str] = None + pin: Optional[str] = None + channel: Optional[Union[str, int]] = None + inverted: Optional[bool] = False + + +class RawInput(BaseModel): + name: RawInputEnum + type: Literal["RAW"] + adc: ADCNameType + gpio: Optional[str] = None + pin: Optional[str] = None + channel: Optional[Union[str, int]] = None + + +class VBatInput(BaseModel): + name: Literal["VBAT"] + type: Literal["VBAT"] + adc: ADCNameType + gpio: Optional[str] = None + pin: Optional[str] = None + channel: Optional[Union[str, int]] = None + + +class RTCBatInput(BaseModel): + name: Literal["RTC_BAT"] + type: Literal["RTC_BAT"] + adc: Literal["MAIN", "EXT"] + channel: str + + +Input = Union[StickInput, FlexInput, SwitchInput, RawInput, VBatInput, RTCBatInput] + + +class ADCInputs(BaseModel): + adcs: List[ADC] + inputs: List[Input] + + +# MUST be the same order as 'EnumKeys' +KeyEnum = StrEnum( + "KeyEnum", + ( + "KEY_MENU", + "KEY_EXIT", + "KEY_ENTER", + "KEY_PAGEUP", + "KEY_PAGEDN", + "KEY_UP", + "KEY_DOWN", + "KEY_LEFT", + "KEY_RIGHT", + "KEY_PLUS", + "KEY_MINUS", + "KEY_MODEL", + "KEY_TELE", + "KEY_SYS", + "KEY_SHIFT", + "KEY_BIND", + ), +) + + +class Key(BaseModel): + name: str + label: str + key: KeyEnum + active_low: Optional[bool] = False + gpio: Optional[str] = None + pin: Optional[str] = None + + @model_validator(mode="after") + def check_hardware(self: "Key") -> "Key": + if bool(self.gpio) != bool(self.pin): + raise PydanticCustomError( + "KeyHardwareError", + "Key missing either 'gpio' or 'pin'", + ) + + return self + + +SwitchHardwareTypeEnum = StrEnum( + "SwitchTypeEnum", + ( + "2POS", + "3POS", + "ADC", + "FSWITCH", + ), +) + +SwitchTypeEnum = StrEnum( + "SwitchTypeEnum", + ( + "2POS", + "3POS", + "TOGGLE", + "NONE", + ), +) + +SwitchDisplayType = Union[Tuple[int, int], Tuple] + + +class Switch(BaseModel): + name: str + type: SwitchHardwareTypeEnum + default: Optional[SwitchTypeEnum] = SwitchTypeEnum.NONE + flags: Optional[int] = 0 + inverted: Optional[bool] = False + adc_input: Optional[str] = None + gpio: Optional[str] = None + pin: Optional[str] = None + gpio_high: Optional[str] = None + pin_high: Optional[str] = None + gpio_low: Optional[str] = None + pin_low: Optional[str] = None + display: Optional[SwitchDisplayType] = None + + def _uses_single_gpio(self: "Switch") -> bool: + return bool(self.pin) + + def _uses_two_gpios(self: "Switch") -> bool: + return bool(self.pin_high or self.pin_low) + + def _uses_gpio(self: "Switch") -> bool: + return bool(self.gpio_high or self.gpio_low or self.gpio) + + @model_validator(mode="after") + def check_hardware(self: "Switch") -> "Switch": + if bool(self.adc_input) == self._uses_gpio(): + if self.adc_input: + raise PydanticCustomError( + "SwitchHardwareError", + "A switch is either using ADC or it's own GPIO pin(s)", + ) + + if self._uses_gpio() and (self._uses_single_gpio() == self._uses_two_gpios()): + raise PydanticCustomError( + "SwitchHardwareError", + "A switch based on GPIO pin(s) uses either a single or two GPIOs", + ) + + if self._uses_single_gpio(): + if str(self.type) not in ["2POS", "FSWITCH"]: + raise PydanticCustomError( + "SwitchHardwareError", + "Single GPIO switch type is either '2POS' or 'FSWITCH'", + ) + # TODO: check 'default' as well? + + if self._uses_two_gpios(): + if not self.pin_high or not self.pin_low: + raise PydanticCustomError( + "SwitchHardwareError", + "Switch missing 'pin_high' or 'pin_low'", + ) + if str(self.type) != "3POS": + raise PydanticCustomError( + "SwitchHardwareError", + "Dual GPIO switch type is always '3POS", + ) + # TODO: check 'default' as well? + + return self + + +class HardwareDefinition(BaseModel): + adc_inputs: ADCInputs + switches: List[Switch] + keys: List[Key] + + @staticmethod + def from_json(data: Union[str, bytes, bytearray]) -> "HardwareDefinition": + return HardwareDefinition.model_validate(from_json(data)) diff --git a/radio/util/hw_defs/pot_config.py b/radio/util/hw_defs/pot_config.py deleted file mode 100644 index 38393d7214c..00000000000 --- a/radio/util/hw_defs/pot_config.py +++ /dev/null @@ -1,303 +0,0 @@ -"""Default configuration of pots and sliders for each target.""" - -POT_CONFIG = { - "boxer": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "P3": {"default": "MULTIPOS"} - }, - "gx12": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "el18": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "nv14": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "pl18": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"}, - "P3": {"default": "POT"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "pl18ev": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "EXT1": {"default": "POT_CENTER"}, - "EXT2": {"default": "POT_CENTER"}, - "EXT3": {"default": "MULTIPOS"}, - "EXT4": {"default": "MULTIPOS"} - }, - "pl18u": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "nb4p": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"} - }, - "v12": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "P3": {"default": "MULTIPOS"}, - }, - "v14": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "P3": {"default": "MULTIPOS"}, - }, - "v16": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "mt12": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"}, - "P3": {"default": "NONE"}, - "P4": {"default": "NONE"} - }, - "tpro": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "tprov2": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "tpros": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "bumblebee": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "t20": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "SL3": {"default": "SLIDER"}, - "SL4": {"default": "SLIDER"}, - }, - "t20v2": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "SL3": {"default": "SLIDER"}, - "SL4": {"default": "SLIDER"}, - }, - "t12": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"} - }, - "t12max": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "t14": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "tx12": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "tx12mk2": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"} - }, - "t15": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - }, - "t16": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "t18": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "tx15": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"}, - }, - "t15pro": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - }, - "tx16s": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "tx16smk3": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "EXT1": {"default": "NONE"}, - "EXT2": {"default": "NONE"}, - }, - "f16": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "x7": { - "P1": {"default": "POT"}, - "P2": {"default": "POT_CENTER"} - }, - "x7access": { - "P1": {"default": "POT"}, - "P2": {"default": "POT_CENTER"} - }, - "x9d": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "x9d+": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "x9d+2019": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "x9e": { - "P1": {"default": "POT_CENTER"}, - "P2": {"default": "POT_CENTER"}, - "P3": {"default": "NONE"}, - "P4": {"default": "NONE"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "SL3": {"default": "SLIDER"}, - "SL4": {"default": "SLIDER"} - }, - "x10": { - "P1": {"default": "POT"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "x10express": { - "P1": {"default": "POT"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"} - }, - "x12s": { - "P1": {"default": "POT"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT_CENTER"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "SL3": {"default": "SLIDER"}, - "SL4": {"default": "SLIDER"}, - "JSx": {"default": "AXIS_X"}, - "JSy": {"default": "AXIS_Y"} - }, - "xlite": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"} - }, - "xlites": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"} - }, - "x9lite": { - "P1": {"default": "POT_CENTER"}, - }, - "x9lites": { - "P1": {"default": "POT_CENTER"}, - }, - "zorro": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"} - }, - "pocket": { - "P1": {"default": "POT"} - }, - "st16": { - "P1": {"default": "POT"}, - "P2": {"default": "POT"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - }, - "pa01": { - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - }, - "dro1": { - "P1": {"default": "POT"}, - "P2": {"default": "MULTIPOS"}, - "P3": {"default": "POT"}, - "SL1": {"default": "SLIDER"}, - "SL2": {"default": "SLIDER"}, - "EXT1": {"default": "SLIDER"}, - "EXT2": {"default": "SLIDER"}, - "EXT3": {"default": "NONE"}, - "EXT4": {"default": "NONE"} - }, -} - - -def pot_cfg_by_target(target, name): - """Retrieve default pot config. - - Parameters - ---------- - target: str - Name of the target - name: str - Canonical name of the pot (Px where 'x' is a number) - or slider (SLx where 'x' is a number) - - Returns - ------- - dict - a dictionary with one key for each pot or slider that mapped - to another dictionary with a single attribute ("default") containing - the default configuration for a pot or slider - """ - sw = POT_CONFIG.get(target) - if sw: - return sw.get(name) - - return None diff --git a/radio/util/hw_defs/switch_config.py b/radio/util/hw_defs/switch_config.py deleted file mode 100644 index a30aff82214..00000000000 --- a/radio/util/hw_defs/switch_config.py +++ /dev/null @@ -1,681 +0,0 @@ -"""Default switches configurations and display positions.""" - -SWITCH_CONFIG = { - "boxer": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]}, - "SF": {"default": "TOGGLE", "display": [1, 2]}, - }, - "gx12": { - # left side - "SA": {"default": "TOGGLE"}, - "SB": {"default": "3POS", "display": [0, 0]}, - "SE": {"default": "3POS", "display": [0, 1]}, - "SG": {"default": "TOGGLE", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE"}, - "SF": {"default": "3POS", "display": [1, 1]}, - "SH": {"default": "TOGGLE", "display": [1, 2]}, - # custom switches - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - }, - "commando8": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]} - }, - "el18": { - "SA": { "default": "2POS" }, - "SB": { "default": "3POS" }, - "SC": { "default": "3POS" }, - "SD": { "default": "2POS" }, - "SE": { "default": "2POS" }, - "SF": { "default": "3POS" }, - "SG": { "default": "3POS" }, - "SH": { "default": "TOGGLE" } - }, - "pl18": { - "SA": { "default": "2POS" }, - "SB": { "default": "3POS" }, - "SC": { "default": "2POS" }, - "SD": { "default": "3POS" }, - "SE": { "default": "3POS" }, - "SF": { "default": "2POS" }, - "SG": { "default": "3POS" }, - "SH": { "default": "TOGGLE" } - }, - "pl18ev": { - "SA": { "default": "2POS" }, - "SB": { "default": "3POS" }, - "SC": { "default": "2POS" }, - "SD": { "default": "3POS" }, - "SE": { "default": "3POS" }, - "SF": { "default": "2POS" }, - "SG": { "default": "3POS" }, - "SH": { "default": "3POS" }, - "SI": { "default": "3POS" }, - "SJ": { "default": "3POS" } - }, - "pl18u": { - "SA": { "default": "3POS" }, - "SB": { "default": "3POS" }, - "SC": { "default": "3POS" }, - "SD": { "default": "3POS" }, - "SE": { "default": "3POS" }, - "SF": { "default": "3POS" }, - "SG": { "default": "3POS" }, - "SH": { "default": "TOGGLE" } - }, - "nb4p": { - "SA" : { "default": "TOGGLE" }, - "SB" : { "default": "TOGGLE" } - }, - "st16": { - "SA": { "default": "2POS" }, - "SB": { "default": "3POS" }, - "SC": { "default": "3POS" }, - "SD": { "default": "2POS" }, - "SE": { "default": "2POS" }, - "SF": { "default": "2POS" }, - "SG": { "default": "TOGGLE" }, - "SH": { "default": "TOGGLE" }, - "SI": { "default": "TOGGLE" }, - "SJ": { "default": "TOGGLE" }, - # custom switches - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - "SO": {"default": "2POS"}, - "SP": {"default": "2POS"}, - }, - "pa01": { - "SA": { "default": "2POS" }, - "SB": { "default": "3POS" }, - "SC": { "default": "3POS" }, - "SD": { "default": "TOGGLE" }, - "SE": { "default": "TOGGLE" }, - "SF": { "default": "TOGGLE" }, - # custom switches - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - }, - "lr3pro": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]} - }, - "nv14": { - "SA": {"default": "2POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "TOGGLE"}, - "SD": {"default": "2POS"}, - "SE": {"default": "TOGGLE"}, - "SF": {"default": "3POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "v12": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SF": {"default": "TOGGLE", "display": [1, 2]}, - }, - "v14": { - # left side - "SA": {"default": "TOGGLE", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "TOGGLE", "display": [1, 2]}, - }, - "v16": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "mt12": { - # left side - "SA": { "default": "3POS", "display": [ 0, 0 ] }, - "SB": { "default": "TOGGLE", "display": [ 0, 1 ] }, - # right side - "SC": { "default": "TOGGLE", "display": [ 1, 0 ] }, - "SD": { "default": "TOGGLE", "display": [ 1, 1 ] }, - }, - "t8": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]} - }, - "t12": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SG": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SH": {"default": "2POS", "display": [1, 2]} - }, - "t12max": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]} - }, - "t14": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SF": {"default": "TOGGLE", "display": [1, 2]} - }, - "t15": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "2POS"}, - "SF": {"default": "2POS"}, - # custom switches - "SG": {"default": "2POS"}, - "SH": {"default": "2POS"}, - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - }, - "t16": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "t18": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "tlite": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "2POS", "display": [0, 1]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]} - }, - "tlitef4": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "2POS", "display": [0, 1]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]} - }, - "tpro": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "TOGGLE", "display": [0, 1]}, - "SE": {"default": "NONE", "display": [0, 2]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "NONE", "display": [1, 2]}, - # custom switches - "SG": {"default": "2POS"}, - "SH": {"default": "2POS"}, - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - }, - "tprov2": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "TOGGLE", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - "SG": {"default": "NONE", "display": [0, 3]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]}, - "SH": {"default": "NONE", "display": [1, 3]}, - # custom switches - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - }, - "tpros": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "TOGGLE", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]}, - }, - "bumblebee": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "TOGGLE", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - "SG": {"default": "TOGGLE", "display": [0, 3]}, - # right side - "SB": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]}, - # custom switches - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SO": {"default": "2POS"}, - "SP": {"default": "2POS"}, - }, - "t20": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - "SG": {"default": "TOGGLE", "display": [0, 3]}, - "SI": {"default": "TOGGLE", "display": [0, 4]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]}, - "SJ": {"default": "TOGGLE", "display": [1, 4]}, - # custom switches - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - "SO": {"default": "2POS"}, - "SP": {"default": "2POS"}, - }, - "t20v2": { - # left side - "SA": {"default": "2POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - "SG": {"default": "TOGGLE", "display": [0, 3]}, - "SI": {"default": "TOGGLE", "display": [0, 4]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]}, - "SJ": {"default": "TOGGLE", "display": [1, 4]}, - # custom switches - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - "SO": {"default": "2POS"}, - "SP": {"default": "2POS"}, - }, - "tx12": { - # left side - "SA": {"default": "TOGGLE", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "3POS", "display": [0, 2]}, - "SG": {"default": "NONE", "display": [0, 3]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "3POS", "display": [1, 2]}, - "SH": {"default": "NONE", "display": [1, 3]} - }, - "t15pro": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "2POS"}, - "SF": {"default": "2POS"}, - # custom switches - "SG": {"default": "2POS"}, - "SH": {"default": "2POS"}, - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - }, - "tx15": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "2POS"}, - "SF": {"default": "TOGGLE"}, - # custom switches - "SG": {"default": "2POS"}, - "SH": {"default": "2POS"}, - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"}, - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - }, - "tx16s": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "tx16smk3": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "2POS"}, - #optional - "SI": {"default": "NONE"}, - "SJ": {"default": "NONE"}, - # custom switches - "SK": {"default": "2POS"}, - "SL": {"default": "2POS"}, - "SM": {"default": "2POS"}, - "SN": {"default": "2POS"}, - "SO": {"default": "2POS"}, - "SP": {"default": "2POS"}, - }, - "f16": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "tx12mk2": { - # left side - "SA": {"default": "TOGGLE", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "3POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "3POS", "display": [1, 2]}, - }, - "x7": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SF": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SH": {"default": "TOGGLE", "display": [1, 2]}, - # optional - "SI": {"default": "NONE", "display": [0, 3]}, - "SJ": {"default": "NONE", "display": [0, 3]}, - }, - "x7access": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SF": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SH": {"default": "TOGGLE", "display": [1, 2]}, - # optional - "SI": {"default": "NONE", "display": [0, 3]}, - "SJ": {"default": "NONE", "display": [0, 3]}, - }, - "x9d": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "3POS", "display": [0, 2]}, - "SF": {"default": "2POS", "display": [0, 3]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SG": {"default": "3POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]} - }, - "x9d+": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "3POS", "display": [0, 2]}, - "SF": {"default": "2POS", "display": [0, 3]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SG": {"default": "3POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]} - }, - "x9d+2019": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "3POS", "display": [0, 2]}, - "SF": {"default": "2POS", "display": [0, 3]}, - "SI": {"default": "TOGGLE", "display": [0, 4]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SG": {"default": "3POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]} - }, - "x9e": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "3POS", "display": [0, 2]}, - "SF": {"default": "2POS", "display": [0, 3]}, - # extra - "SI": {"default": "NONE", "display": [0, 4]}, - "SK": {"default": "NONE", "display": [0, 5]}, - "SM": {"default": "NONE", "display": [0, 6]}, - "SO": {"default": "NONE", "display": [0, 7]}, - "SQ": {"default": "NONE", "display": [0, 8]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "3POS", "display": [1, 1]}, - "SH": {"default": "3POS", "display": [1, 2]}, - "SG": {"default": "TOGGLE", "display": [1, 3]}, - # extra - "SJ": {"default": "NONE", "display": [1, 4]}, - "SL": {"default": "NONE", "display": [1, 5]}, - "SN": {"default": "NONE", "display": [1, 6]}, - "SP": {"default": "NONE", "display": [1, 7]}, - "SR": {"default": "NONE", "display": [1, 8]} - }, - "xlite": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]} - }, - "xlites": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SC": {"default": "3POS", "display": [0, 1]}, - "SE": {"default": "TOGGLE", "display": [0, 2]}, - # right side - "SB": {"default": "2POS", "display": [1, 0]}, - "SD": {"default": "2POS", "display": [1, 1]}, - "SF": {"default": "TOGGLE", "display": [1, 2]} - }, - "x9lite": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SD": {"default": "2POS", "display": [0, 2]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SE": {"default": "TOGGLE", "display": [1, 1]} - }, - "x9lites": { - # left side - "SA": {"default": "3POS", "display": [0, 0]}, - "SB": {"default": "3POS", "display": [0, 1]}, - "SD": {"default": "2POS", "display": [0, 2]}, - "SF": {"default": "TOGGLE", "display": [0, 3]}, - # right side - "SC": {"default": "3POS", "display": [1, 1]}, - "SE": {"default": "TOGGLE", "display": [1, 2]}, - "SG": {"default": "TOGGLE", "display": [1, 3]} - }, - "x10": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"}, - "SI": {"default": "NONE"}, - "SJ": {"default": "NONE"} - }, - "x12s": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"}, - "SI": {"default": "NONE"}, - "SJ": {"default": "NONE"} - }, - "x10express": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "2POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "TOGGLE"} - }, - "zorro": { - # left side - "SB": {"default": "3POS", "display": [0, 0]}, - "SA": {"default": "TOGGLE", "display": [0, 1]}, - "SE": {"default": "2POS", "display": [0, 2]}, - "SG": {"default": "TOGGLE", "display": [0, 3]}, - # right side - "SC": {"default": "3POS", "display": [1, 0]}, - "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "2POS", "display": [1, 2]}, - "SH": {"default": "TOGGLE", "display": [1, 3]}, - }, - "pocket": { - # left side - "SA": { "default": "2POS", "display": [ 0, 0 ] }, - "SB": { "default": "3POS", "display": [ 0, 1 ] }, - "SE": { "default": "TOGGLE", "display": [ 0, 2 ] }, - # right side - "SD": { "default": "2POS", "display": [ 1, 0 ] }, - "SC": { "default": "3POS", "display": [ 1, 1 ] }, - }, - "dro1": { - "SA": {"default": "3POS"}, - "SB": {"default": "3POS"}, - "SC": {"default": "3POS"}, - "SD": {"default": "3POS"}, - "SE": {"default": "3POS"}, - "SF": {"default": "3POS"}, - "SG": {"default": "3POS"}, - "SH": {"default": "3POS"}, - "SI": {"default": "2POS"}, - "SJ": {"default": "2POS"} - }, -} - - -def switch_cfg_by_target(target, name): - """Retrieve default switches config. - - Parameters - ---------- - target: str - Name of the target - name: str - Canonical switch name (Sx where 'x' is a capital letter) - - Returns - ------- - dict - a dictionary with one key for each pot or slider that mapped - to another dictionary with a "default" attribute containing - the default switches configuration. On 'stdlcd' targets, a - 'display' 2 dimensional array defining the switch's position - on screen. - """ - sw = SWITCH_CONFIG.get(target) - if sw: - return sw.get(name) - - return None diff --git a/tools/build-common.sh b/tools/build-common.sh index d2248b16615..aa2c58931bd 100644 --- a/tools/build-common.sh +++ b/tools/build-common.sh @@ -44,9 +44,6 @@ get_target_build_options() { tlite) BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=TLITE" ;; - tlitef4) - BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=TLITEF4" - ;; tpro) BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=TPRO" ;; diff --git a/tools/build-jumper.py b/tools/build-jumper.py index fa6c0bd05bd..9801b8e055b 100755 --- a/tools/build-jumper.py +++ b/tools/build-jumper.py @@ -14,11 +14,6 @@ "PCBREV": "TLITE", "DEFAULT_MODE": "2", }, - "TLITEF4": { - "PCB": "X7", - "PCBREV": "TLITEF4", - "DEFAULT_MODE": "2", - }, "TPRO": { "PCB": "X7", "PCBREV": "TPRO", diff --git a/tools/define_remover.py b/tools/define_remover.py new file mode 100644 index 00000000000..1ffd0c4fe09 --- /dev/null +++ b/tools/define_remover.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 +""" +Program to remove #define statements from C/C++ files based on a list of names. +""" + +import re +import argparse +import sys +from pathlib import Path + +def load_names_to_remove(names_file): + """Load the list of names to remove from the specified file.""" + try: + with open(names_file, 'r', encoding='utf-8') as f: + names = [line.strip() for line in f if line.strip()] + return set(names) # Use set for faster lookup + except FileNotFoundError: + print(f"Error: Names file '{names_file}' not found.") + sys.exit(1) + except Exception as e: + print(f"Error reading names file: {e}") + sys.exit(1) + +def remove_defines_from_file(file_path, names_to_remove, dry_run=False): + """Remove #define statements from a file based on the names list.""" + try: + with open(file_path, 'r', encoding='utf-8') as f: + lines = f.readlines() + except Exception as e: + print(f"Error reading file '{file_path}': {e}") + return False + + modified_lines = [] + removed_count = 0 + i = 0 + + # Pattern to match #define statements + # Matches: #define NAME or #define NAME value + define_pattern = re.compile(r'^\s*#define\s+(\w+)') + + while i < len(lines): + line = lines[i] + line_num = i + 1 + + match = define_pattern.match(line) + if match: + define_name = match.group(1) + if define_name in names_to_remove: + # Found a #define to remove, collect all continuation lines + lines_to_remove = [] + current_line = line + current_line_num = line_num + + # Keep collecting lines while they end with backslash + while current_line.rstrip().endswith('\\'): + lines_to_remove.append((current_line_num, current_line)) + i += 1 + if i < len(lines): + current_line = lines[i] + current_line_num = i + 1 + else: + break + + # Add the final line (without backslash or last line of file) + lines_to_remove.append((current_line_num, current_line)) + + # Print what we're removing + if not dry_run: + print(f"Removing multi-line #define from {file_path}:") + for ln, l in lines_to_remove: + print(f" Line {ln}: {l.rstrip()}") + else: + print(f"Would remove multi-line #define from {file_path}:") + for ln, l in lines_to_remove: + print(f" Line {ln}: {l.rstrip()}") + + removed_count += 1 + i += 1 # Move to next line after the #define block + continue + + # Line is not a #define to remove, keep it + modified_lines.append(line) + i += 1 + + # Write back to file if not dry run and changes were made + if not dry_run and removed_count > 0: + try: + with open(file_path, 'w', encoding='utf-8') as f: + f.writelines(modified_lines) + print(f"Successfully processed '{file_path}' - removed {removed_count} #define(s)") + except Exception as e: + print(f"Error writing file '{file_path}': {e}") + return False + elif dry_run and removed_count > 0: + print(f"Would process '{file_path}' - {removed_count} #define(s) to remove") + elif removed_count == 0: + print(f"No matching #define statements found in '{file_path}'") + + return True + +def main(): + parser = argparse.ArgumentParser( + description="Remove #define statements from C/C++ files based on a list of names" + ) + parser.add_argument( + "names_file", + help="File containing names to remove (one name per line)" + ) + parser.add_argument( + "source_files", + nargs="+", + help="Source files to process" + ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Show what would be removed without actually modifying files" + ) + + args = parser.parse_args() + + # Load names to remove + names_to_remove = load_names_to_remove(args.names_file) + print(f"Loaded {len(names_to_remove)} names to remove") + + if args.dry_run: + print("DRY RUN MODE - No files will be modified") + + # Process each source file + success_count = 0 + for source_file in args.source_files: + file_path = Path(source_file) + if not file_path.exists(): + print(f"Warning: File '{source_file}' not found, skipping") + continue + + if remove_defines_from_file(file_path, names_to_remove, args.dry_run): + success_count += 1 + + print(f"\nProcessed {success_count} out of {len(args.source_files)} files successfully") + +if __name__ == "__main__": + main() diff --git a/tools/define_usage_checker.py b/tools/define_usage_checker.py new file mode 100644 index 00000000000..002cb76e573 --- /dev/null +++ b/tools/define_usage_checker.py @@ -0,0 +1,196 @@ +#!/usr/bin/env python3 +""" +Program to check if #define names are used anywhere in C++ code files. +Use this to verify that defines are safe to remove. +""" + +import re +import argparse +import sys +from pathlib import Path +from collections import defaultdict + +def load_names_to_check(names_file): + """Load the list of names to check from the specified file.""" + try: + with open(names_file, 'r', encoding='utf-8') as f: + names = [line.strip() for line in f if line.strip()] + return names + except FileNotFoundError: + print(f"Error: Names file '{names_file}' not found.") + sys.exit(1) + except Exception as e: + print(f"Error reading names file: {e}") + sys.exit(1) + +def check_usage_in_file(file_path, names_to_check, exclude_defines=True): + """Check if any of the names are used in the given file.""" + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + content = f.read() + except Exception as e: + print(f"Error reading file '{file_path}': {e}") + return {} + + lines = content.splitlines() + usage_found = defaultdict(list) + + # Pattern to match #define statements (to potentially exclude them) + define_pattern = re.compile(r'^\s*#define\s+(\w+)') + + # Pre-compile regex patterns for better performance + name_patterns = {name: re.compile(r'\b' + re.escape(name) + r'\b') for name in names_to_check} + + for line_num, line in enumerate(lines, 1): + # Skip #define lines if exclude_defines is True + if exclude_defines and define_pattern.match(line): + continue + + # Skip comments (basic comment detection) + # Remove single-line comments + if '//' in line: + line = line.split('//')[0] + + # Skip lines that are mostly comments (basic /* */ detection) + if line.strip().startswith('/*') or line.strip().startswith('*'): + continue + + # Check each name using pre-compiled patterns + for name, pattern in name_patterns.items(): + if pattern.search(line): + usage_found[name].append({ + 'line_num': line_num, + 'line': line.strip(), + 'file': str(file_path) + }) + + return usage_found + +def find_cpp_files(directories, extensions=None): + """Find all C++ files in the given directories.""" + if extensions is None: + extensions = {'.cpp', '.cxx', '.cc', '.c', '.hpp', '.hxx', '.h', '.hh'} + + cpp_files = [] + for directory in directories: + dir_path = Path(directory) + if dir_path.is_file(): + if dir_path.suffix.lower() in extensions: + cpp_files.append(dir_path) + elif dir_path.is_dir(): + for ext in extensions: + cpp_files.extend(dir_path.rglob(f'*{ext}')) + else: + print(f"Warning: '{directory}' is not a valid file or directory") + + return cpp_files + +def main(): + parser = argparse.ArgumentParser( + description="Check if #define names are used anywhere in C++ code" + ) + parser.add_argument( + "names_file", + help="File containing names to check (one name per line)" + ) + parser.add_argument( + "paths", + nargs="+", + help="Files or directories to search (directories are searched recursively)" + ) + parser.add_argument( + "--include-defines", + action="store_true", + help="Include #define statements in the search (default: exclude them)" + ) + parser.add_argument( + "--extensions", + default=".cpp,.cxx,.cc,.c,.hpp,.hxx,.h,.hh", + help="Comma-separated list of file extensions to search (default: .cpp,.cxx,.cc,.c,.hpp,.hxx,.h,.hh)" + ) + parser.add_argument( + "--summary-only", + action="store_true", + help="Show only summary of used/unused names" + ) + + args = parser.parse_args() + + # Parse extensions + extensions = {ext.strip() for ext in args.extensions.split(',') if ext.strip()} + + # Load names to check + names_to_check = load_names_to_check(args.names_file) + print(f"Checking usage of {len(names_to_check)} names") + + # Find C++ files + cpp_files = find_cpp_files(args.paths, extensions) + print(f"Found {len(cpp_files)} C++ files to search") + + if not cpp_files: + print("No C++ files found to search!") + sys.exit(1) + + # Check usage in all files + all_usage = defaultdict(list) + files_processed = 0 + + for cpp_file in cpp_files: + usage = check_usage_in_file(cpp_file, names_to_check, exclude_defines=not args.include_defines) + files_processed += 1 + + for name, occurrences in usage.items(): + all_usage[name].extend(occurrences) + + # Progress indicator for large codebases + if files_processed % 100 == 0: + print(f"Processed {files_processed} files...") + + # Analyze results + used_names = set() + unused_names = set() + + for name in names_to_check: + if name in all_usage: + used_names.add(name) + else: + unused_names.add(name) + + # Display results + print(f"\n{'='*60}") + print("USAGE ANALYSIS RESULTS") + print(f"{'='*60}") + + if used_names: + print(f"\n❌ USED NAMES ({len(used_names)}) - DO NOT REMOVE:") + for name in sorted(used_names): + print(f" • {name}") + if not args.summary_only: + print(f" Used in {len(set(occ['file'] for occ in all_usage[name]))} file(s):") + for occurrence in all_usage[name][:5]: # Show first 5 occurrences + print(f" {occurrence['file']}:{occurrence['line_num']}: {occurrence['line']}") + if len(all_usage[name]) > 5: + print(f" ... and {len(all_usage[name]) - 5} more occurrences") + print() + + if unused_names: + print(f"\n✅ UNUSED NAMES ({len(unused_names)}) - SAFE TO REMOVE:") + for name in sorted(unused_names): + print(f" • {name}") + + # Summary + print(f"\n{'='*60}") + print("SUMMARY:") + print(f" Total names checked: {len(names_to_check)}") + print(f" Names in use: {len(used_names)}") + print(f" Names unused: {len(unused_names)}") + print(f" Files searched: {files_processed}") + + if used_names: + print(f"\n⚠️ WARNING: {len(used_names)} names are still in use!") + print(" Review the usage before removing these #define statements.") + else: + print(f"\n✅ All {len(names_to_check)} names appear to be unused and safe to remove.") + +if __name__ == "__main__": + main() diff --git a/tools/generate-hw-defs.sh b/tools/generate-hw-defs.sh index 2ca50488c11..7e4d78f0253 100755 --- a/tools/generate-hw-defs.sh +++ b/tools/generate-hw-defs.sh @@ -9,7 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" : "${SRCDIR:=$(dirname "$(pwd)/$0")/..}" -: ${FLAVOR:="nv14;el18;pl18;pl18ev;nb4p;st16;t12;t12max;t15;t15pro;t16;t18;t8;zorro;pocket;commando8;tlite;tpro;tprov2;tpros;bumblebee;t20;t20v2;t14;lr3pro;mt12;gx12;tx12;tx12mk2;boxer;tx16s;tx16smk3;x10;x10express;x12s;x7;x7access;x9d;x9dp;x9dp2019;x9e;x9lite;x9lites;xlite;xlites;f16;v14;v12;tx15;dro1"} +: ${FLAVOR:="nv14;el18;pl18;pl18ev;pl18u;nb4p;st16;pa01;t12;t12max;t15;t15pro;t16;t18;t8;zorro;pocket;commando8;tlite;tpro;tprov2;tpros;bumblebee;t20;t20v2;t14;lr3pro;mt12;gx12;tx12;tx12mk2;boxer;tx16s;tx16smk3;x10;x10express;x12s;x7;x7access;x9d;x9dp;x9dp2019;x9e;x9lite;x9lites;xlite;xlites;f16;v16;v14;v12;tx15;dro1"} : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_RULE_MESSAGES=OFF -Wno-dev -DCMAKE_MESSAGE_LOG_LEVEL=WARNING"} # wipe build directory clean @@ -17,8 +17,6 @@ rm -rf build && mkdir -p build && cd build target_names=$(echo "$FLAVOR" | tr '[:upper:]' '[:lower:]' | tr ';' '\n') -TARGET_DIR="${SRCDIR}/radio/src/targets/hw_defs" - for target_name in $target_names do BUILD_OPTIONS=${COMMON_OPTIONS} @@ -35,8 +33,5 @@ do cmake --build . --target arm-none-eabi-configure cmake --build arm-none-eabi --target hardware_defs - mkdir -p ${TARGET_DIR} - mv arm-none-eabi/radio/src/*.json* ${TARGET_DIR} - rm -f CMakeCache.txt arm-none-eabi/CMakeCache.txt done From b33b9ae1029979b1c7afef787111f71ed5328f3f Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Fri, 20 Mar 2026 22:11:53 +0800 Subject: [PATCH 12/22] fix(color) : Resolved the crash issue with non-English language firmware. --- radio/src/boards/hw_defs/dro1.json | 1 - radio/src/gui/colorlcd/fonts.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/radio/src/boards/hw_defs/dro1.json b/radio/src/boards/hw_defs/dro1.json index 4a971a38210..a8a6424976a 100644 --- a/radio/src/boards/hw_defs/dro1.json +++ b/radio/src/boards/hw_defs/dro1.json @@ -118,7 +118,6 @@ "gpio": "GPIOF", "pin": "LL_GPIO_PIN_8", "channel": "LL_ADC_CHANNEL_6", - "inverted": true, "label": "EXT1", "short_label": "E1", "default": "SLIDER" diff --git a/radio/src/gui/colorlcd/fonts.cpp b/radio/src/gui/colorlcd/fonts.cpp index 8814527b276..f95a1e275ed 100644 --- a/radio/src/gui/colorlcd/fonts.cpp +++ b/radio/src/gui/colorlcd/fonts.cpp @@ -113,6 +113,7 @@ static etxLvglFont en_fontTable[FONTS_COUNT] = { { &lv_font_en_L, nullptr, false }, /* FONT_L_INDEX */ { &lv_font_en_bold_XL, nullptr, false }, /* FONT_XL_INDEX */ { nullptr, nullptr, true }, /* FONT_XXL_INDEX */ + { nullptr, nullptr, true }, /* FONT_LXL_INDEX */ }; #endif @@ -340,6 +341,12 @@ void decompressFont(int idx, etxLvglFont* fonts) const etxLz4Font* etxFont = fonts[idx].lz4Font; + /** + * FIX : If 'etxFont' does not exist, decompression is not required!!! + * NOTE : This situation will only occur after 'ENABLE_FALLBACK' has been defined!!! + */ + if ( etxFont == nullptr ) return; + // Init SDRAM buffer initFontBuffers(); uint8_t* data = (uint8_t*)fonts[idx].lvglFont; From e4086ea83f9170e2766f0d2035466bd96f252a67 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 20 Jul 2026 03:19:54 +0800 Subject: [PATCH 13/22] fix(DRO1) : Fix the missing items in the 'dro1.json' file. --- radio/src/boards/hw_defs/dro1.json | 75 +++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/radio/src/boards/hw_defs/dro1.json b/radio/src/boards/hw_defs/dro1.json index a8a6424976a..6930e668333 100644 --- a/radio/src/boards/hw_defs/dro1.json +++ b/radio/src/boards/hw_defs/dro1.json @@ -447,27 +447,68 @@ } ], "display": { - "w": 480, - "h": 272, - "phys_w": 480, - "phys_h": 272, - "depth": 16, - "color": 1, - "oled": 0, - "backlight_color": 0 + "lcd_w": 480, + "lcd_h": 272, + "lcd_phys_w": 480, + "lcd_phys_h": 272, + "lcd_depth": 16, + "lcd_vertical_invert": true, + "ltdc_irq_prio": 4, + "dma_screen_irq_prio": 6 }, - "custom_switches": { - "rgb_led": 0, - "groups": 0 + "leds": { + "led_strip_length": 36, + "bling_led_strip_start": 6, + "bling_led_strip_length": 30, + "led_strip_gpio": "GPIO_PIN(GPIOA, 5)", + "led_strip_gpio_af": "LL_GPIO_AF_1", + "led_strip_timer": "TIM2", + "led_strip_timer_freq": "(PERI1_FREQUENCY * TIMER_MULT_APB1)", + "led_strip_timer_channel": "LL_TIM_CHANNEL_CH1", + "led_strip_timer_dma": "DMA1", + "led_strip_timer_dma_channel": "LL_DMA_CHANNEL_3", + "led_strip_timer_dma_stream": "LL_DMA_STREAM_7", + "led_strip_timer_dma_irqn": "DMA1_Stream7_IRQn", + "led_strip_timer_dma_irqhandler": "DMA1_Stream7_IRQHandler", + "led_strip_refresh_period": 50, + "status_leds": true, + "led_red_gpio": "GPIO_PIN(GPIOE, 2)", + "led_green_gpio": "GPIO_PIN(GPIOE, 4)", + "led_blue_gpio": "GPIO_PIN(GPIOE, 5)" }, "hardware": { - "has_audio_mute": 1, - "has_bling_leds": 30, - "has_ext_module_support": 1, - "has_int_module_support": 0, + "has_audio_mute": true, + "has_ext_module_support": true, + "has_int_module_support": false, "sport_max_baudrate": 400000, - "surface": 0, "cpu": "STM32F429xI", "cpu_type": "STM32F4" - } + }, + "timers": { + "cpu_freq": 168000000, + "peri1_frequency": 42000000, + "peri2_frequency": 84000000, + "timer_mult_apb1": 2, + "timer_mult_apb2": 2, + "ms_timer": "TIM14", + "ms_timer_irqn": "TIM8_TRG_COM_TIM14_IRQn", + "ms_timer_irqhandler": "TIM8_TRG_COM_TIM14_IRQHandler", + "mixer_scheduler_timer": "TIM13", + "mixer_scheduler_timer_freq": "(PERI1_FREQUENCY * TIMER_MULT_APB1)", + "mixer_scheduler_timer_irqn": "TIM8_UP_TIM13_IRQn", + "mixer_scheduler_timer_irqhandler": "TIM8_UP_TIM13_IRQHandler" + }, + "haptic": { + "haptic_pwm": true, + "haptic_gpio": "GPIO_PIN(GPIOE, 6)", + "haptic_gpio_timer": "TIM9", + "haptic_gpio_af": "GPIO_AF3", + "haptic_timer_output_enable": "TIM_CCER_CC2E", + "haptic_timer_mode": "TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2M_2", + "haptic_timer_compare_value": "HAPTIC_GPIO_TIMER->CCR2" + }, + "key_lock_combo": [ + "KEY_SYS", + "KEY_MODEL" + ] } From d8618d98d7b5cb6ceb0f2254e8d6c079f8d3dcc2 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 27 Jul 2026 13:27:16 +0800 Subject: [PATCH 14/22] fix(DRO1) : Fix the configuration errors in the 'dro1.json' file. --- radio/src/boards/hw_defs/dro1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/boards/hw_defs/dro1.json b/radio/src/boards/hw_defs/dro1.json index 6930e668333..69014ff41a0 100644 --- a/radio/src/boards/hw_defs/dro1.json +++ b/radio/src/boards/hw_defs/dro1.json @@ -452,7 +452,7 @@ "lcd_phys_w": 480, "lcd_phys_h": 272, "lcd_depth": 16, - "lcd_vertical_invert": true, + "lcd_vertical_invert": false, "ltdc_irq_prio": 4, "dma_screen_irq_prio": 6 }, From 24bd48c209c248070d14668cd936b6f4060a56fe Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 10 Aug 2026 00:53:59 +0800 Subject: [PATCH 15/22] feat : Add DumboRC expansion channel module. --- radio/src/boards/generic_stm32/switches.cpp | 1 + radio/src/boards/hw_defs/dro1.json | 143 +++++ radio/src/dataconstants.h | 2 +- radio/src/datastructs.h | 4 +- radio/src/drivers/dumborc_extchannel.cpp | 675 ++++++++++++++++++++ radio/src/drivers/dumborc_extchannel.h | 141 ++++ radio/src/targets/horus/CMakeLists.txt | 2 + 7 files changed, 965 insertions(+), 3 deletions(-) create mode 100644 radio/src/drivers/dumborc_extchannel.cpp create mode 100644 radio/src/drivers/dumborc_extchannel.h diff --git a/radio/src/boards/generic_stm32/switches.cpp b/radio/src/boards/generic_stm32/switches.cpp index c748ba99efe..b0ba9024f34 100644 --- a/radio/src/boards/generic_stm32/switches.cpp +++ b/radio/src/boards/generic_stm32/switches.cpp @@ -25,6 +25,7 @@ #include "drivers/pca95xx.h" #include "drivers/aw9523b.h" +#include "drivers/dumborc_extchannel.h" #include "definitions.h" #include "myeeprom.h" diff --git a/radio/src/boards/hw_defs/dro1.json b/radio/src/boards/hw_defs/dro1.json index 69014ff41a0..3cfe009593d 100644 --- a/radio/src/boards/hw_defs/dro1.json +++ b/radio/src/boards/hw_defs/dro1.json @@ -300,6 +300,149 @@ "gpio": "GPIOH", "pin": "LL_GPIO_PIN_15", "is_cfs": false + }, + { + "name": "SEA", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_1", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_0", + "is_cfs": false + }, + { + "name": "SEB", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_3", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_2", + "is_cfs": false + }, + { + "name": "SEC", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_5", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_4", + "is_cfs": false + }, + { + "name": "SED", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_7", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_6", + "is_cfs": false + }, + { + "name": "SEE", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_9", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_8", + "is_cfs": false + }, + { + "name": "SEF", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_26", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_10", + "is_cfs": false + }, + { + "name": "SEG", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_16", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_17", + "is_cfs": false + }, + { + "name": "SEH", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_18", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_19", + "is_cfs": false + }, + { + "name": "SEI", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_20", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_21", + "is_cfs": false + }, + { + "name": "SEJ", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_22", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_23", + "is_cfs": false + }, + { + "name": "SEK", + "type": "3POS", + "flags": 0, + "inverted": false, + "default": "3POS", + "display": null, + "gpio_high": null, + "pin_high": "DUMBORC_EXTCHANNEL_PIN_24", + "gpio_low": null, + "pin_low": "DUMBORC_EXTCHANNEL_PIN_25", + "is_cfs": false } ], "keys": [ diff --git a/radio/src/dataconstants.h b/radio/src/dataconstants.h index 9b6681a9223..d9181b3b2f9 100644 --- a/radio/src/dataconstants.h +++ b/radio/src/dataconstants.h @@ -408,7 +408,7 @@ enum PotsWarnMode { #define MAX_ANALOG_INPUTS (MAX_STICKS + MAX_POTS + MAX_VBAT + MAX_RTC_BAT) #define MAX_CALIB_ANALOG_INPUTS (MAX_STICKS + MAX_POTS) -#define MAX_SWITCHES 20 +#define MAX_SWITCHES 21 #if !defined(MAX_FLEX_SWITCHES) #define MAX_FLEX_SWITCHES 0 diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index b0942a59d4b..e29cfd89200 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -82,9 +82,9 @@ static inline void check_struct() CHKSIZE(RadioData, 1183); #elif defined(COLORLCD) #if defined(IMU) - CHKSIZE(RadioData, 1063); + CHKSIZE(RadioData, 1063+4); #else - CHKSIZE(RadioData, 1062); + CHKSIZE(RadioData, 1062+4); #endif #elif defined(RADIO_GX12) CHKSIZE(RadioData, 1068); diff --git a/radio/src/drivers/dumborc_extchannel.cpp b/radio/src/drivers/dumborc_extchannel.cpp new file mode 100644 index 00000000000..249a4aa9a31 --- /dev/null +++ b/radio/src/drivers/dumborc_extchannel.cpp @@ -0,0 +1,675 @@ +/* + * Copyright (C) EdgeTx + * + * Authors: + * FreedomLJS + * + * 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 "dumborc_extchannel.h" + + + +#if ( DUMBORC_EXTCHANNEL_ENABLED ) + +#include +#include + +#include "hal.h" +#include "hal/gpio.h" +#include "stm32_gpio.h" +#include "stm32_switch_driver.h" + +#if ( CPU_TYPE == STM32F2 ) +#include "core_cm3.h" +#elif ( CPU_TYPE == STM32F4 ) +#include "core_cm4.h" +#else +#include "core_cm7.h" +#endif + +#include "os/time.h" +#include "os/task.h" +#include "os/sleep.h" +#include "tasks.h" + + + +/*** ###### ###### ###### >>>>>> LJS : INNER <<<<<< ###### ###### ###### ***/ + +#define DUMBORC_EXTCHANNEL_COUNT_OF(__TARGET__) \ + (sizeof(__TARGET__) / sizeof((__TARGET__)[0])) + + +#define DUMBORC_EXTCHANNEL_TIMER_INIT() \ + do { \ + if ( (((CoreDebug->DEMCR) & CoreDebug_DEMCR_TRCENA_Msk) == 0) && \ + (((DWT->CTRL) & DWT_CTRL_CYCCNTENA_Msk) == 0) ) { \ + (CoreDebug->DEMCR) |= CoreDebug_DEMCR_TRCENA_Msk; \ + (DWT->CYCCNT) = 0UL; \ + (DWT->CTRL) |= DWT_CTRL_CYCCNTENA_Msk; \ + } \ + } while ( 0 ) + +#define DUMBORC_EXTCHANNEL_TIMER_UNINIT() \ + do { \ + if ( (((CoreDebug->DEMCR) & CoreDebug_DEMCR_TRCENA_Msk) != 0) && \ + (((DWT->CTRL) & DWT_CTRL_CYCCNTENA_Msk) != 0) ) { \ + (DWT->CTRL) &= (~DWT_CTRL_CYCCNTENA_Msk); \ + (DWT->CYCCNT) = 0UL; \ + (CoreDebug->DEMCR) &= (~CoreDebug_DEMCR_TRCENA_Msk); \ + } \ + } while ( 0 ) + +#define DUMBORC_EXTCHANNEL_TIMER_GET_TICK() \ + ((uint32_t)(DWT->CYCCNT)) + +#define DUMBORC_EXTCHANNEL_TIMER_US_TO_TICK(__TIME_US__) \ + ((uint32_t)((__TIME_US__) * ((CPU_FREQ) / 1000000UL))) + +#define DUMBORC_EXTCHANNEL_TIMER_TICK_TO_US(__TIME_TICK__) \ + ((uint32_t)((__TIME_TICK__) / ((CPU_FREQ) / 1000000UL))) + + +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SDA GPIO_PIN(GPIOA , 13) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SCL GPIO_PIN(GPIOA , 14) + +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(__GPIO__) \ + gpio_clear(__GPIO__) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(__GPIO__) \ + gpio_set(__GPIO__) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(__GPIO__) \ + gpio_read(__GPIO__) + + +#define DUMBORC_EXTCHANNEL_I2C_ADDR_A (0x27 << 1) +#define DUMBORC_EXTCHANNEL_I2C_ADDR_B (0x26 << 1) + + +#define DUMBORC_EXTCHANNEL_TASK_STACK_SIZE (64) +#define DUMBORC_EXTCHANNEL_TASK_PRIO CLI_TASK_PRIO + + + +static task_handle_t s_dumborc_extchannel_task_id = {0}; +static TASK_DEFINE_STACK(s_dumborc_extchannel_task_stack , \ + DUMBORC_EXTCHANNEL_TASK_STACK_SIZE); + +static uint8_t s_dumborc_extchannel_i2c_req_buf_reg[2][8] = {0}; +static uint32_t s_dumborc_extchannel_i2c_clk_cycle_tick_div3 = 0; +static uint32_t s_dumborc_extchannel_i2c_req_cnt = 0; +static uint32_t s_dumborc_extchannel_i2c_req_pins_status = 0; +static uint32_t s_dumborc_extchannel_task_status = 0; + + + +/* LJS : Software I2C BEGIN >>> */ +#pragma GCC push_options +#pragma GCC optimize("O0") +static void i_dumborc_extchannel_delay_us(uint32_t const time_us) +{ + uint32_t val_tick , val_tick_dt; + + + val_tick = DUMBORC_EXTCHANNEL_TIMER_GET_TICK(); + val_tick_dt = DUMBORC_EXTCHANNEL_TIMER_US_TO_TICK(time_us); + while ( (DUMBORC_EXTCHANNEL_TIMER_GET_TICK() - val_tick) < val_tick_dt ); +} +#pragma GCC pop_options + + +static void i_dumborc_extchannel_i2c_gpio_init(void) +{ + /* LJS : Init Software-I2C SDA & SCL GPIO */ + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA , GPIO_OD_PU , GPIO_PIN_SPEED_MEDIUM); + gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL , GPIO_OD_PU , GPIO_PIN_SPEED_MEDIUM); +} + +static void i_dumborc_extchannel_i2c_gpio_uninit(void) +{ + /* LJS : Uninit Software-I2C SDA & SCL GPIO */ + gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA , GPIO_IN , GPIO_PIN_SPEED_LOW); + gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL , GPIO_IN , GPIO_PIN_SPEED_LOW); +} + +static void i_dumborc_extchannel_i2c_bus_start(void) +{ + /** + * SCL XXXXXX XXXXXX HHHHHH HHHHHH LLLLLL + * SDA XXXXXX HHHHHH HHHHHH LLLLLL LLLLLL + */ + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); +} + +static void i_dumborc_extchannel_i2c_bus_stop(void) +{ + /** + * SCL XXXXXX XXXXXX HHHHHH HHHHHH + * SDA XXXXXX LLLLLL LLLLLL HHHHHH + */ + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); +} + +static uint8_t i_dumborc_extchannel_i2c_bus_read_1byte(void) +{ + uint32_t count , rx_byte; + + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + + count = 8; + rx_byte = 0; + do { + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + + rx_byte <<= 1; + if ( DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA) ) { + rx_byte |= 0x01; + } + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + } while ( --count ); + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + + return (rx_byte & 0xFF); +} + +static void i_dumborc_extchannel_i2c_bus_write_1byte(uint8_t const data) +{ + uint32_t count , tx_byte; + + + count = 8; + tx_byte = data; + do { + if ( tx_byte & 0x80 ) { + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + } else { + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + } + tx_byte <<= 1; + + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + if ( count == 1 ) { + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + } + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + } while ( --count ); +} + +static uint8_t i_dumborc_extchannel_i2c_bus_get_ack(void) +{ + uint32_t count , status; + + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + + count = 10; + do { + status = DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + if ( status == 0 ) { + break; + } + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + } while ( --count ); + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + + return (!!status); +} + +static void i_dumborc_extchannel_i2c_bus_set_ack(uint32_t const status) +{ + if ( status ) { + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + } else { + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + } + + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); +} + +static uint8_t i_dumborc_extchannel_i2c_bus_write_1byte_with_ack(uint8_t const data) +{ + i_dumborc_extchannel_i2c_bus_write_1byte(data); + + return i_dumborc_extchannel_i2c_bus_get_ack(); +} + +static int i_dumborc_extchannel_i2c_bus_read(\ + uint8_t const dev_address , \ + uint8_t const * const p_tx_buffer , \ + uint32_t const tx_length , \ + uint8_t * const p_rx_buffer , \ + uint32_t const rx_length) +{ + int status; + uint32_t i , value; + + + if ( (dev_address & 0x01) || (p_rx_buffer == NULL) || (rx_length == 0) ) { + /* LJS : Input parameter error! (-1) */ + return -1; + } + + /* LJS : READ-PROCESS BEGIN >>> */ + do { + if ( (p_tx_buffer != NULL) && (tx_length != 0) ) { + /* LJS : Need to write data! Bus start! */ + i_dumborc_extchannel_i2c_bus_start(); + status = -2; + + /* LJS : Write device address (write mode , bit0 = 0). */ + if ( i_dumborc_extchannel_i2c_bus_write_1byte_with_ack(dev_address) ) { + /* LJS : Hasn't ack (not exist device) , break it (READ-PROCESS). */ + break; + } + + /* LJS : Write device data. */ + for (i = 0 ; i < tx_length ; ++i) { + if ( i_dumborc_extchannel_i2c_bus_write_1byte_with_ack(p_tx_buffer[i]) ) { + /* LJS : Hasn't ack (wirte error) , break it (write device data). */ + break; + } + } + if ( i != tx_length ) { + /* LJS : Not enough quantity , break it (READ-PROCESS). */ + break; + } + } + + /* LJS : Need to read data! Bus restart! */ + i_dumborc_extchannel_i2c_bus_start(); + status = -3; + + /* LJS : Write device address (read mode , bit0 = 1). */ + if ( i_dumborc_extchannel_i2c_bus_write_1byte_with_ack(dev_address | 0x01) ) { + /* LJS : Hasn't ack (not exist device) , break it (READ-PROCESS). */ + break; + } + + /* LJS : Read device data. */ + value = rx_length - 1; + for (i = 0 ; i < rx_length ; ++i) { + p_rx_buffer[i] = i_dumborc_extchannel_i2c_bus_read_1byte(); + i_dumborc_extchannel_i2c_bus_set_ack(i == value); + } + /* LJS : Process succeed! */ + status = 0; + } while ( 0 ); + + /* LJS : READ-PROCESS END <<< */ + i_dumborc_extchannel_i2c_bus_stop(); + + return status; +} + +static int i_dumborc_extchannel_i2c_bus_write(\ + uint8_t const dev_address , \ + uint8_t const * const p_tx_buffer , \ + uint32_t const tx_length) +{ + int status; + uint32_t i; + + + if ( (dev_address & 0x01) || (p_tx_buffer == NULL) || (tx_length == 0) ) { + /* LJS : Input parameter error! (-1) */ + return -1; + } + + /* LJS : WRITE-PROCESS BEGIN >>> */ + do { + /* LJS : Need to write data! Bus start! */ + i_dumborc_extchannel_i2c_bus_start(); + status = -2; + + /* LJS : Write device address (write mode , bit0 = 0). */ + if ( i_dumborc_extchannel_i2c_bus_write_1byte_with_ack(dev_address) ) { + /* LJS : Hasn't ack (not exist device) , break it (WRITE-PROCESS). */ + break; + } + + /* LJS : Write device data. */ + for (i = 0 ; i < tx_length ; ++i) { + if ( i_dumborc_extchannel_i2c_bus_write_1byte_with_ack(p_tx_buffer[i]) ) { + /* LJS : Hasn't ack (wirte error) , break it (write device data). */ + break; + } + } + if ( i != tx_length ) { + /* LJS : Not enough quantity , break it (WRITE-PROCESS). */ + break; + } + /* LJS : Process succeed! */ + status = 0; + } while ( 0 ); + + /* LJS : WRITE-PROCESS END <<< */ + i_dumborc_extchannel_i2c_bus_stop(); + + return status; +} +/* LJS : Software I2C END <<< */ + + +static void i_dumborc_extchannel_task_cb(void) +{ + static const uint8_t buf_cfg[][3] = {\ + {0x02 , 0xFF , 0xFF} , \ + {0x04 , 0x00 , 0x00} , \ + {0x06 , 0xFF , 0xFF} , \ + }; + int ret; + uint32_t i; + uint8_t reg; + + + for ( ; ; ) { + while ( !s_dumborc_extchannel_task_status ) { + sleep_ms(1); + } + + /* LJS : PROCESS BEGIN >>> */ + if ( s_dumborc_extchannel_i2c_req_cnt <= 0 ) { + /* LJS : First-time use requires initializing the configuration */ + for ( i = 0 , ret = 0 ; \ + i < DUMBORC_EXTCHANNEL_COUNT_OF(buf_cfg) ; \ + ++i ) { + ret |= i_dumborc_extchannel_i2c_bus_write(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_A , \ + buf_cfg[i] , sizeof(buf_cfg[0])); + ret |= i_dumborc_extchannel_i2c_bus_write(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_B , \ + buf_cfg[i] , sizeof(buf_cfg[0])); + } + } + + for ( i = 0 , ret = 0 ; \ + i < (DUMBORC_EXTCHANNEL_COUNT_OF(\ + s_dumborc_extchannel_i2c_req_buf_reg[0]) >> 1) ; \ + ++i ) { + if ( (i >= 1) && \ + ((s_dumborc_extchannel_i2c_req_cnt % 10) != 0) ) { + /* LJS : Execute every 10 times! (Slow refresh 'reg[2:7]') */ + break; + } + reg = (i << 1); + ret |= i_dumborc_extchannel_i2c_bus_read(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_A , \ + ® , sizeof(reg) , \ + &(s_dumborc_extchannel_i2c_req_buf_reg[0][reg]) , 2); + ret |= i_dumborc_extchannel_i2c_bus_read(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_B , \ + ® , sizeof(reg) , \ + &(s_dumborc_extchannel_i2c_req_buf_reg[1][reg]) , 2); + } + s_dumborc_extchannel_i2c_req_pins_status = \ + ( (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[0][0])) << 0) | \ + (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[0][1])) << 8) | \ + (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[1][0])) << 16) | \ + (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[1][1])) << 24) ); + + ++s_dumborc_extchannel_i2c_req_cnt; + /* LJS : PROCESS END <<< */ + + sleep_ms(100); + } +} + + +static void i_dumborc_extchannel_para_reset(void) +{ + memset(s_dumborc_extchannel_i2c_req_buf_reg , 0x00 , \ + sizeof(s_dumborc_extchannel_i2c_req_buf_reg)); + s_dumborc_extchannel_i2c_clk_cycle_tick_div3 = \ + DUMBORC_EXTCHANNEL_TIMER_US_TO_TICK(1); + s_dumborc_extchannel_i2c_req_cnt = 0; + s_dumborc_extchannel_i2c_req_pins_status = 0; + s_dumborc_extchannel_task_status = 0; +} + +/*** ###### ###### ###### >>>>>> ----------- <<<<<< ###### ###### ###### ***/ + + + +/*** ###### ###### ###### >>>>>> LJS : OUTER <<<<<< ###### ###### ###### ***/ + +/** + * [dumborc_extchannel_init (dumborc_extchannel init)] + * @return [error code (int)] + * [0 : succeed ; !0 : failed] + */ +#pragma GCC push_options +#pragma GCC optimize("O0") +int dumborc_extchannel_init(void) +{ + uint32_t val , val_tick; + + + DUMBORC_EXTCHANNEL_TIMER_INIT(); + i_dumborc_extchannel_para_reset(); + i_dumborc_extchannel_i2c_gpio_init(); + + /* LJS : Get timer current tick */ + val_tick = DUMBORC_EXTCHANNEL_TIMER_GET_TICK(); + /** + * LJS : Do __NOP '(2 * ((CPU_FREQ) / 1000000UL))' times, + * Simulate a 2us delay! + */ + for ( val = 0 ; val < (2 * ((CPU_FREQ) / 1000000UL)) ; ++val ) { + __NOP(); + } + /* LJS : Check the change in timer tick */ + if ( DUMBORC_EXTCHANNEL_TIMER_GET_TICK() == val_tick ) { + /* LJS : Timer hasn't started! (-1) */ + return -1; + } + + if ( (s_dumborc_extchannel_task_id._stack_size) <= 0 ) { + task_create(&s_dumborc_extchannel_task_id , \ + i_dumborc_extchannel_task_cb , \ + "DR_EC:P" , \ + s_dumborc_extchannel_task_stack , \ + DUMBORC_EXTCHANNEL_TASK_STACK_SIZE , \ + DUMBORC_EXTCHANNEL_TASK_PRIO); + if ( (s_dumborc_extchannel_task_id._stack_size) <= 0 ) { + /* LJS : Task hasn't create! (-2) */ + return -2; + } + } + + return 0; +} +#pragma GCC pop_options + +/** + * [dumborc_extchannel_uninit (dumborc_extchannel uninit)] + * @return [error code (int)] + * [0 : succeed ; !0 : failed] + */ +int dumborc_extchannel_uninit(void) +{ + i_dumborc_extchannel_i2c_gpio_uninit(); + i_dumborc_extchannel_para_reset(); + DUMBORC_EXTCHANNEL_TIMER_UNINIT(); + + return 0; +} + + +/** + * [dumborc_extchannel_get_task_status (dumborc_extchannel get task status)] + * @return [task status (uint32_t)] + * [0 : stop ; !0 : running] + */ +uint32_t dumborc_extchannel_get_task_status(void) +{ + return s_dumborc_extchannel_task_status; +} + +/** + * [dumborc_extchannel_set_task_status (dumborc_extchannel set task status)] + * @param status [task status (uint32_t)] + * [0 : stop ; !0 : running] + */ +void dumborc_extchannel_set_task_status(uint32_t const status) +{ + s_dumborc_extchannel_task_status = (!!status); +} + + +/** + * [dumborc_extchannel_get_reg_data (dumborc_extchannel get register data)] + * @param idx [IC index (uint32_t)] + * @param reg [IC register (uint32_t)] + * @return [register data (uint32_t)] + */ +uint32_t dumborc_extchannel_get_reg_data(uint32_t const idx , uint32_t const reg) +{ + if ( (s_dumborc_extchannel_i2c_req_cnt <= 0) || \ + (idx >= DUMBORC_EXTCHANNEL_COUNT_OF(\ + s_dumborc_extchannel_i2c_req_buf_reg)) || \ + (reg >= DUMBORC_EXTCHANNEL_COUNT_OF(\ + s_dumborc_extchannel_i2c_req_buf_reg[0])) ) { + /* LJS : Dumborc_extchannel hasn't run, or input parameter error! (0) */ + return 0; + } + + return (s_dumborc_extchannel_i2c_req_buf_reg[idx][reg]); +} + +/** + * [dumborc_extchannel_get_pin_status (dumborc_extchannel get pin status)] + * @param pin_mask [pin mask (uint32_t)] + * @return [pin status (uint32_t)] + */ +uint32_t dumborc_extchannel_get_pin_status(uint32_t const pin_mask) +{ + if ( s_dumborc_extchannel_i2c_req_cnt <= 0 ) { + /* LJS : Dumborc_extchannel hasn't run! (0) */ + return 0; + } + + return (s_dumborc_extchannel_i2c_req_pins_status & pin_mask); +} + + + +#if 1 +/** + * [boardSwitchGetPosition (System board swith get position , Override)] + * @param idx [System board switch index (uint8_t)] + * @return [System board switch position (SwitchHwPos)] + */ +SwitchHwPos boardSwitchGetPosition(uint8_t idx) +{ + extern const stm32_switch_t * boardGetSwitchDef(uint8_t idx); + static uint32_t time_ms_prev = 0; + const stm32_switch_t * sw = boardGetSwitchDef(idx); + SwitchHwPos ret = SWITCH_HW_UP; + uint32_t time_ms_curr , pin_sta_hi , pin_sta_lo; + + + time_ms_curr = time_get_ms(); + if ( ((time_ms_curr - time_ms_prev) >= (1 * 1000)) && \ + (dumborc_extchannel_get_pin_status(0xFFFFFFFF) == 0) ) { + /* LJS : Dumborc_extchannel hasn't init! Reinit! */ + time_ms_prev = time_ms_curr; + dumborc_extchannel_set_task_status(0); + dumborc_extchannel_uninit(); + dumborc_extchannel_init(); + dumborc_extchannel_set_task_status(1); + } + + if ( (sw->type == SWITCH_HW_ADC) || (sw->GPIOx_high != NULL) ) { + /* LJS : Belongs to a system call! */ + return stm32_switch_get_position(sw); + } + + pin_sta_hi = dumborc_extchannel_get_pin_status(sw->Pin_high); + switch ( sw->type ) { + case SWITCH_HW_2POS: { + if ( !pin_sta_hi ) { + ret = SWITCH_HW_DOWN; + } + } break; + + case SWITCH_HW_3POS: { + pin_sta_lo = dumborc_extchannel_get_pin_status(sw->Pin_low); + if ( pin_sta_hi && pin_sta_lo ) { + ret = SWITCH_HW_MID; + } else if ( !pin_sta_hi && pin_sta_lo ) { + ret = SWITCH_HW_DOWN; + } + } break; + + default:{ + } break; + } + + if ( sw->inverted ) { + if ( ret == SWITCH_HW_UP ) { + ret = SWITCH_HW_DOWN; + } else if ( ret == SWITCH_HW_DOWN ) { + ret = SWITCH_HW_UP; + } + } + + return ret; +} +#endif + +/*** ###### ###### ###### >>>>>> ----------- <<<<<< ###### ###### ###### ***/ + +#endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ + + diff --git a/radio/src/drivers/dumborc_extchannel.h b/radio/src/drivers/dumborc_extchannel.h new file mode 100644 index 00000000000..e73d8f8c764 --- /dev/null +++ b/radio/src/drivers/dumborc_extchannel.h @@ -0,0 +1,141 @@ +/* + * Copyright (C) EdgeTx + * + * Authors: + * FreedomLJS + * + * 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 __DUMBORC_EXTCHANNEL_H__ +#define __DUMBORC_EXTCHANNEL_H__ + +#ifdef __cplusplus + extern "C" { +#endif + +#include +#include + + + +#if ( DUMBORC_EXTCHANNEL_ENABLED ) + +#if ( LOG_ENABLED && DUMBORC_EXTCHANNEL_LOG_ENABLED ) +# include "debug.h" +# define DUMBORC_EXTCHANNEL_LOG_INFO(...) TRACE(__VA_ARGS__) +#else +# define DUMBORC_EXTCHANNEL_LOG_INFO(...) +#endif /* ( LOG_ENABLED && DUMBORC_EXTCHANNEL_LOG_ENABLED ) */ + + + +/* LJS : Dumborc extchannel PIN_[0:31] define. */ +#define DUMBORC_EXTCHANNEL_PIN_0 (1UL << 0U) +#define DUMBORC_EXTCHANNEL_PIN_1 (1UL << 1U) +#define DUMBORC_EXTCHANNEL_PIN_2 (1UL << 2U) +#define DUMBORC_EXTCHANNEL_PIN_3 (1UL << 3U) +#define DUMBORC_EXTCHANNEL_PIN_4 (1UL << 4U) +#define DUMBORC_EXTCHANNEL_PIN_5 (1UL << 5U) +#define DUMBORC_EXTCHANNEL_PIN_6 (1UL << 6U) +#define DUMBORC_EXTCHANNEL_PIN_7 (1UL << 7U) +#define DUMBORC_EXTCHANNEL_PIN_8 (1UL << 8U) +#define DUMBORC_EXTCHANNEL_PIN_9 (1UL << 9U) +#define DUMBORC_EXTCHANNEL_PIN_10 (1UL << 10U) +#define DUMBORC_EXTCHANNEL_PIN_11 (1UL << 11U) +#define DUMBORC_EXTCHANNEL_PIN_12 (1UL << 12U) +#define DUMBORC_EXTCHANNEL_PIN_13 (1UL << 13U) +#define DUMBORC_EXTCHANNEL_PIN_14 (1UL << 14U) +#define DUMBORC_EXTCHANNEL_PIN_15 (1UL << 15U) +#define DUMBORC_EXTCHANNEL_PIN_16 (1UL << 16U) +#define DUMBORC_EXTCHANNEL_PIN_17 (1UL << 17U) +#define DUMBORC_EXTCHANNEL_PIN_18 (1UL << 18U) +#define DUMBORC_EXTCHANNEL_PIN_19 (1UL << 19U) +#define DUMBORC_EXTCHANNEL_PIN_20 (1UL << 20U) +#define DUMBORC_EXTCHANNEL_PIN_21 (1UL << 21U) +#define DUMBORC_EXTCHANNEL_PIN_22 (1UL << 22U) +#define DUMBORC_EXTCHANNEL_PIN_23 (1UL << 23U) +#define DUMBORC_EXTCHANNEL_PIN_24 (1UL << 24U) +#define DUMBORC_EXTCHANNEL_PIN_25 (1UL << 25U) +#define DUMBORC_EXTCHANNEL_PIN_26 (1UL << 26U) +#define DUMBORC_EXTCHANNEL_PIN_27 (1UL << 27U) +#define DUMBORC_EXTCHANNEL_PIN_28 (1UL << 28U) +#define DUMBORC_EXTCHANNEL_PIN_29 (1UL << 29U) +#define DUMBORC_EXTCHANNEL_PIN_30 (1UL << 30U) +#define DUMBORC_EXTCHANNEL_PIN_31 (1UL << 31U) + + + +/** + * [dumborc_extchannel_init (dumborc_extchannel init)] + * @return [error code (int)] + * [0 : succeed ; !0 : failed] + */ +int dumborc_extchannel_init(void); + +/** + * [dumborc_extchannel_uninit (dumborc_extchannel uninit)] + * @return [error code (int)] + * [0 : succeed ; !0 : failed] + */ +int dumborc_extchannel_uninit(void); + + +/** + * [dumborc_extchannel_get_task_status (dumborc_extchannel get task status)] + * @return [task status (uint32_t)] + * [0 : stop ; !0 : running] + */ +uint32_t dumborc_extchannel_get_task_status(void); + +/** + * [dumborc_extchannel_set_task_status (dumborc_extchannel set task status)] + * @param status [task status (uint32_t)] + * [0 : stop ; !0 : running] + */ +void dumborc_extchannel_set_task_status(uint32_t const status); + + +/** + * [dumborc_extchannel_get_reg_data (dumborc_extchannel get register data)] + * @param idx [IC index (uint32_t)] + * @param reg [IC register (uint32_t)] + * @return [register data (uint32_t)] + */ +uint32_t dumborc_extchannel_get_reg_data(uint32_t const idx , uint32_t const reg); + +/** + * [dumborc_extchannel_get_pin_status (dumborc_extchannel get pin status)] + * @param pin_mask [pin mask (uint32_t)] + * @return [pin status (uint32_t)] + */ +uint32_t dumborc_extchannel_get_pin_status(uint32_t const pin_mask); + + + +#endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ + + + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index 7677366b8b3..1cc3b6d94c4 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -147,6 +147,7 @@ if (PCB STREQUAL X10) if (NOT BLUETOOTH) set(AUX2_SERIAL ON) endif() + add_definitions(-DDUMBORC_EXTCHANNEL_ENABLED) set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS") set(FLYSKY_GIMBAL OFF) set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches") @@ -307,6 +308,7 @@ add_library(board OBJECT EXCLUDE_FROM_ALL drivers/lsm6ds.cpp drivers/icm42627.cpp drivers/sc7u22.cpp + drivers/dumborc_extchannel.cpp targets/common/arm/stm32/mixer_scheduler_driver.cpp targets/common/arm/stm32/module_timer_driver.cpp targets/common/arm/stm32/sticks_pwm_driver.cpp From 3fd55242f22b21ce8e4b5d34ac416d20d526f3a9 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 17 Aug 2026 01:25:12 +0800 Subject: [PATCH 16/22] fix : DumboRC expansion channel module configuration error. --- radio/src/boards/hw_defs/dro1.json | 33 +++++++++--------------------- radio/src/dataconstants.h | 2 +- radio/src/datastructs.h | 4 ++-- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/radio/src/boards/hw_defs/dro1.json b/radio/src/boards/hw_defs/dro1.json index 3cfe009593d..21cb9ae0cc0 100644 --- a/radio/src/boards/hw_defs/dro1.json +++ b/radio/src/boards/hw_defs/dro1.json @@ -302,7 +302,7 @@ "is_cfs": false }, { - "name": "SEA", + "name": "SK", "type": "3POS", "flags": 0, "inverted": false, @@ -315,7 +315,7 @@ "is_cfs": false }, { - "name": "SEB", + "name": "SL", "type": "3POS", "flags": 0, "inverted": false, @@ -328,7 +328,7 @@ "is_cfs": false }, { - "name": "SEC", + "name": "SM", "type": "3POS", "flags": 0, "inverted": false, @@ -341,7 +341,7 @@ "is_cfs": false }, { - "name": "SED", + "name": "SN", "type": "3POS", "flags": 0, "inverted": false, @@ -354,7 +354,7 @@ "is_cfs": false }, { - "name": "SEE", + "name": "SO", "type": "3POS", "flags": 0, "inverted": false, @@ -367,20 +367,7 @@ "is_cfs": false }, { - "name": "SEF", - "type": "3POS", - "flags": 0, - "inverted": false, - "default": "3POS", - "display": null, - "gpio_high": null, - "pin_high": "DUMBORC_EXTCHANNEL_PIN_26", - "gpio_low": null, - "pin_low": "DUMBORC_EXTCHANNEL_PIN_10", - "is_cfs": false - }, - { - "name": "SEG", + "name": "SQ", "type": "3POS", "flags": 0, "inverted": false, @@ -393,7 +380,7 @@ "is_cfs": false }, { - "name": "SEH", + "name": "SR", "type": "3POS", "flags": 0, "inverted": false, @@ -406,7 +393,7 @@ "is_cfs": false }, { - "name": "SEI", + "name": "SS", "type": "3POS", "flags": 0, "inverted": false, @@ -419,7 +406,7 @@ "is_cfs": false }, { - "name": "SEJ", + "name": "ST", "type": "3POS", "flags": 0, "inverted": false, @@ -432,7 +419,7 @@ "is_cfs": false }, { - "name": "SEK", + "name": "SU", "type": "3POS", "flags": 0, "inverted": false, diff --git a/radio/src/dataconstants.h b/radio/src/dataconstants.h index b892e913c4c..d703846b8d8 100644 --- a/radio/src/dataconstants.h +++ b/radio/src/dataconstants.h @@ -409,7 +409,7 @@ enum PotsWarnMode { #define MAX_ANALOG_INPUTS (MAX_STICKS + MAX_POTS + MAX_VBAT + MAX_RTC_BAT) #define MAX_CALIB_ANALOG_INPUTS (MAX_STICKS + MAX_POTS) -#define MAX_SWITCHES 21 +#define MAX_SWITCHES 20 #if !defined(MAX_FLEX_SWITCHES) #define MAX_FLEX_SWITCHES 0 diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index a91b51be5ba..8cc17697283 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -84,9 +84,9 @@ static inline void check_struct() CHKSIZE(RadioData, 1180); #elif defined(COLORLCD) #if defined(IMU) - CHKSIZE(RadioData, 1063+4); + CHKSIZE(RadioData, 1063); #else - CHKSIZE(RadioData, 1062+4); + CHKSIZE(RadioData, 1062); #endif #elif defined(RADIO_GX12) CHKSIZE(RadioData, 1068); From cd0f55e7ebed77970cdb43e65901eb33745c2182 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Fri, 11 Sep 2026 19:05:32 +0800 Subject: [PATCH 17/22] feat : Optimize (Increase portability) DumboRC expansion channel module. --- radio/src/drivers/dumborc_extchannel.cpp | 279 +++++++++++++---------- radio/src/drivers/dumborc_extchannel.h | 13 +- 2 files changed, 164 insertions(+), 128 deletions(-) diff --git a/radio/src/drivers/dumborc_extchannel.cpp b/radio/src/drivers/dumborc_extchannel.cpp index 249a4aa9a31..bfe75ef66ec 100644 --- a/radio/src/drivers/dumborc_extchannel.cpp +++ b/radio/src/drivers/dumborc_extchannel.cpp @@ -35,14 +35,7 @@ #include "hal/gpio.h" #include "stm32_gpio.h" #include "stm32_switch_driver.h" - -#if ( CPU_TYPE == STM32F2 ) -#include "core_cm3.h" -#elif ( CPU_TYPE == STM32F4 ) -#include "core_cm4.h" -#else -#include "core_cm7.h" -#endif +#include "delays_driver.h" #include "os/time.h" #include "os/task.h" @@ -57,38 +50,26 @@ (sizeof(__TARGET__) / sizeof((__TARGET__)[0])) -#define DUMBORC_EXTCHANNEL_TIMER_INIT() \ - do { \ - if ( (((CoreDebug->DEMCR) & CoreDebug_DEMCR_TRCENA_Msk) == 0) && \ - (((DWT->CTRL) & DWT_CTRL_CYCCNTENA_Msk) == 0) ) { \ - (CoreDebug->DEMCR) |= CoreDebug_DEMCR_TRCENA_Msk; \ - (DWT->CYCCNT) = 0UL; \ - (DWT->CTRL) |= DWT_CTRL_CYCCNTENA_Msk; \ - } \ - } while ( 0 ) +#define DUMBORC_EXTCHANNEL_CPU_FREQ_HZ (CPU_FREQ) -#define DUMBORC_EXTCHANNEL_TIMER_UNINIT() \ - do { \ - if ( (((CoreDebug->DEMCR) & CoreDebug_DEMCR_TRCENA_Msk) != 0) && \ - (((DWT->CTRL) & DWT_CTRL_CYCCNTENA_Msk) != 0) ) { \ - (DWT->CTRL) &= (~DWT_CTRL_CYCCNTENA_Msk); \ - (DWT->CYCCNT) = 0UL; \ - (CoreDebug->DEMCR) &= (~CoreDebug_DEMCR_TRCENA_Msk); \ - } \ - } while ( 0 ) +#define DUMBORC_EXTCHANNEL_DELAY_US_TO_TICK(__TIME_US__) \ + ((uint32_t)((__TIME_US__) * ((DUMBORC_EXTCHANNEL_CPU_FREQ_HZ) / 1000000UL))) -#define DUMBORC_EXTCHANNEL_TIMER_GET_TICK() \ - ((uint32_t)(DWT->CYCCNT)) +#define DUMBORC_EXTCHANNEL_DELAY_TICK_TO_US(__TIME_TICK__) \ + ((uint32_t)((__TIME_TICK__) / ((DUMBORC_EXTCHANNEL_CPU_FREQ_HZ) / 1000000UL))) -#define DUMBORC_EXTCHANNEL_TIMER_US_TO_TICK(__TIME_US__) \ - ((uint32_t)((__TIME_US__) * ((CPU_FREQ) / 1000000UL))) -#define DUMBORC_EXTCHANNEL_TIMER_TICK_TO_US(__TIME_TICK__) \ - ((uint32_t)((__TIME_TICK__) / ((CPU_FREQ) / 1000000UL))) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_SDA GPIOA +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_SCL GPIOA +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SDA 13 +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SCL 14 - -#define DUMBORC_EXTCHANNEL_I2C_GPIO_SDA GPIO_PIN(GPIOA , 13) -#define DUMBORC_EXTCHANNEL_I2C_GPIO_SCL GPIO_PIN(GPIOA , 14) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SDA \ + GPIO_PIN(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_SDA , \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SDA) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SCL \ + GPIO_PIN(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_SCL , \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SCL) #define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(__GPIO__) \ gpio_clear(__GPIO__) @@ -103,7 +84,7 @@ #define DUMBORC_EXTCHANNEL_TASK_STACK_SIZE (64) -#define DUMBORC_EXTCHANNEL_TASK_PRIO CLI_TASK_PRIO +#define DUMBORC_EXTCHANNEL_TASK_PRIO (CLI_TASK_PRIO) @@ -120,6 +101,21 @@ static uint32_t s_dumborc_extchannel_task_status = 0; /* LJS : Software I2C BEGIN >>> */ +static void i_dumborc_extchannel_delay_init(void) +{ + delaysInit(); +} + +static void i_dumborc_extchannel_delay_uninit(void) +{ + return; +} + +static uint32_t i_dumborc_extchannel_delay_get_tick(void) +{ + return ticksNow(); +} + #pragma GCC push_options #pragma GCC optimize("O0") static void i_dumborc_extchannel_delay_us(uint32_t const time_us) @@ -127,9 +123,30 @@ static void i_dumborc_extchannel_delay_us(uint32_t const time_us) uint32_t val_tick , val_tick_dt; - val_tick = DUMBORC_EXTCHANNEL_TIMER_GET_TICK(); - val_tick_dt = DUMBORC_EXTCHANNEL_TIMER_US_TO_TICK(time_us); - while ( (DUMBORC_EXTCHANNEL_TIMER_GET_TICK() - val_tick) < val_tick_dt ); + val_tick = i_dumborc_extchannel_delay_get_tick(); + val_tick_dt = DUMBORC_EXTCHANNEL_DELAY_US_TO_TICK(time_us); + while ( (i_dumborc_extchannel_delay_get_tick() - val_tick) < val_tick_dt ); +} + +static int i_dumborc_extchannel_delay_check(void) +{ + uint32_t val , val_tick; + + + /* LJS : Get timer current tick */ + val_tick = i_dumborc_extchannel_delay_get_tick(); + /* LJS : Simulate a 2us delay! */ + val = (2 * ((DUMBORC_EXTCHANNEL_CPU_FREQ_HZ) / 1000000UL)); + while ( val-- > 0 ) { + __NOP(); + } + /* LJS : Check the change in timer tick */ + if ( i_dumborc_extchannel_delay_get_tick() == val_tick ) { + /* LJS : Timer hasn't started! (-1) */ + return -1; + } + + return 0; } #pragma GCC pop_options @@ -401,69 +418,44 @@ static int i_dumborc_extchannel_i2c_bus_write(\ /* LJS : Software I2C END <<< */ +/* LJS : Dumborc_extchannel handle task BEGIN <<< */ static void i_dumborc_extchannel_task_cb(void) { - static const uint8_t buf_cfg[][3] = {\ - {0x02 , 0xFF , 0xFF} , \ - {0x04 , 0x00 , 0x00} , \ - {0x06 , 0xFF , 0xFF} , \ - }; - int ret; - uint32_t i; - uint8_t reg; - - for ( ; ; ) { while ( !s_dumborc_extchannel_task_status ) { sleep_ms(1); } - /* LJS : PROCESS BEGIN >>> */ - if ( s_dumborc_extchannel_i2c_req_cnt <= 0 ) { - /* LJS : First-time use requires initializing the configuration */ - for ( i = 0 , ret = 0 ; \ - i < DUMBORC_EXTCHANNEL_COUNT_OF(buf_cfg) ; \ - ++i ) { - ret |= i_dumborc_extchannel_i2c_bus_write(\ - DUMBORC_EXTCHANNEL_I2C_ADDR_A , \ - buf_cfg[i] , sizeof(buf_cfg[0])); - ret |= i_dumborc_extchannel_i2c_bus_write(\ - DUMBORC_EXTCHANNEL_I2C_ADDR_B , \ - buf_cfg[i] , sizeof(buf_cfg[0])); - } - } + dumborc_extchannel_handle(); - for ( i = 0 , ret = 0 ; \ - i < (DUMBORC_EXTCHANNEL_COUNT_OF(\ - s_dumborc_extchannel_i2c_req_buf_reg[0]) >> 1) ; \ - ++i ) { - if ( (i >= 1) && \ - ((s_dumborc_extchannel_i2c_req_cnt % 10) != 0) ) { - /* LJS : Execute every 10 times! (Slow refresh 'reg[2:7]') */ - break; - } - reg = (i << 1); - ret |= i_dumborc_extchannel_i2c_bus_read(\ - DUMBORC_EXTCHANNEL_I2C_ADDR_A , \ - ® , sizeof(reg) , \ - &(s_dumborc_extchannel_i2c_req_buf_reg[0][reg]) , 2); - ret |= i_dumborc_extchannel_i2c_bus_read(\ - DUMBORC_EXTCHANNEL_I2C_ADDR_B , \ - ® , sizeof(reg) , \ - &(s_dumborc_extchannel_i2c_req_buf_reg[1][reg]) , 2); + sleep_ms(100); + } +} + +static int i_dumborc_extchannel_task_init(void) +{ + if ( (s_dumborc_extchannel_task_id._stack_size) <= 0 ) { + /* LJS : Task (static_task) create. */ + task_create(&s_dumborc_extchannel_task_id , \ + i_dumborc_extchannel_task_cb , \ + "DR_EC:P" , \ + s_dumborc_extchannel_task_stack , \ + DUMBORC_EXTCHANNEL_TASK_STACK_SIZE , \ + DUMBORC_EXTCHANNEL_TASK_PRIO); + if ( (s_dumborc_extchannel_task_id._stack_size) <= 0 ) { + /* LJS : Task hasn't create! (-1) */ + return -1; } - s_dumborc_extchannel_i2c_req_pins_status = \ - ( (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[0][0])) << 0) | \ - (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[0][1])) << 8) | \ - (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[1][0])) << 16) | \ - (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[1][1])) << 24) ); + } - ++s_dumborc_extchannel_i2c_req_cnt; - /* LJS : PROCESS END <<< */ + return 0; +} - sleep_ms(100); - } +static int i_dumborc_extchannel_task_uninit(void) +{ + return 0; } +/* LJS : Dumborc_extchannel handle task END <<< */ static void i_dumborc_extchannel_para_reset(void) @@ -471,7 +463,7 @@ static void i_dumborc_extchannel_para_reset(void) memset(s_dumborc_extchannel_i2c_req_buf_reg , 0x00 , \ sizeof(s_dumborc_extchannel_i2c_req_buf_reg)); s_dumborc_extchannel_i2c_clk_cycle_tick_div3 = \ - DUMBORC_EXTCHANNEL_TIMER_US_TO_TICK(1); + DUMBORC_EXTCHANNEL_DELAY_US_TO_TICK(1); s_dumborc_extchannel_i2c_req_cnt = 0; s_dumborc_extchannel_i2c_req_pins_status = 0; s_dumborc_extchannel_task_status = 0; @@ -488,48 +480,24 @@ static void i_dumborc_extchannel_para_reset(void) * @return [error code (int)] * [0 : succeed ; !0 : failed] */ -#pragma GCC push_options -#pragma GCC optimize("O0") int dumborc_extchannel_init(void) { - uint32_t val , val_tick; - - - DUMBORC_EXTCHANNEL_TIMER_INIT(); + i_dumborc_extchannel_delay_init(); i_dumborc_extchannel_para_reset(); i_dumborc_extchannel_i2c_gpio_init(); - /* LJS : Get timer current tick */ - val_tick = DUMBORC_EXTCHANNEL_TIMER_GET_TICK(); - /** - * LJS : Do __NOP '(2 * ((CPU_FREQ) / 1000000UL))' times, - * Simulate a 2us delay! - */ - for ( val = 0 ; val < (2 * ((CPU_FREQ) / 1000000UL)) ; ++val ) { - __NOP(); - } - /* LJS : Check the change in timer tick */ - if ( DUMBORC_EXTCHANNEL_TIMER_GET_TICK() == val_tick ) { + if ( i_dumborc_extchannel_delay_check() < 0 ) { /* LJS : Timer hasn't started! (-1) */ return -1; } - if ( (s_dumborc_extchannel_task_id._stack_size) <= 0 ) { - task_create(&s_dumborc_extchannel_task_id , \ - i_dumborc_extchannel_task_cb , \ - "DR_EC:P" , \ - s_dumborc_extchannel_task_stack , \ - DUMBORC_EXTCHANNEL_TASK_STACK_SIZE , \ - DUMBORC_EXTCHANNEL_TASK_PRIO); - if ( (s_dumborc_extchannel_task_id._stack_size) <= 0 ) { - /* LJS : Task hasn't create! (-2) */ - return -2; - } + if ( i_dumborc_extchannel_task_init() < 0 ) { + /* LJS : Task hasn't init! (-2) */ + return -2; } return 0; } -#pragma GCC pop_options /** * [dumborc_extchannel_uninit (dumborc_extchannel uninit)] @@ -540,12 +508,81 @@ int dumborc_extchannel_uninit(void) { i_dumborc_extchannel_i2c_gpio_uninit(); i_dumborc_extchannel_para_reset(); - DUMBORC_EXTCHANNEL_TIMER_UNINIT(); + i_dumborc_extchannel_delay_uninit(); + + if ( i_dumborc_extchannel_task_uninit() < 0 ) { + /* LJS : Task hasn't uninit! (-1) */ + return -1; + } return 0; } +/** + * [dumborc_extchannel_handle (dumborc_extchannel handle)] + */ +void dumborc_extchannel_handle(void) +{ + static const uint8_t buf_cfg[][3] = {\ + {0x02 , 0xFF , 0xFF} , \ + {0x04 , 0x00 , 0x00} , \ + {0x06 , 0xFF , 0xFF} , \ + }; + int ret; + uint32_t i; + uint8_t reg; + + + if ( !s_dumborc_extchannel_task_status ) { + return; + } + + /* LJS : PROCESS BEGIN >>> */ + if ( s_dumborc_extchannel_i2c_req_cnt <= 0 ) { + /* LJS : First-time use requires initializing the configuration */ + for ( i = 0 , ret = 0 ; \ + i < DUMBORC_EXTCHANNEL_COUNT_OF(buf_cfg) ; \ + ++i ) { + ret |= i_dumborc_extchannel_i2c_bus_write(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_A , \ + buf_cfg[i] , sizeof(buf_cfg[0])); + ret |= i_dumborc_extchannel_i2c_bus_write(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_B , \ + buf_cfg[i] , sizeof(buf_cfg[0])); + } + } + + for ( i = 0 , ret = 0 ; \ + i < (DUMBORC_EXTCHANNEL_COUNT_OF(\ + s_dumborc_extchannel_i2c_req_buf_reg[0]) >> 1) ; \ + ++i ) { + if ( (i >= 1) && \ + ((s_dumborc_extchannel_i2c_req_cnt % 10) != 0) ) { + /* LJS : Execute every 10 times! (Slow refresh 'reg[2:7]') */ + break; + } + reg = (i << 1); + ret |= i_dumborc_extchannel_i2c_bus_read(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_A , \ + ® , sizeof(reg) , \ + &(s_dumborc_extchannel_i2c_req_buf_reg[0][reg]) , 2); + ret |= i_dumborc_extchannel_i2c_bus_read(\ + DUMBORC_EXTCHANNEL_I2C_ADDR_B , \ + ® , sizeof(reg) , \ + &(s_dumborc_extchannel_i2c_req_buf_reg[1][reg]) , 2); + } + s_dumborc_extchannel_i2c_req_pins_status = \ + ( (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[0][0])) << 0) | \ + (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[0][1])) << 8) | \ + (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[1][0])) << 16) | \ + (((uint32_t)(s_dumborc_extchannel_i2c_req_buf_reg[1][1])) << 24) ); + + ++s_dumborc_extchannel_i2c_req_cnt; + /* LJS : PROCESS END <<< */ +} + + /** * [dumborc_extchannel_get_task_status (dumborc_extchannel get task status)] * @return [task status (uint32_t)] diff --git a/radio/src/drivers/dumborc_extchannel.h b/radio/src/drivers/dumborc_extchannel.h index e73d8f8c764..f5dd77b9ca1 100644 --- a/radio/src/drivers/dumborc_extchannel.h +++ b/radio/src/drivers/dumborc_extchannel.h @@ -36,13 +36,6 @@ #if ( DUMBORC_EXTCHANNEL_ENABLED ) -#if ( LOG_ENABLED && DUMBORC_EXTCHANNEL_LOG_ENABLED ) -# include "debug.h" -# define DUMBORC_EXTCHANNEL_LOG_INFO(...) TRACE(__VA_ARGS__) -#else -# define DUMBORC_EXTCHANNEL_LOG_INFO(...) -#endif /* ( LOG_ENABLED && DUMBORC_EXTCHANNEL_LOG_ENABLED ) */ - /* LJS : Dumborc extchannel PIN_[0:31] define. */ @@ -96,6 +89,12 @@ int dumborc_extchannel_init(void); int dumborc_extchannel_uninit(void); +/** + * [dumborc_extchannel_handle (dumborc_extchannel handle)] + */ +void dumborc_extchannel_handle(void); + + /** * [dumborc_extchannel_get_task_status (dumborc_extchannel get task status)] * @return [task status (uint32_t)] From df6ed4abe97ef225004a11eda3d2f1a295ee01ca Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Tue, 15 Sep 2026 19:05:58 +0800 Subject: [PATCH 18/22] feat : Optimize (Improve portability, GPIO functions) DumboRC expansion channel module. --- radio/src/drivers/dumborc_extchannel.cpp | 129 ++++++++++++++--------- 1 file changed, 81 insertions(+), 48 deletions(-) diff --git a/radio/src/drivers/dumborc_extchannel.cpp b/radio/src/drivers/dumborc_extchannel.cpp index bfe75ef66ec..894e3c60102 100644 --- a/radio/src/drivers/dumborc_extchannel.cpp +++ b/radio/src/drivers/dumborc_extchannel.cpp @@ -32,9 +32,9 @@ #include #include "hal.h" -#include "hal/gpio.h" -#include "stm32_gpio.h" -#include "stm32_switch_driver.h" +#include "stm32_hal.h" +#include "stm32_hal_ll.h" +#include "stm32_gpio_driver.h" #include "delays_driver.h" #include "os/time.h" @@ -64,19 +64,22 @@ #define DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SDA 13 #define DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SCL 14 -#define DUMBORC_EXTCHANNEL_I2C_GPIO_SDA \ - GPIO_PIN(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_SDA , \ - DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SDA) -#define DUMBORC_EXTCHANNEL_I2C_GPIO_SCL \ - GPIO_PIN(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_SCL , \ - DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_SCL) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(__GPIO__) \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_##__GPIO__ +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_X(__GPIO__) \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_##__GPIO__ +#define DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(__GPIO__) \ + (1UL << DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_X(__GPIO__)) -#define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(__GPIO__) \ - gpio_clear(__GPIO__) -#define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(__GPIO__) \ - gpio_set(__GPIO__) -#define DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(__GPIO__) \ - gpio_read(__GPIO__) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(__GPIO__) \ + LL_GPIO_ResetOutputPin(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(__GPIO__) , \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(__GPIO__)) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(__GPIO__) \ + LL_GPIO_SetOutputPin(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(__GPIO__) , \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(__GPIO__)) +#define DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(__GPIO__) \ + LL_GPIO_IsInputPinSet(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(__GPIO__) , \ + DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(__GPIO__)) #define DUMBORC_EXTCHANNEL_I2C_ADDR_A (0x27 << 1) @@ -136,7 +139,7 @@ static int i_dumborc_extchannel_delay_check(void) /* LJS : Get timer current tick */ val_tick = i_dumborc_extchannel_delay_get_tick(); /* LJS : Simulate a 2us delay! */ - val = (2 * ((DUMBORC_EXTCHANNEL_CPU_FREQ_HZ) / 1000000UL)); + val = DUMBORC_EXTCHANNEL_DELAY_US_TO_TICK(2); while ( val-- > 0 ) { __NOP(); } @@ -154,17 +157,43 @@ static int i_dumborc_extchannel_delay_check(void) static void i_dumborc_extchannel_i2c_gpio_init(void) { /* LJS : Init Software-I2C SDA & SCL GPIO */ - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); - gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA , GPIO_OD_PU , GPIO_PIN_SPEED_MEDIUM); - gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL , GPIO_OD_PU , GPIO_PIN_SPEED_MEDIUM); + LL_GPIO_InitTypeDef pinInit; + + + stm32_gpio_enable_clock(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(SDA)); + stm32_gpio_enable_clock(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(SCL)); + + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); + + LL_GPIO_StructInit(&pinInit); + pinInit.Pin = DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(SDA); + pinInit.Mode = LL_GPIO_MODE_OUTPUT; + pinInit.Speed = LL_GPIO_SPEED_FREQ_MEDIUM; + pinInit.OutputType = LL_GPIO_OUTPUT_OPENDRAIN; + pinInit.Pull = LL_GPIO_PULL_UP; + pinInit.Alternate = LL_GPIO_AF_0; + LL_GPIO_Init(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(SDA) , &pinInit); + pinInit.Pin = DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(SCL); + LL_GPIO_Init(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(SCL) , &pinInit); } static void i_dumborc_extchannel_i2c_gpio_uninit(void) { /* LJS : Uninit Software-I2C SDA & SCL GPIO */ - gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA , GPIO_IN , GPIO_PIN_SPEED_LOW); - gpio_init(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL , GPIO_IN , GPIO_PIN_SPEED_LOW); + LL_GPIO_InitTypeDef pinInit; + + + LL_GPIO_StructInit(&pinInit); + pinInit.Pin = DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(SDA); + pinInit.Mode = LL_GPIO_MODE_INPUT; + pinInit.Speed = LL_GPIO_SPEED_FREQ_LOW; + pinInit.OutputType = LL_GPIO_OUTPUT_PUSHPULL; + pinInit.Pull = LL_GPIO_PULL_NO; + pinInit.Alternate = LL_GPIO_AF_0; + LL_GPIO_Init(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(SDA) , &pinInit); + pinInit.Pin = DUMBORC_EXTCHANNEL_I2C_GPIO_PIN_LL_X(SCL); + LL_GPIO_Init(DUMBORC_EXTCHANNEL_I2C_GPIO_PORT_X(SCL) , &pinInit); } static void i_dumborc_extchannel_i2c_bus_start(void) @@ -173,13 +202,13 @@ static void i_dumborc_extchannel_i2c_bus_start(void) * SCL XXXXXX XXXXXX HHHHHH HHHHHH LLLLLL * SDA XXXXXX HHHHHH HHHHHH LLLLLL LLLLLL */ - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SDA); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); } @@ -190,11 +219,11 @@ static void i_dumborc_extchannel_i2c_bus_stop(void) * SDA XXXXXX LLLLLL LLLLLL HHHHHH */ i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SDA); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); } @@ -203,25 +232,25 @@ static uint8_t i_dumborc_extchannel_i2c_bus_read_1byte(void) uint32_t count , rx_byte; - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); count = 8; rx_byte = 0; do { - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); rx_byte <<= 1; - if ( DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA) ) { + if ( DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(SDA) ) { rx_byte |= 0x01; } - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); } while ( --count ); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); return (rx_byte & 0xFF); } @@ -235,18 +264,18 @@ static void i_dumborc_extchannel_i2c_bus_write_1byte(uint8_t const data) tx_byte = data; do { if ( tx_byte & 0x80 ) { - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); } else { - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SDA); } tx_byte <<= 1; i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SCL); if ( count == 1 ) { - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SDA); } i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); } while ( --count ); @@ -257,24 +286,24 @@ static uint8_t i_dumborc_extchannel_i2c_bus_get_ack(void) uint32_t count , status; - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); count = 10; do { - status = DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + status = DUMBORC_EXTCHANNEL_I2C_GPIO_GET_X(SDA); if ( status == 0 ) { break; } i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); } while ( --count ); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); return (!!status); } @@ -282,15 +311,15 @@ static uint8_t i_dumborc_extchannel_i2c_bus_get_ack(void) static void i_dumborc_extchannel_i2c_bus_set_ack(uint32_t const status) { if ( status ) { - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SDA); } else { - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SDA); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SDA); } i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_1(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_H(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); - DUMBORC_EXTCHANNEL_I2C_GPIO_SET_0(DUMBORC_EXTCHANNEL_I2C_GPIO_SCL); + DUMBORC_EXTCHANNEL_I2C_GPIO_SET_L(SCL); i_dumborc_extchannel_delay_us(s_dumborc_extchannel_i2c_clk_cycle_tick_div3); } @@ -642,6 +671,10 @@ uint32_t dumborc_extchannel_get_pin_status(uint32_t const pin_mask) #if 1 +#include "stm32_switch_driver.h" + + + /** * [boardSwitchGetPosition (System board swith get position , Override)] * @param idx [System board switch index (uint8_t)] From 07ac96a6e5e6ead173fa8ae0368b0d6643ae703a Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Thu, 17 Sep 2026 20:09:42 +0800 Subject: [PATCH 19/22] feat : Add CRSF[17:32] output functionality to the DumboRC channel expansion module. --- .../colorlcd/module/crossfire_settings.cpp | 6 +++ radio/src/pulses/crossfire.cpp | 42 +++++++++++++++++++ radio/src/telemetry/crossfire.h | 1 + 3 files changed, 49 insertions(+) diff --git a/radio/src/gui/colorlcd/module/crossfire_settings.cpp b/radio/src/gui/colorlcd/module/crossfire_settings.cpp index 9a3aac3f559..54816828eab 100644 --- a/radio/src/gui/colorlcd/module/crossfire_settings.cpp +++ b/radio/src/gui/colorlcd/module/crossfire_settings.cpp @@ -63,7 +63,13 @@ CrossfireSettings::CrossfireSettings(Window* parent, const FlexGridLayout& g, char msg[64] = ""; // sprintf(msg, "%d Hz %" PRIu32 " Err", 1000000 / getMixerSchedulerPeriod(), // telemetryErrors); + #if ( DUMBORC_EXTCHANNEL_ENABLED ) + sprintf(msg, "%d Hz%s", 1000000 / getMixerSchedulerPeriod() , + ((md->channelsStart == 0) && (md->channelsCount == (16 - 8))) ? + " (CH[17:32] : '/5' Hz)" : ""); + #else sprintf(msg, "%d Hz", 1000000 / getMixerSchedulerPeriod()); + #endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ return std::string(msg); }); diff --git a/radio/src/pulses/crossfire.cpp b/radio/src/pulses/crossfire.cpp index 1cd9259c405..d42fe812fdb 100644 --- a/radio/src/pulses/crossfire.cpp +++ b/radio/src/pulses/crossfire.cpp @@ -45,6 +45,12 @@ #define MODULE_ALIVE_TIMEOUT 50 // if the module has sent a valid frame within 500ms it is declared alive static tmr10ms_t lastAlive[NUM_MODULES]; // last time stamp module sent CRSF frames static bool moduleAlive[NUM_MODULES]; // module alive status +#if ( DUMBORC_EXTCHANNEL_ENABLED ) +/* Record CRSF send count. */ +static uint32_t s_module_crsf_send_cnt[NUM_MODULES] = {0}; +/* Control CRSF send period. "(X-1) : 1" <=> "CRSF[1:16] : (X-1) times ; CRSF[17:31] : 1 time */ +static const uint32_t module_crsf_send_period = 5; +#endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ uint8_t createCrossfireBindFrame(uint8_t moduleIdx, uint8_t * frame) { @@ -146,10 +152,32 @@ uint8_t createCrossfireChannelsFrame(uint8_t moduleIdx, uint8_t * frame, int16_t return buf - frame; } +#if ( DUMBORC_EXTCHANNEL_ENABLED ) +/* CRSF-CHANNELS_17_32_ID [BEGIN] */ +uint8_t createCrossfireChannelsFrame_17_32(uint8_t moduleIdx, uint8_t * frame, int16_t * pulses) +{ + uint8_t len = createCrossfireChannelsFrame(moduleIdx, frame, pulses); + + + /* 1(ID) + 22(channel data) + 1(CRC) */ + frame[1] = 24; + frame[2] = CHANNELS_17_32_ID; + frame[3 + ((CROSSFIRE_CHANNELS_COUNT * CROSSFIRE_CH_BITS) / 8)] = crc8(frame + 2, 23); + + return (len - 1); +} +/* CRSF-CHANNELS_17_32_ID [END] */ +#endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ + static void setupPulsesCrossfire(uint8_t module, uint8_t*& p_buf, uint8_t endpoint, int16_t* channels, uint8_t nChannels) { + #if ( DUMBORC_EXTCHANNEL_ENABLED ) + uint32_t * p_module_crsf_send_cnt = s_module_crsf_send_cnt + module; + #endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ + + #if defined(LUA) if (outputTelemetryBuffer.destination == endpoint) { auto len = outputTelemetryBuffer.size; @@ -182,6 +210,9 @@ static void setupPulsesCrossfire(uint8_t module, uint8_t*& p_buf, if(moduleAlive[module] == false) { // if the module was dead and came back to live, e.g. reset moduleAlive[module] = true; // declare the module as alive moduleState[module].counter = CRSF_FRAME_MODELID; // and send it the modelID again + #if ( DUMBORC_EXTCHANNEL_ENABLED ) + (*p_module_crsf_send_cnt) = 0; + #endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ } } } @@ -197,7 +228,18 @@ static void setupPulsesCrossfire(uint8_t module, uint8_t*& p_buf, moduleState[module].mode = MODULE_MODE_NORMAL; } else { /* TODO: nChannels */ + #if ( DUMBORC_EXTCHANNEL_ENABLED ) + (*p_module_crsf_send_cnt)++; + if ( ((channels != channelOutputs) || (nChannels != 16)) || + ((*p_module_crsf_send_cnt) < module_crsf_send_period) ) { + p_buf += createCrossfireChannelsFrame(module, p_buf, channels); + } else { + p_buf += createCrossfireChannelsFrame_17_32(module, p_buf, channels + nChannels); + (*p_module_crsf_send_cnt) = 0; + } + #else p_buf += createCrossfireChannelsFrame(module, p_buf, channels); + #endif /* ( DUMBORC_EXTCHANNEL_ENABLED ) */ } } } diff --git a/radio/src/telemetry/crossfire.h b/radio/src/telemetry/crossfire.h index bdfc4956180..96a4f85d3ea 100644 --- a/radio/src/telemetry/crossfire.h +++ b/radio/src/telemetry/crossfire.h @@ -43,6 +43,7 @@ #define VOLT_ARRAY_ID 0xFE // Pseudo sensor out of 0x0E frame #define LINK_ID 0x14 #define CHANNELS_ID 0x16 +#define CHANNELS_17_32_ID 0x17 /* channel[32:17] */ #define LINK_RX_ID 0x1C #define LINK_TX_ID 0x1D #define ATTITUDE_ID 0x1E From 8d935a3a3f19395326e7543bebf77cbc378d9471 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Thu, 17 Sep 2026 20:24:29 +0800 Subject: [PATCH 20/22] fix(DRO1) : Fix and update file 'web/public/radios.json'. --- web/public/radios.json | 244 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) diff --git a/web/public/radios.json b/web/public/radios.json index ea729d2f81e..12c99c62e3a 100644 --- a/web/public/radios.json +++ b/web/public/radios.json @@ -1,4 +1,248 @@ [ + { + "name": "DumboRC DRO1", + "wasm": "edgetx-dro1-simulator.wasm", + "display": { + "w": 480, + "h": 272, + "depth": 16 + }, + "inputs": [ + { + "name": "LH", + "type": "STICK", + "label": "LH" + }, + { + "name": "LV", + "type": "STICK", + "label": "LV" + }, + { + "name": "RV", + "type": "STICK", + "label": "RV" + }, + { + "name": "RH", + "type": "STICK", + "label": "RH" + }, + { + "name": "P1", + "type": "FLEX", + "label": "S1", + "default": "POT_CENTER" + }, + { + "name": "P2", + "type": "FLEX", + "label": "6POS", + "default": "MULTIPOS" + }, + { + "name": "P3", + "type": "FLEX", + "label": "S2", + "default": "POT_CENTER" + }, + { + "name": "SL1", + "type": "FLEX", + "label": "LS", + "default": "SLIDER" + }, + { + "name": "SL2", + "type": "FLEX", + "label": "RS", + "default": "SLIDER" + }, + { + "name": "EXT1", + "type": "FLEX", + "label": "EXT1", + "default": "SLIDER" + }, + { + "name": "EXT2", + "type": "FLEX", + "label": "EXT2", + "default": "SLIDER" + }, + { + "name": "EXT3", + "type": "FLEX", + "label": "EXT3", + "default": "NONE" + }, + { + "name": "EXT4", + "type": "FLEX", + "label": "EXT4", + "default": "NONE" + } + ], + "switches": [ + { + "name": "SA", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SB", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SC", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SD", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SE", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SF", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SG", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SH", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SI", + "type": "2POS", + "default": "2POS" + }, + { + "name": "SJ", + "type": "2POS", + "default": "2POS" + }, + { + "name": "SK", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SL", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SM", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SN", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SO", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SQ", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SR", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SS", + "type": "3POS", + "default": "3POS" + }, + { + "name": "ST", + "type": "3POS", + "default": "3POS" + }, + { + "name": "SU", + "type": "3POS", + "default": "3POS" + } + ], + "trims": [ + { + "name": "T1" + }, + { + "name": "T2" + }, + { + "name": "T3" + }, + { + "name": "T4" + }, + { + "name": "T5" + }, + { + "name": "T6" + } + ], + "keys": [ + { + "key": "KEY_MODEL", + "label": "MDL", + "side": "R" + }, + { + "key": "KEY_SYS", + "label": "SYS", + "side": "L" + }, + { + "key": "KEY_PAGEUP", + "label": "PAGE◀", + "side": "L" + }, + { + "key": "KEY_PAGEDN", + "label": "PAGE▶", + "side": "R" + }, + { + "key": "KEY_TELE", + "label": "TELE", + "side": "R" + }, + { + "key": "KEY_EXIT", + "label": "RTN", + "side": "L" + }, + { + "key": "KEY_ENTER", + "label": "Enter ⏎", + "side": "R" + } + ] + }, { "name": "Fatfish F16", "wasm": "edgetx-f16-simulator.wasm", From fc854bf6dc5f4fe287ba16efbefbf876ebae0db1 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Sat, 19 Sep 2026 01:17:40 +0800 Subject: [PATCH 21/22] fix(DRO1) : Fix error compile configuration. --- radio/src/targets/horus/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index ed6ef04e970..a81e50a6182 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -151,7 +151,7 @@ if (PCB STREQUAL X10) add_definitions(-DDUMBORC_EXTCHANNEL_ENABLED) set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS") set(FLYSKY_GIMBAL OFF) - set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches") + # set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches") else() set(FLAVOUR x10) set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module") From 7329439242a8420fbfa013c01d42cc18c2b909d8 Mon Sep 17 00:00:00 2001 From: FreedomLJS <1776063194@qq.com> Date: Mon, 21 Sep 2026 16:25:00 +0800 Subject: [PATCH 22/22] fix (DRO1) : Change CHANNELS_17_32_ID to 0x1A to avoid conflitcs. --- radio/src/telemetry/crossfire.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/telemetry/crossfire.h b/radio/src/telemetry/crossfire.h index 96a4f85d3ea..3340cea6465 100644 --- a/radio/src/telemetry/crossfire.h +++ b/radio/src/telemetry/crossfire.h @@ -43,7 +43,7 @@ #define VOLT_ARRAY_ID 0xFE // Pseudo sensor out of 0x0E frame #define LINK_ID 0x14 #define CHANNELS_ID 0x16 -#define CHANNELS_17_32_ID 0x17 /* channel[32:17] */ +#define CHANNELS_17_32_ID 0x1A /* channel[32:17] */ #define LINK_RX_ID 0x1C #define LINK_TX_ID 0x1D #define ATTITUDE_ID 0x1E