MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / createPanelHandle

Method createPanelHandle

Drivers/GC9A01/Source/Gc9a01Display.cpp:46–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool Gc9a01Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
47 const esp_lcd_panel_dev_config_t panel_config = {
48 .reset_gpio_num = configuration->resetPin,
49 .rgb_ele_order = configuration->rgbElementOrder,
50 .data_endian = LCD_RGB_DATA_ENDIAN_LITTLE,
51 .bits_per_pixel = 16,
52 .flags = {
53 .reset_active_high = false
54 },
55 .vendor_config = nullptr
56 };
57
58 if (esp_lcd_new_panel_gc9a01(ioHandle, &panel_config, &panelHandle) != ESP_OK) {
59 LOGGER.error("Failed to create panel");
60 return false;
61 }
62
63 if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
64 LOGGER.error("Failed to reset panel");
65 return false;
66 }
67
68 if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
69 LOGGER.error("Failed to init panel");
70 return false;
71 }
72
73 if (esp_lcd_panel_swap_xy(panelHandle, configuration->swapXY) != ESP_OK) {
74 LOGGER.error("Failed to swap XY ");
75 return false;
76 }
77
78 if (esp_lcd_panel_mirror(panelHandle, configuration->mirrorX, configuration->mirrorY) != ESP_OK) {
79 LOGGER.error("Failed to set panel to mirror");
80 return false;
81 }
82
83 if (esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
84 LOGGER.error("Failed to set panel to invert");
85 return false;
86 }
87
88 if (esp_lcd_panel_disp_on_off(panelHandle, true) != ESP_OK) {
89 LOGGER.error("Failed to turn display on");
90 return false;
91 }
92
93 return true;
94}
95
96lvgl_port_display_cfg_t Gc9a01Display::getLvglPortDisplayConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
97 return lvgl_port_display_cfg_t {

Callers

nothing calls this directly

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected