X9LiteS (#6820)
This commit is contained in:
@@ -85,7 +85,7 @@ set(BOOTLOADER_SRC
|
||||
bin_files.cpp
|
||||
)
|
||||
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X9E OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) OR (PCB STREQUAL X7 AND NOT (PCBREV STREQUAL T12)) OR PCB STREQUAL X9LITE)
|
||||
if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X9E OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) OR (PCB STREQUAL X7 AND NOT (PCBREV STREQUAL T12)) OR PCB STREQUAL X9LITE OR PCB STREQUAL X9LITES)
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../../../targets/common/arm/stm32/rotary_encoder_driver.cpp
|
||||
|
||||
@@ -607,6 +607,8 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
return Board::BOARD_X10;
|
||||
#elif defined(PCBX7)
|
||||
return Board::BOARD_TARANIS_X7;
|
||||
#elif defined(PCBX9LITES)
|
||||
return Board::BOARD_TARANIS_X9LITES;
|
||||
#elif defined(PCBX9LITE)
|
||||
return Board::BOARD_TARANIS_X9LITE;
|
||||
#elif defined(PCBTARANIS)
|
||||
|
||||
@@ -136,6 +136,27 @@ elseif(PCB STREQUAL X9LITE)
|
||||
set(LCD_DRIVER lcd_driver_spi.cpp)
|
||||
set(GVAR_SCREEN model_gvars.cpp)
|
||||
set(STATUS_LEDS YES)
|
||||
elseif(PCB STREQUAL X9LITES)
|
||||
set(PXX_FREQUENCY "HIGH")
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x9lites)
|
||||
set(FLAVOUR x9lites)
|
||||
add_definitions(-DBOARD_NAME="x9lites")
|
||||
add_definitions(-DPCBX9LITES -DPCBX9LITE -DPCBX9 -DSOFTWARE_VOLUME -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
add_definitions(-DEEPROM_VARIANT=0x0800)
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
set(PXX2 ON)
|
||||
set(GUI_DIR 128x64)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(BITMAPS_TARGET 9x_bitmaps)
|
||||
set(FONTS_TARGET 9x_fonts_1bit)
|
||||
set(LCD_DRIVER lcd_driver_spi.cpp)
|
||||
set(GVAR_SCREEN model_gvars.cpp)
|
||||
set(STATUS_LEDS YES)
|
||||
elseif(PCB STREQUAL XLITE)
|
||||
set(PXX_FREQUENCY "HIGH" CACHE STRING "PXX frequency (LOW / HIGH)") # always use HIGH except on some prototype boards
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
@@ -190,7 +211,7 @@ if(PCB STREQUAL XLITES)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR PCB STREQUAL X9LITE OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019))
|
||||
if(PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR PCB STREQUAL X9LITE OR PCB STREQUAL X9LITES OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019))
|
||||
add_definitions(-DINTERNAL_MODULE_SERIAL)
|
||||
if(PXX_FREQUENCY STREQUAL HIGH)
|
||||
add_definitions(-DPXX_FREQUENCY_HIGH)
|
||||
@@ -206,14 +227,14 @@ elseif(NOT (PCB STREQUAL X7 AND PCBREV STREQUAL T12))
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL X9E OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) OR (PCB STREQUAL X7 AND NOT (PCBREV STREQUAL T12)) OR PCB STREQUAL X9LITE)
|
||||
if(PCB STREQUAL X9E OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) OR (PCB STREQUAL X7 AND NOT (PCBREV STREQUAL T12)) OR PCB STREQUAL X9LITE OR PCB STREQUAL X9LITES)
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
../common/arm/stm32/rotary_encoder_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019))
|
||||
if(PCB STREQUAL X9E OR PCB STREQUAL X7 OR PCB STREQUAL XLITE OR PCB STREQUAL XLITES OR (PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) OR PCB STREQUAL X9LITES)
|
||||
add_definitions(-DBLUETOOTH)
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
|
||||
@@ -307,17 +307,17 @@ enum EnumSwitchesPositions
|
||||
SW_SD0,
|
||||
SW_SD1,
|
||||
SW_SD2,
|
||||
#if defined(PCBX9) || defined(PCBXLITES)
|
||||
#if defined(PCBX9) || defined(PCBXLITES) || defined(PCBX9LITES)
|
||||
SW_SE0,
|
||||
SW_SE1,
|
||||
SW_SE2,
|
||||
#endif
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || defined(PCBX7) || defined(PCBXLITES)
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || defined(PCBX7) || defined(PCBXLITES) || defined(PCBX9LITES)
|
||||
SW_SF0,
|
||||
SW_SF1,
|
||||
SW_SF2,
|
||||
#endif
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E)
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || defined(PCBX9LITES)
|
||||
SW_SG0,
|
||||
SW_SG1,
|
||||
SW_SG2,
|
||||
@@ -395,6 +395,11 @@ enum EnumSwitchesPositions
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(PCBX9LITES)
|
||||
#define NUM_SWITCHES 7
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 12) + (SWITCH_TOGGLE << 10) + (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0); // S1 = pot with detent
|
||||
#elif defined(PCBX9LITE)
|
||||
#define NUM_SWITCHES 5
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
@@ -766,7 +771,9 @@ void bluetoothInit(uint32_t baudrate, bool enable);
|
||||
void bluetoothWriteWakeup();
|
||||
uint8_t bluetoothIsWriting();
|
||||
void bluetoothDisable();
|
||||
#if defined(PCBX9LITE)
|
||||
#if defined(PCBX9LITES)
|
||||
#define IS_BLUETOOTH_CHIP_PRESENT() (true)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define IS_BLUETOOTH_CHIP_PRESENT() (false)
|
||||
#elif (defined(PCBX7) || defined(PCBXLITE)) && !defined(SIMU)
|
||||
extern volatile uint8_t btChipPresent;
|
||||
|
||||
@@ -448,6 +448,11 @@
|
||||
#elif defined(PCBXLITE)
|
||||
// no SWF but we want to remain compatible with XLiteS
|
||||
#define STORAGE_SWITCH_F
|
||||
#elif defined(PCBX9LITES)
|
||||
#define STORAGE_SWITCH_F
|
||||
#define HARDWARE_SWITCH_F
|
||||
#define SWITCHES_GPIO_REG_F GPIOC->IDR
|
||||
#define SWITCHES_GPIO_PIN_F GPIO_Pin_3 // PC.03
|
||||
#elif defined(PCBX9LITE)
|
||||
// no SWF
|
||||
#elif defined(PCBX7)
|
||||
@@ -469,6 +474,11 @@
|
||||
#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_3 // PF.03
|
||||
#define SWITCHES_GPIO_REG_G_L GPIOF->IDR
|
||||
#define SWITCHES_GPIO_PIN_G_L GPIO_Pin_4 // PF.04
|
||||
#elif defined(PCBX9LITES)
|
||||
#define STORAGE_SWITCH_G
|
||||
#define HARDWARE_SWITCH_G
|
||||
#define SWITCHES_GPIO_REG_G GPIOC->IDR
|
||||
#define SWITCHES_GPIO_PIN_G GPIO_Pin_2 // PC.02
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE)
|
||||
// no SWG
|
||||
#else
|
||||
@@ -635,6 +645,13 @@
|
||||
#define KEYS_GPIOC_PINS (GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_10 | GPIO_Pin_13)
|
||||
#define KEYS_GPIOD_PINS (GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_7 | GPIO_Pin_11 | GPIO_Pin_14 | GPIO_Pin_15)
|
||||
#define KEYS_GPIOE_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15)
|
||||
#elif defined(PCBX9LITES)
|
||||
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE)
|
||||
#define KEYS_GPIOA_PINS (GPIO_Pin_5)
|
||||
#define KEYS_GPIOB_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5)
|
||||
#define KEYS_GPIOC_PINS (GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_13)
|
||||
#define KEYS_GPIOD_PINS (GPIO_Pin_8 | GPIO_Pin_9)
|
||||
#define KEYS_GPIOE_PINS (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14)
|
||||
#elif defined(PCBX9LITE)
|
||||
#define KEYS_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE)
|
||||
#define KEYS_GPIOA_PINS (GPIO_Pin_5)
|
||||
@@ -891,6 +908,14 @@
|
||||
#define LED_RED_GPIO_PIN GPIO_Pin_5 // PC.05
|
||||
#define LED_BLUE_GPIO GPIOB
|
||||
#define LED_BLUE_GPIO_PIN GPIO_Pin_1 // PB.01
|
||||
#elif defined(PCBX9LITES)
|
||||
#define STATUS_LEDS
|
||||
#define GPIO_LED_GPIO_ON GPIO_SetBits
|
||||
#define GPIO_LED_GPIO_OFF GPIO_ResetBits
|
||||
#define LED_RED_GPIO GPIOE
|
||||
#define LED_RED_GPIO_PIN GPIO_Pin_5 // PE.05
|
||||
#define LED_BLUE_GPIO GPIOE
|
||||
#define LED_BLUE_GPIO_PIN GPIO_Pin_6 // PE.06
|
||||
#elif defined(PCBX9LITE)
|
||||
#define STATUS_LEDS
|
||||
#define GPIO_LED_GPIO_ON GPIO_SetBits
|
||||
@@ -1788,7 +1813,7 @@
|
||||
#define BT_TX_GPIO_PinSource GPIO_PinSource14
|
||||
#define BT_RX_GPIO_PinSource GPIO_PinSource9
|
||||
#define BT_USART_IRQHandler USART6_IRQHandler
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || (defined(PCBX9DP) && PCBREV >= 2019)
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITES) || (defined(PCBX9DP) && PCBREV >= 2019)
|
||||
#define STORAGE_BLUETOOTH
|
||||
#define BT_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define BT_RCC_APB2Periph 0
|
||||
@@ -1800,6 +1825,10 @@
|
||||
#define BT_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOE) // RCC_AHB1Periph_DMA1
|
||||
#define BT_EN_GPIO GPIOE
|
||||
#define BT_EN_GPIO_PIN GPIO_Pin_15 // PE.15
|
||||
#elif defined(PCBX9LITES)
|
||||
#define BT_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOD) // RCC_AHB1Periph_DMA1
|
||||
#define BT_EN_GPIO GPIOD
|
||||
#define BT_EN_GPIO_PIN GPIO_Pin_14 // PD.14
|
||||
#else
|
||||
#define BT_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOE) // RCC_AHB1Periph_DMA1
|
||||
#define BT_EN_GPIO GPIOE
|
||||
|
||||
@@ -179,7 +179,12 @@ uint32_t switchState(uint8_t index)
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_3POS_CASE(C, 2);
|
||||
|
||||
#if defined(PCBX9LITE)
|
||||
#if defined(PCBX9LITES)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(G);
|
||||
#elif defined(PCBX9LITE)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_2POS_CASE(E);
|
||||
#elif defined(PCBXLITES)
|
||||
|
||||
Reference in New Issue
Block a user