Update TFT drivers for new backligh control

This commit is contained in:
Tomas Rezucha 2021-08-03 14:17:58 +02:00
parent fa042b0ecd
commit 3c4399d510
22 changed files with 43 additions and 437 deletions

View file

@ -76,20 +76,13 @@ void ili9488_init(void)
};
//Initialize non-SPI GPIOs
gpio_pad_select_gpio(ILI9488_DC);
gpio_pad_select_gpio(ILI9488_DC);
gpio_set_direction(ILI9488_DC, GPIO_MODE_OUTPUT);
#if ILI9488_USE_RST
gpio_pad_select_gpio(ILI9488_RST);
gpio_pad_select_gpio(ILI9488_RST);
gpio_set_direction(ILI9488_RST, GPIO_MODE_OUTPUT);
#endif
#if ILI9488_ENABLE_BACKLIGHT_CONTROL
gpio_pad_select_gpio(ILI9488_BCKL);
gpio_set_direction(ILI9488_BCKL, GPIO_MODE_OUTPUT);
#endif
#if ILI9488_USE_RST
//Reset the display
gpio_set_level(ILI9488_RST, 0);
vTaskDelay(100 / portTICK_RATE_MS);
@ -114,9 +107,7 @@ void ili9488_init(void)
cmd++;
}
ili9488_enable_backlight(true);
ili9488_set_orientation(CONFIG_LV_DISPLAY_ORIENTATION);
ili9488_set_orientation(CONFIG_LV_DISPLAY_ORIENTATION);
}
// Flush function based on mvturnho repo
@ -175,22 +166,6 @@ void ili9488_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
heap_caps_free(mybuf);
}
void ili9488_enable_backlight(bool backlight)
{
#if ILI9488_ENABLE_BACKLIGHT_CONTROL
ESP_LOGI(TAG, "%s backlight.", backlight ? "Enabling" : "Disabling");
uint32_t tmp = 0;
#if (ILI9488_BCKL_ACTIVE_LVL==1)
tmp = backlight ? 1 : 0;
#else
tmp = backlight ? 0 : 1;
#endif
gpio_set_level(ILI9488_BCKL, tmp);
#endif
}
/**********************
* STATIC FUNCTIONS
**********************/