parent
e83487d6b9
commit
1b677d77ae
Binary file not shown.
@ -0,0 +1 @@
|
||||
./memory_T.ld
|
@ -0,0 +1,71 @@
|
||||
#ifndef _TREZOR_T3W1_H
|
||||
#define _TREZOR_T3W1_H
|
||||
|
||||
#define DISPLAY_RESX 240
|
||||
#define DISPLAY_RESY 320
|
||||
|
||||
#define USE_SD_CARD 1
|
||||
#define USE_I2C 1
|
||||
#define USE_TOUCH 1
|
||||
#define USE_BUTTON 1
|
||||
#define USE_SBU 1
|
||||
#define USE_RGB_COLORS 1
|
||||
#define USE_BACKLIGHT 1
|
||||
#define USE_DISP_I8080_16BIT_DW 1
|
||||
|
||||
#define DISPLAY_PANEL_INIT_SEQ lhs200kb_if21_init_seq
|
||||
#define DISPLAY_PANEL_ROTATE lhs200kb_if21_rotate
|
||||
#define TRANSFORM_TOUCH_COORDS lhs200kb_if21_transform_touch_coords
|
||||
|
||||
#include "displays/panels/lhs200kb-if21.h"
|
||||
#include "displays/st7789v.h"
|
||||
|
||||
#define BACKLIGHT_PWM_FREQ 50000
|
||||
#define BACKLIGHT_PWM_TIM TIM1
|
||||
#define BACKLIGHT_PWM_TIM_CLK_EN __HAL_RCC_TIM1_CLK_ENABLE
|
||||
#define BACKLIGHT_PWM_TIM_AF GPIO_AF1_TIM1
|
||||
#define BACKLIGHT_PWM_TIM_OCMODE TIM_OCMODE_PWM2
|
||||
#define BACKLIGHT_PWM_TIM_CHANNEL TIM_CHANNEL_1
|
||||
#define BACKLIGHT_PWM_TIM_CCR CCR1
|
||||
#define BACKLIGHT_PWM_PIN GPIO_PIN_7
|
||||
#define BACKLIGHT_PWM_PORT GPIOA
|
||||
#define BACKLIGHT_PWM_PORT_CLK_EN __HAL_RCC_GPIOA_CLK_ENABLE
|
||||
|
||||
#define I2C_COUNT 1
|
||||
#define I2C_INSTANCE_1 I2C2
|
||||
#define I2C_INSTANCE_1_CLK_EN __HAL_RCC_I2C2_CLK_ENABLE
|
||||
#define I2C_INSTANCE_1_CLK_DIS __HAL_RCC_I2C2_CLK_DISABLE
|
||||
#define I2C_INSTANCE_1_PIN_AF GPIO_AF4_I2C2
|
||||
#define I2C_INSTANCE_1_SDA_PORT GPIOB
|
||||
#define I2C_INSTANCE_1_SDA_PIN GPIO_PIN_11
|
||||
#define I2C_INSTANCE_1_SDA_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE
|
||||
#define I2C_INSTANCE_1_SCL_PORT GPIOB
|
||||
#define I2C_INSTANCE_1_SCL_PIN GPIO_PIN_10
|
||||
#define I2C_INSTANCE_1_SCL_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE
|
||||
#define I2C_INSTANCE_1_RESET_FLG RCC_APB1RSTR_I2C2RST
|
||||
|
||||
#define TOUCH_I2C_NUM 0
|
||||
#define TOUCH_RST_PORT GPIOC
|
||||
#define TOUCH_RST_PIN GPIO_PIN_5
|
||||
#define TOUCH_INT_PORT GPIOC
|
||||
#define TOUCH_INT_PIN GPIO_PIN_4
|
||||
#define TOUCH_ON_PORT GPIOB
|
||||
#define TOUCH_ON_PIN GPIO_PIN_8
|
||||
|
||||
#define SD_DETECT_PORT GPIOB
|
||||
#define SD_DETECT_PIN GPIO_PIN_0
|
||||
#define SD_ENABLE_PORT GPIOE
|
||||
#define SD_ENABLE_PIN GPIO_PIN_1
|
||||
|
||||
#define GPIO_1_PORT GPIOC
|
||||
#define GPIO_1_PIN GPIO_PIN_1
|
||||
#define GPIO_2_PORT GPIOC
|
||||
#define GPIO_2_PIN GPIO_PIN_6
|
||||
#define GPIO_3_PORT GPIOC
|
||||
#define GPIO_3_PIN GPIO_PIN_7
|
||||
|
||||
#define BTN_POWER_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE
|
||||
#define BTN_POWER_PORT GPIOE
|
||||
#define BTN_POWER_PIN GPIO_PIN_0
|
||||
|
||||
#endif //_TREZOR_T3W1_H
|
@ -0,0 +1,151 @@
|
||||
|
||||
#include TREZOR_BOARD
|
||||
#include "display_interface.h"
|
||||
#include "displays/st7789v.h"
|
||||
#include "touch.h"
|
||||
|
||||
void lhs200kb_if21_init_seq() {
|
||||
CMD(0x36);
|
||||
DATA(0x00);
|
||||
|
||||
CMD(0x35);
|
||||
DATA(0x00);
|
||||
|
||||
CMD(0x3A);
|
||||
DATA(0x05);
|
||||
|
||||
CMD(0xB2);
|
||||
DATA(0x0C);
|
||||
DATA(0x0C);
|
||||
DATA(0x00);
|
||||
DATA(0x33);
|
||||
DATA(0x33);
|
||||
|
||||
CMD(0xB7);
|
||||
DATA(0x78);
|
||||
|
||||
CMD(0xBB);
|
||||
DATA(0x2F);
|
||||
|
||||
CMD(0xC0);
|
||||
DATA(0x2C);
|
||||
|
||||
CMD(0xC2);
|
||||
DATA(0x01);
|
||||
|
||||
CMD(0xC3);
|
||||
DATA(0x19);
|
||||
|
||||
CMD(0xC4);
|
||||
DATA(0x20);
|
||||
|
||||
CMD(0xC6);
|
||||
DATA(0x0F);
|
||||
|
||||
CMD(0xD0);
|
||||
DATA(0xA4);
|
||||
DATA(0xA1);
|
||||
|
||||
CMD(0xD6);
|
||||
DATA(0xA1);
|
||||
|
||||
CMD(0xE0);
|
||||
DATA(0xF0);
|
||||
DATA(0x08);
|
||||
DATA(0x0F);
|
||||
DATA(0x0B);
|
||||
DATA(0x0B);
|
||||
DATA(0x07);
|
||||
DATA(0x34);
|
||||
DATA(0x43);
|
||||
DATA(0x4B);
|
||||
DATA(0x38);
|
||||
DATA(0x14);
|
||||
DATA(0x13);
|
||||
DATA(0x2C);
|
||||
DATA(0x31);
|
||||
|
||||
CMD(0xE1);
|
||||
DATA(0xF0);
|
||||
DATA(0x0C);
|
||||
DATA(0x11);
|
||||
DATA(0x09);
|
||||
DATA(0x08);
|
||||
DATA(0x24);
|
||||
DATA(0x34);
|
||||
DATA(0x33);
|
||||
DATA(0x4A);
|
||||
DATA(0x3A);
|
||||
DATA(0x16);
|
||||
DATA(0x16);
|
||||
DATA(0x2E);
|
||||
DATA(0x32);
|
||||
|
||||
CMD(0x21);
|
||||
|
||||
CMD(0x29);
|
||||
}
|
||||
|
||||
void lhs200kb_if21_rotate(int degrees, buffer_offset_t* offset) {
|
||||
uint16_t shift = 0;
|
||||
char BX = 0, BY = 0;
|
||||
|
||||
#define RGB (1 << 3)
|
||||
#define ML (1 << 4) // vertical refresh order
|
||||
#define MH (1 << 2) // horizontal refresh order
|
||||
#define MV (1 << 5)
|
||||
#define MX (1 << 6)
|
||||
#define MY (1 << 7)
|
||||
// MADCTL: Memory Data Access Control - reference:
|
||||
// section 8.12 in the ST7789V manual
|
||||
uint8_t display_command_parameter = 0;
|
||||
switch (degrees) {
|
||||
case 0:
|
||||
display_command_parameter = 0;
|
||||
BY = 0;
|
||||
break;
|
||||
case 90:
|
||||
display_command_parameter = MV | MX | MH | ML;
|
||||
BX = 1;
|
||||
shift = 1;
|
||||
break;
|
||||
case 180:
|
||||
display_command_parameter = MX | MY | MH | ML;
|
||||
BY = 0;
|
||||
shift = 1;
|
||||
break;
|
||||
case 270:
|
||||
display_command_parameter = MV | MY;
|
||||
BX = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
CMD(0x36);
|
||||
DATA(display_command_parameter);
|
||||
|
||||
if (shift) {
|
||||
// GATECTRL: Gate Control; NL = 320 gate lines, first scan line is
|
||||
// gate 0.; gate scan direction 319 -> 0
|
||||
CMD(0xE4);
|
||||
DATA(0x27);
|
||||
DATA(0x00);
|
||||
DATA(0x10);
|
||||
} else {
|
||||
// GATECTRL: Gate Control; NL = 320 gate lines, first scan line is
|
||||
// gate 0.; gate scan direction 319 -> 0
|
||||
CMD(0xE4);
|
||||
DATA(0x27);
|
||||
DATA(0x00);
|
||||
DATA(0x10);
|
||||
}
|
||||
|
||||
// reset the column and page extents
|
||||
display_set_window(0, 0, DISPLAY_RESX - 1, DISPLAY_RESY - 1);
|
||||
|
||||
offset->x = BX ? (MAX_DISPLAY_RESY - DISPLAY_RESY) : 0;
|
||||
offset->y = BY ? (MAX_DISPLAY_RESY - DISPLAY_RESY) : 0;
|
||||
}
|
||||
|
||||
uint32_t lhs200kb_if21_transform_touch_coords(uint16_t x, uint16_t y) {
|
||||
return touch_pack_xy(y, MAX_DISPLAY_RESY - x);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
|
||||
#ifndef CORE_LHS200KB_IF21_H
|
||||
#define CORE_LHS200KB_IF21_H
|
||||
// ST7789_V IC controller
|
||||
|
||||
#include "displays/st7789v.h"
|
||||
|
||||
void lhs200kb_if21_init_seq(void);
|
||||
void lhs200kb_if21_rotate(int degrees, buffer_offset_t* offset);
|
||||
uint32_t lhs200kb_if21_transform_touch_coords(uint16_t x, uint16_t y);
|
||||
|
||||
#endif // CORE_LHS200KB_IF21_H
|
@ -1,7 +1,11 @@
|
||||
#ifndef LX154A2422_H_
|
||||
#define LX154A2422_H_
|
||||
|
||||
#include "displays/st7789v.h"
|
||||
|
||||
void lx154a2422_init_seq(void);
|
||||
void lx154a2422_gamma(void);
|
||||
void lx154a2422_rotate(int degrees, buffer_offset_t* offset);
|
||||
uint32_t lx154a2422_transform_touch_coords(uint16_t x, uint16_t y);
|
||||
|
||||
#endif
|
||||
|
@ -1,8 +1,9 @@
|
||||
#ifndef TT_OLD1_H_
|
||||
#define TT_OLD1_H_
|
||||
#ifndef TF15411A_H_
|
||||
#define TF15411A_H_
|
||||
|
||||
// GC9307 IC controller
|
||||
|
||||
void tf15411a_init_seq(void);
|
||||
void tf15411a_rotate(int degrees, buffer_offset_t* offset);
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"header_len": 4608,
|
||||
"text": "DEV ONLY, DO NOT USE!",
|
||||
"hw_model": null,
|
||||
"expiry": 0,
|
||||
"version": [0, 0],
|
||||
"sig_m": 2,
|
||||
"trust": {
|
||||
"allow_run_with_secret": false,
|
||||
"show_vendor_string": false,
|
||||
"require_user_click": false,
|
||||
"red_background": false,
|
||||
"delay": 0
|
||||
},
|
||||
"pubkeys": [
|
||||
"e28a8970753332bd72fef413e6b0b2ef1b4aadda7aa2c141f233712a6876b351",
|
||||
"d4eec1869fb1b8a4e817516ad5a931557cb56805c3eb16e8f3a803d647df7869",
|
||||
"772c8a442b7db06e166cfbc1ccbcbcde6f3eba76a4e98ef3ffc519502237d6ef"
|
||||
]
|
||||
}
|
Binary file not shown.
@ -0,0 +1,20 @@
|
||||
{
|
||||
"header_len": 4608,
|
||||
"text": "UNSAFE, DO NOT USE!",
|
||||
"hw_model": "T3W1",
|
||||
"expiry": 0,
|
||||
"version": [0, 1],
|
||||
"sig_m": 2,
|
||||
"trust": {
|
||||
"allow_run_with_secret": false,
|
||||
"show_vendor_string": true,
|
||||
"require_user_click": true,
|
||||
"red_background": true,
|
||||
"delay": 1
|
||||
},
|
||||
"pubkeys": [
|
||||
"e28a8970753332bd72fef413e6b0b2ef1b4aadda7aa2c141f233712a6876b351",
|
||||
"d4eec1869fb1b8a4e817516ad5a931557cb56805c3eb16e8f3a803d647df7869",
|
||||
"772c8a442b7db06e166cfbc1ccbcbcde6f3eba76a4e98ef3ffc519502237d6ef"
|
||||
]
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue