Update TFT drivers for new backligh control
This commit is contained in:
parent
fa042b0ecd
commit
3c4399d510
22 changed files with 43 additions and 437 deletions
|
@ -80,14 +80,7 @@ void ili9481_init(void)
|
|||
#if ILI9481_USE_RST
|
||||
gpio_pad_select_gpio(ILI9481_RST);
|
||||
gpio_set_direction(ILI9481_RST, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
#if ILI9481_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ILI9481_BCKL);
|
||||
gpio_set_direction(ILI9481_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
#if ILI9481_USE_RST
|
||||
//Reset the display
|
||||
gpio_set_level(ILI9481_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
|
@ -112,8 +105,6 @@ void ili9481_init(void)
|
|||
cmd++;
|
||||
}
|
||||
|
||||
ili9481_enable_backlight(true);
|
||||
|
||||
ili9481_set_orientation(ILI9481_DISPLAY_ORIENTATION);
|
||||
}
|
||||
|
||||
|
@ -173,22 +164,6 @@ void ili9481_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
|
|||
heap_caps_free(mybuf);
|
||||
}
|
||||
|
||||
void ili9481_enable_backlight(bool backlight)
|
||||
{
|
||||
#if ILI9481_ENABLE_BACKLIGHT_CONTROL
|
||||
ESP_LOGI(TAG, "%s backlight.", backlight ? "Enabling" : "Disabling");
|
||||
uint32_t tmp = 0;
|
||||
|
||||
#if (ILI9481_BCKL_ACTIVE_LVL==1)
|
||||
tmp = backlight ? 1 : 0;
|
||||
#else
|
||||
tmp = backlight ? 0 : 1;
|
||||
#endif
|
||||
|
||||
gpio_set_level(ILI9481_BCKL, tmp);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue