Skip to content

Commit

Permalink
feat: Jumper T15 IPS screen support (#5115)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored Jun 5, 2024
1 parent 1b3b579 commit e1baade
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
7 changes: 6 additions & 1 deletion radio/src/gui/colorlcd/radio_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "options.h"
#include "libopenui.h"
#include "fw_version.h"
#include "hal/module_port.h"

#if defined(CROSSFIRE)
#include "mixer_scheduler.h"
Expand Down Expand Up @@ -360,6 +359,12 @@ void RadioVersionPage::build(FormWindow * window)
version += options[i];
}

#if defined(RADIO_T15) && !defined(SIMU)
version += nl;
version += "PCBREV: ";
version += version += '0' + static_cast<char>(hardwareOptions.pcbrev);
#endif

#if (defined(PCBNV14) || defined(PCBPL18)) && !defined(SIMU)
version += nl;
version += "LCD: ";
Expand Down
4 changes: 4 additions & 0 deletions radio/src/targets/horus/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ enum {
// X10
PCBREV_X10_STD = 0,
PCBREV_X10_EXPRESS = 3,

//T15
PCBREV_T15_STD = 0,
PCBREV_T15_IPS = 1,
};

#if defined(SIMU)
Expand Down
12 changes: 8 additions & 4 deletions radio/src/targets/horus/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,21 +555,25 @@
#endif

// PCBREV
#if defined(MANUFACTURER_FRSKY)
#if defined(PCBX10)
#if defined(RADIO_T15)
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOA
#define PCBREV_GPIO GPIOH
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8) // PH.07 | PH.08
#define PCBREV_VALUE() (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1))
#define LL_PCBREV_VALUE() (LL_GPIO_IsInputPinSet(PCBREV_GPIO, GPIO_PIN_7) + (LL_GPIO_IsInputPinSet(PCBREV_GPIO, GPIO_PIN_8) << 1))
#elif defined(PCBX10) && defined(MANUFACTURER_FRSKY)
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOA
#define PCBREV_GPIO GPIOH
#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_TOUCH_GPIO_PULL_UP
#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
#elif defined(MANUFACTURER_FRSKY)
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
#define PCBREV_GPIO GPIOI
#define PCBREV_GPIO_PIN GPIO_Pin_11 // PI.11
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
#endif
#else
#define PCBREV_RCC_AHB1Periph 0
#endif
Expand Down
6 changes: 6 additions & 0 deletions radio/src/targets/horus/lcd_st7796s_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "debug.h"
#include "lcd.h"
#include "lcd_st7796s_driver.h"
#include "hal.h"

static LTDC_HandleTypeDef hltdc;
static void* initialFrameBuffer = nullptr;
Expand Down Expand Up @@ -302,6 +303,11 @@ void LCD_ST7796S_Init(void) {

delay_ms(120);

#if defined(RADIO_T15)
if (LL_PCBREV_VALUE() == 1) // 0: TFT, 1: IPS
lcdWriteCommand( 0x21 );
#endif

LCD_ST7796S_On();
}

Expand Down

0 comments on commit e1baade

Please sign in to comment.