mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 21:48:13 +00:00
new init sequence for display
This commit is contained in:
parent
b68423a325
commit
8b22a38bce
@ -133,7 +133,7 @@ static void display_unsleep(void) {
|
|||||||
#if DISPLAY_ILI9341V || DISPLAY_ST7789V
|
#if DISPLAY_ILI9341V || DISPLAY_ST7789V
|
||||||
CMD(0x11); // exit sleep
|
CMD(0x11); // exit sleep
|
||||||
HAL_Delay(20);
|
HAL_Delay(20);
|
||||||
CMD(0x29); // display
|
CMD(0x29); // display on
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ void display_init(void) {
|
|||||||
HAL_Delay(20);
|
HAL_Delay(20);
|
||||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_SET);
|
||||||
HAL_Delay(5);
|
HAL_Delay(5);
|
||||||
#if DISPLAY_ILI9341V || DISPLAY_ST7789V
|
#if DISPLAY_ILI9341V
|
||||||
CMD(0x01); // software reset
|
CMD(0x01); // software reset
|
||||||
HAL_Delay(20);
|
HAL_Delay(20);
|
||||||
CMD(0x28); // display off
|
CMD(0x28); // display off
|
||||||
@ -160,26 +160,30 @@ void display_init(void) {
|
|||||||
CMD(0xC7); DATA(0x8A); // vcm control 2
|
CMD(0xC7); DATA(0x8A); // vcm control 2
|
||||||
CMD(0x3A); DATA(0x55); // memory access control (16-bit 565)
|
CMD(0x3A); DATA(0x55); // memory access control (16-bit 565)
|
||||||
CMD(0xB1); DATAS("\x00\x18", 2); // framerate
|
CMD(0xB1); DATAS("\x00\x18", 2); // framerate
|
||||||
#endif
|
|
||||||
#if DISPLAY_ILI9341V
|
|
||||||
CMD(0xB6); DATAS("\x0A\xA2", 2); // display function control
|
CMD(0xB6); DATAS("\x0A\xA2", 2); // display function control
|
||||||
CMD(0xF6); DATAS("\x01\x30\x00", 3); // interface control
|
CMD(0xF6); DATAS("\x01\x30\x00", 3); // interface control
|
||||||
CMD(0xF2); DATA(0x00); // 3 gamma func disable
|
CMD(0xF2); DATA(0x00); // 3 gamma func disable
|
||||||
#endif
|
|
||||||
#if DISPLAY_ILI9341V
|
|
||||||
CMD(0x26); DATA(0x01); // gamma func enable
|
CMD(0x26); DATA(0x01); // gamma func enable
|
||||||
CMD(0xE0); DATAS("\x0F\x2F\x2C\x0B\x0F\x09\x56\xD9\x4A\x0B\x14\x05\x0C\x06\x00", 15); // gamma curve 1
|
CMD(0xE0); DATAS("\x0F\x2F\x2C\x0B\x0F\x09\x56\xD9\x4A\x0B\x14\x05\x0C\x06\x00", 15); // gamma curve 1
|
||||||
CMD(0xE1); DATAS("\x00\x10\x13\x04\x10\x06\x25\x26\x3B\x04\x0B\x0A\x33\x39\x0F", 15); // gamma curve 2
|
CMD(0xE1); DATAS("\x00\x10\x13\x04\x10\x06\x25\x26\x3B\x04\x0B\x0A\x33\x39\x0F", 15); // gamma curve 2
|
||||||
#endif
|
|
||||||
#if DISPLAY_ST7789V
|
|
||||||
CMD(0x26); DATA(0x01); // gamma func enable
|
|
||||||
CMD(0xE0); DATAS("\x70\x2C\x2E\x15\x10\x09\x48\x33\x53\x0B\x19\x18\x20\x25", 14); // gamma curve 1
|
|
||||||
CMD(0xE1); DATAS("\x70\x2C\x2E\x15\x10\x09\x48\x33\x53\x0B\x19\x18\x20\x25", 14); // gamma curve 2
|
|
||||||
#endif
|
|
||||||
#if DISPLAY_ILI9341V
|
|
||||||
CMD(0x21); // invert colors
|
CMD(0x21); // invert colors
|
||||||
#endif
|
#endif
|
||||||
#if DISPLAY_ST7789V
|
#if DISPLAY_ST7789V
|
||||||
|
CMD(0x01); // software reset
|
||||||
|
HAL_Delay(20);
|
||||||
|
CMD(0x28); // display off
|
||||||
|
CMD(0x3A); DATA(0x55); // COLMOD: Interface Pixel format
|
||||||
|
CMD(0xB2); DATA("\x0C\x0C\x00\x33\x33"); // PORCTRK: Porch setting
|
||||||
|
CMD(0xB7); DATA(0x35); // GCTRL: Gate Control
|
||||||
|
CMD(0xBB); DATA(0x2B); // VCOMS: VCOM setting
|
||||||
|
CMD(0xC0); DATA(0x2C); // LCMCTRL: LCM Control
|
||||||
|
CMD(0xC2); DATA("\x01\xFF"); // VDVVRHEN: VDV and VRH Command Enable
|
||||||
|
CMD(0xC3); DATA(0x11); // VRHS: VRH Set
|
||||||
|
CMD(0xC4); DATA(0x20); // VDVS: VDV Set
|
||||||
|
CMD(0xC6); DATA(0x0F); // FRCTRL2: Frame Rate control in normal mode
|
||||||
|
CMD(0xD0); DATAS("\xA4\xA1"); // PWCTRL1: Power Control 1
|
||||||
|
CMD(0xE0); DATAS("\x70\x2C\x2E\x15\x10\x09\x48\x33\x53\x0B\x19\x18\x20\x25", 14); // gamma curve 1
|
||||||
|
CMD(0xE1); DATAS("\x70\x2C\x2E\x15\x10\x09\x48\x33\x53\x0B\x19\x18\x20\x25", 14); // gamma curve 2
|
||||||
CMD(0x20); // don't invert colors
|
CMD(0x20); // don't invert colors
|
||||||
#endif
|
#endif
|
||||||
display_orientation(0);
|
display_orientation(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user