Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Jumper T15 IPS screen support #5115

Merged
merged 6 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions radio/src/gui/colorlcd/radio_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "libopenui.h"
#include "fw_version.h"
#include "hal/module_port.h"
#include "hal.h"
3djc marked this conversation as resolved.
Show resolved Hide resolved

#if defined(CROSSFIRE)
#include "mixer_scheduler.h"
Expand Down Expand Up @@ -360,6 +361,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