From 562ee338b1e36697519b7410ad4d731dd21b64be Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 25 Feb 2020 10:34:18 +0100 Subject: [PATCH] Touch GPIO def --- radio/src/targets/horus/board.cpp | 2 ++ radio/src/targets/horus/hal.h | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/radio/src/targets/horus/board.cpp b/radio/src/targets/horus/board.cpp index abdde2106..3e8ad4752 100644 --- a/radio/src/targets/horus/board.cpp +++ b/radio/src/targets/horus/board.cpp @@ -95,6 +95,7 @@ void boardInit() HAPTIC_RCC_AHB1Periph | INTMODULE_RCC_AHB1Periph | EXTMODULE_RCC_AHB1Periph | + I2C_TOUCH_RCC_AHB1Periph | GPS_RCC_AHB1Periph | SPORT_UPDATE_RCC_AHB1Periph, ENABLE); @@ -110,6 +111,7 @@ void boardInit() AUDIO_RCC_APB1Periph | INTMODULE_RCC_APB1Periph | EXTMODULE_RCC_APB1Periph | + I2C_TOUCH_RCC_APB1Periph | GPS_RCC_APB1Periph | BACKLIGHT_RCC_APB1Periph, ENABLE); diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index 350ca595e..293759f21 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -835,6 +835,24 @@ #define TIMER_2MHz_RCC_APB1Periph RCC_APB1Periph_TIM7 #define TIMER_2MHz_TIMER TIM7 +// Touch +#if defined(TOUCHPANEL) +#define I2C_TOUCH_RCC_AHB1Periph RCC_AHB1Periph_GPIOB +#define I2C_TOUCH_RCC_APB1Periph RCC_APB1Periph_I2C1 +#define I2C_TOUCH I2C1 +#define I2C_TOUCH_GPIO GPIOB +#define I2C_TOUCH_SCL_GPIO_PIN GPIO_Pin_8 // PB.08 +#define I2C_TOUCH_SDA_GPIO_PIN GPIO_Pin_7 // PB.07 + +#define I2C_TOUCH_RESET_GPIO GPIOF +#define I2C_TOUCH_RESET_GPIO_PIN GPIO_Pin_10 // PF.10 +#define I2C_TOUCH_INT_GPIO GPIOH +#define I2C_TOUCH_INT_GPIO_PIN GPIO_Pin_3 // PH.03 +#else +#define I2C_TOUCH_RCC_AHB1Periph 0 +#define I2C_TOUCH_RCC_APB1Periph 0 +#endif + // Bluetooth #define STORAGE_BLUETOOTH #if defined(BLUETOOTH)