add display power, fix changed CS pin
This commit is contained in:
parent
27ea402059
commit
d984615ef0
2 changed files with 12 additions and 3 deletions
|
|
@ -69,12 +69,15 @@
|
|||
#define DISPLAY_PIN_MOSI 35
|
||||
#define DISPLAY_PIN_SCK 36
|
||||
|
||||
#define DISPLAY_PIN_CS 21
|
||||
#define DISPLAY_PIN_CS 7
|
||||
#define DISPLAY_PIN_DC 39
|
||||
#define DISPLAY_PIN_RST 40
|
||||
|
||||
#define DISPLAY_PIN_BL 45
|
||||
#define DISPLAY_BL_ON 1 // GPIO state to enable back light
|
||||
#define DISPLAY_PIN_BL 45
|
||||
#define DISPLAY_BL_ON 1 // GPIO state to enable back light
|
||||
|
||||
#define DISPLAY_PIN_POWER 21
|
||||
#define DISPLAY_POWER_ON 1 // GPIO state to enable TFT
|
||||
|
||||
#define DISPLAY_WIDTH 240
|
||||
#define DISPLAY_HEIGHT 135
|
||||
|
|
|
|||
|
|
@ -248,6 +248,12 @@ esp_err_t lcd_init(spi_device_handle_t spi)
|
|||
gpio_set_direction(DISPLAY_PIN_RST, GPIO_MODE_OUTPUT);
|
||||
gpio_set_direction(DISPLAY_PIN_BL, GPIO_MODE_OUTPUT);
|
||||
|
||||
#ifdef DISPLAY_PIN_POWER
|
||||
/*!< /Enable display */
|
||||
gpio_set_direction(DISPLAY_PIN_POWER, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(DISPLAY_PIN_POWER, DISPLAY_POWER_ON);
|
||||
#endif
|
||||
|
||||
/*!< Reset the display */
|
||||
gpio_set_level(DISPLAY_PIN_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue