Skip to content

Commit

Permalink
Allow Touch Screen Mod on Horus X10 Transmitters
Browse files Browse the repository at this point in the history
  • Loading branch information
MRC3742 committed Oct 2, 2023
1 parent e84a365 commit bd76f25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
7 changes: 3 additions & 4 deletions radio/src/targets/horus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ set(AUX_SERIAL ON)
# IMU support
set(IMU ON)

# Touch Screen support
set(HARDWARE_TOUCH YES)

if (PCB STREQUAL X10)
set(PCBREV "STD" CACHE STRING "PCB Revision")
add_definitions(-DSOFTWARE_VOLUME)
Expand Down Expand Up @@ -87,7 +90,6 @@ if (PCB STREQUAL X10)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
option(INTERNAL_GPS "Support for internal NMEA GPS" ON)
set(HARDWARE_TOUCH YES)
add_definitions(-DMANUFACTURER_JUMPER)
if (NOT BLUETOOTH)
set(AUX2_SERIAL ON)
Expand All @@ -102,7 +104,6 @@ if (PCB STREQUAL X10)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
option(INTERNAL_GPS "Support for internal NMEA GPS" ON)
set(HARDWARE_TOUCH YES)
set(SWSERIALPOWER YES)
set(USB_CHARGER YES)
set(DEFAULT_THEME "DARKBLUE")
Expand All @@ -120,7 +121,6 @@ if (PCB STREQUAL X10)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
option(INTERNAL_GPS "Support for internal NMEA GPS" ON)
set(HARDWARE_TOUCH YES)
add_definitions(-DMANUFACTURER_JUMPER)
if (NOT BLUETOOTH)
set(AUX2_SERIAL ON)
Expand All @@ -134,7 +134,6 @@ if (PCB STREQUAL X10)
add_definitions(-DMANUFACTURER_FRSKY)
endif()
elseif (PCB STREQUAL X12S)
set(HARDWARE_TOUCH YES)
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
set(FLAVOUR x12s)
set(BLUETOOTH ON)
Expand Down
22 changes: 12 additions & 10 deletions radio/src/targets/horus/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,12 @@

// PCBREV
#if defined(PCBX10)
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8)
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOA
#define PCBREV_GPIO GPIOH
#define PCBREV_VALUE() (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1))
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8) // PH.07 | PH.08
#define PCBREV_TOUCH_GPIO GPIOA
#define PCBREV_TOUCH_GPIO_PIN GPIO_Pin_6 // PA.06
#define PCBREV_VALUE() ((GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1)) * GPIO_ReadInputDataBit(PCBREV_TOUCH_GPIO, GPIO_Pin_6))
#else
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
#define PCBREV_GPIO GPIOI
Expand Down Expand Up @@ -737,18 +739,18 @@
#endif // HARDWARE_TOUCH

// First I2C Bus
#if defined(RADIO_T18) || defined(RADIO_T16)
#define I2C_B1 I2C3
#define I2C_B1_GPIO GPIOH
#define I2C_B1_SCL_GPIO_PIN LL_GPIO_PIN_7 // PH.07
#define I2C_B1_SDA_GPIO_PIN LL_GPIO_PIN_8 // PH.08
#define I2C_B1_GPIO_AF LL_GPIO_AF_4 // I2C3
#else
#if defined(RADIO_TX16S) || defined(PCBX12S)
#define I2C_B1 I2C1
#define I2C_B1_GPIO GPIOB
#define I2C_B1_SCL_GPIO_PIN LL_GPIO_PIN_8 // PB.08
#define I2C_B1_SDA_GPIO_PIN LL_GPIO_PIN_9 // PB.09
#define I2C_B1_GPIO_AF LL_GPIO_AF_4 // I2C1
#else
#define I2C_B1 I2C3
#define I2C_B1_GPIO GPIOH
#define I2C_B1_SCL_GPIO_PIN LL_GPIO_PIN_7 // PH.07
#define I2C_B1_SDA_GPIO_PIN LL_GPIO_PIN_8 // PH.08
#define I2C_B1_GPIO_AF LL_GPIO_AF_4 // I2C3
#endif

// Second I2C Bus
Expand Down

0 comments on commit bd76f25

Please sign in to comment.