nopnop2002 / esp-idf-st7789

ST7789 Driver for esp-idf
MIT License
234 stars 56 forks source link

TFT backlight not powered on for Lilygo TTGO T-Watch-2020 #14

Closed beoran closed 3 years ago

beoran commented 3 years ago

I am trying to use your library with a Lilygo TTGO T-Watch-2020 https://www.tindie.com/products/ttgo/lilygor-ttgo-t-watch-2020/ I am using the correct pins and I tried several SPI frequencies but the display is not powered on, even if I set the backlight pin.

The lvgl esp32 port here: https://github.com/lvgl/lv_port_esp32/blob/master/components/lvgl_esp32_drivers/lvgl_tft/st7789.c does work correctly, so I assume something is wrong with the device initialization. How could I find out what is going wrong?

beoran commented 3 years ago

It turns out that the backlight IO pin needs to be configured before use with gpio_pad_select_gpio(CONFIG_BL_GPIO); gpio_set_direction(CONFIG_BL_GPIO, GPIO_MODE_OUTPUT); (both are required) The lvgl esp32 does this automatically, perhaps it should be added to this library as well? Shall I make a PR?

beoran commented 3 years ago

I made #15 for this. Please consider it.

nopnop2002 commented 3 years ago

Thank you for PR. I have merged your PR.

beoran commented 3 years ago

Closing this issue since the PR was merged.