2021-07-29 23:56:22 +00:00
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
#include "freertos/task.h"
|
|
|
|
|
2021-08-26 15:42:26 +00:00
|
|
|
#include "display_hal.h"
|
2021-07-29 23:56:22 +00:00
|
|
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
#include "driver/gpio.h"
|
|
|
|
|
2021-07-30 00:04:39 +00:00
|
|
|
void display_bsp_init_io(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_LV_DISPLAY_USE_DC
|
|
|
|
gpio_pad_select_gpio(CONFIG_LV_DISP_PIN_DC);
|
|
|
|
gpio_set_direction(CONFIG_LV_DISP_PIN_DC, GPIO_MODE_OUTPUT);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_LV_DISP_USE_RST
|
|
|
|
gpio_pad_select_gpio(CONFIG_LV_DISP_PIN_RST);
|
|
|
|
gpio_set_direction(CONFIG_LV_DISP_PIN_RST, GPIO_MODE_OUTPUT);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_LV_DISP_PIN_BCKL
|
|
|
|
gpio_pad_select_gpio(CONFIG_LV_DISP_PIN_BCKL);
|
|
|
|
gpio_set_direction(CONFIG_LV_DISP_PIN_BCKL, GPIO_MODE_OUTPUT);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2021-08-26 15:42:26 +00:00
|
|
|
void display_bsp_delay(lv_disp_drv_t *drv, uint32_t delay_ms)
|
2021-07-29 23:56:22 +00:00
|
|
|
{
|
2021-08-26 15:42:26 +00:00
|
|
|
(void) drv;
|
|
|
|
|
2021-07-29 23:56:22 +00:00
|
|
|
vTaskDelay(pdMS_TO_TICKS(delay_ms));
|
|
|
|
}
|
|
|
|
|
2021-08-26 15:42:26 +00:00
|
|
|
void display_bsp_backlight(lv_disp_drv_t *drv, uint8_t state)
|
2021-07-29 23:56:22 +00:00
|
|
|
{
|
2021-08-26 15:42:26 +00:00
|
|
|
(void) drv;
|
|
|
|
|
2021-07-29 23:56:22 +00:00
|
|
|
#ifdef CONFIG_LV_DISP_PIN_BCKL
|
|
|
|
gpio_set_level(CONFIG_LV_DISP_PIN_BCKL, state);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2021-08-26 15:42:26 +00:00
|
|
|
void display_bsp_gpio_dc(lv_disp_drv_t *drv, uint8_t state)
|
2021-07-29 23:56:22 +00:00
|
|
|
{
|
2021-08-26 15:42:26 +00:00
|
|
|
(void) drv;
|
|
|
|
|
2021-07-29 23:56:22 +00:00
|
|
|
#ifdef CONFIG_LV_DISPLAY_USE_DC
|
|
|
|
gpio_set_level(CONFIG_LV_DISP_PIN_DC, state);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2021-08-26 15:42:26 +00:00
|
|
|
void display_bsp_gpio_rst(lv_disp_drv_t *drv, uint8_t state)
|
2021-07-29 23:56:22 +00:00
|
|
|
{
|
2021-08-26 15:42:26 +00:00
|
|
|
(void) drv;
|
|
|
|
|
2021-07-29 23:56:22 +00:00
|
|
|
#ifdef CONFIG_LV_DISP_USE_RST
|
|
|
|
gpio_set_level(CONFIG_LV_DISP_PIN_RST, state);
|
|
|
|
#endif
|
|
|
|
}
|