lvgl_esp32_drivers/lv_port/display_espressif_hal.c

42 lines
774 B
C
Raw Normal View History

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "display_hal.h"
#include "sdkconfig.h"
#include "driver/gpio.h"
2021-08-26 23:51:35 +00:00
void display_hal_delay(lv_disp_drv_t *drv, uint32_t delay_ms)
{
(void) drv;
vTaskDelay(pdMS_TO_TICKS(delay_ms));
}
2021-08-26 23:51:35 +00:00
void display_hal_backlight(lv_disp_drv_t *drv, uint8_t state)
{
(void) drv;
#ifdef CONFIG_LV_DISP_PIN_BCKL
gpio_set_level(CONFIG_LV_DISP_PIN_BCKL, state);
#endif
}
2021-08-26 23:51:35 +00:00
void display_hal_gpio_dc(lv_disp_drv_t *drv, uint8_t state)
{
(void) drv;
#ifdef CONFIG_LV_DISPLAY_USE_DC
gpio_set_level(CONFIG_LV_DISP_PIN_DC, state);
#endif
}
2021-08-26 23:51:35 +00:00
void display_hal_gpio_rst(lv_disp_drv_t *drv, uint8_t state)
{
(void) drv;
#ifdef CONFIG_LV_DISP_USE_RST
gpio_set_level(CONFIG_LV_DISP_PIN_RST, state);
#endif
}