add screen to IOTS2 and allow no reset pin
This commit is contained in:
parent
a653bd067c
commit
cf2d9ec513
2 changed files with 10 additions and 4 deletions
|
|
@ -57,7 +57,7 @@
|
|||
// TFT Display ST7789
|
||||
//--------------------------------------------------------------------+
|
||||
// #undef CONFIG_LCD_TYPE_AUTO
|
||||
/*
|
||||
|
||||
#define CONFIG_LCD_TYPE_ST7789V
|
||||
|
||||
#define DISPLAY_PIN_MISO -1 //No MISO connected to display.
|
||||
|
|
@ -78,13 +78,13 @@
|
|||
#define DISPLAY_COL_OFFSET 53
|
||||
#define DISPLAY_ROW_OFFSET 40
|
||||
|
||||
#define DISPLAY_TITLE "IOTS2"
|
||||
*/
|
||||
#define DISPLAY_TITLE "IoTS2"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB UF2
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
#define USB_VID 0x303A // Espressif VID
|
||||
#define USB_VID 0x80E7 // Espressif VID
|
||||
#define USB_PID 0x8111 // Espressif assigned PID
|
||||
#define USB_MANUFACTURER "HIIBOT"
|
||||
#define USB_PRODUCT "HiiBot IoTs2"
|
||||
|
|
|
|||
|
|
@ -238,14 +238,18 @@ esp_err_t lcd_init(spi_device_handle_t spi)
|
|||
cfg.pin_bit_mask = (1ull << DISPLAY_PIN_DC);
|
||||
gpio_config(&cfg);
|
||||
|
||||
#if DISPLAY_PIN_RST != -1
|
||||
cfg.pin_bit_mask = (1ull << DISPLAY_PIN_RST);
|
||||
gpio_config(&cfg);
|
||||
#endif
|
||||
|
||||
cfg.pin_bit_mask = (1ull << DISPLAY_PIN_BL);
|
||||
gpio_config(&cfg);
|
||||
|
||||
gpio_set_direction(DISPLAY_PIN_DC, GPIO_MODE_OUTPUT);
|
||||
#if DISPLAY_PIN_RST != -1
|
||||
gpio_set_direction(DISPLAY_PIN_RST, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
gpio_set_direction(DISPLAY_PIN_BL, GPIO_MODE_OUTPUT);
|
||||
|
||||
#ifdef DISPLAY_PIN_POWER
|
||||
|
|
@ -255,10 +259,12 @@ esp_err_t lcd_init(spi_device_handle_t spi)
|
|||
#endif
|
||||
|
||||
/*!< Reset the display */
|
||||
#if DISPLAY_PIN_RST != -1
|
||||
gpio_set_level(DISPLAY_PIN_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
gpio_set_level(DISPLAY_PIN_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
#endif
|
||||
|
||||
int lcd_type;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue