| 10 | static const auto LOGGER = tt::Logger("ST7735"); |
| 11 | |
| 12 | bool St7735Display::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) { |
| 13 | LOGGER.info("Starting"); |
| 14 | |
| 15 | const esp_lcd_panel_io_spi_config_t panel_io_config = { |
| 16 | .cs_gpio_num = configuration->csPin, |
| 17 | .dc_gpio_num = configuration->dcPin, |
| 18 | .spi_mode = 0, |
| 19 | .pclk_hz = configuration->pixelClockFrequency, |
| 20 | .trans_queue_depth = configuration->transactionQueueDepth, |
| 21 | .on_color_trans_done = nullptr, |
| 22 | .user_ctx = nullptr, |
| 23 | .lcd_cmd_bits = 8, |
| 24 | .lcd_param_bits = 8, |
| 25 | .cs_ena_pretrans = 0, |
| 26 | .cs_ena_posttrans = 0, |
| 27 | .flags = { |
| 28 | .dc_high_on_cmd = 0, |
| 29 | .dc_low_on_data = 0, |
| 30 | .dc_low_on_param = 0, |
| 31 | .octal_mode = 0, |
| 32 | .quad_mode = 0, |
| 33 | .sio_mode = 1, |
| 34 | .lsb_first = 0, |
| 35 | .cs_high_active = 0 |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | if (esp_lcd_new_panel_io_spi(configuration->spiHostDevice, &panel_io_config, &outHandle) != ESP_OK) { |
| 40 | LOGGER.error("Failed to create panel"); |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | bool St7735Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) { |
| 48 | |