diff --git a/lv_port/lv_port_display_espressif.c b/lv_port/lv_port_display_espressif.c index 9f6f4b1..1684767 100644 --- a/lv_port/lv_port_display_espressif.c +++ b/lv_port/lv_port_display_espressif.c @@ -39,3 +39,19 @@ void display_port_gpio_rst(lv_disp_drv_t *drv, uint8_t state) gpio_set_level(CONFIG_LV_DISP_PIN_RST, state); #endif } + +bool display_port_gpio_is_busy(lv_disp_drv_t *drv) +{ + (void) drv; + + bool device_busy = false; + +#ifdef CONFIG_LV_DISP_PIN_BUSY + /* FIXME Assuming the busy signal in logic 1 means the device is busy */ + if (gpio_get_level(CONFIG_LV_DISP_PIN_BUSY) == 1) { + device_busy = true; + } +#endif + + return device_busy; +} diff --git a/lvgl_tft/display_port.h b/lvgl_tft/display_port.h index 2136ec6..f0004d6 100644 --- a/lvgl_tft/display_port.h +++ b/lvgl_tft/display_port.h @@ -12,6 +12,9 @@ extern "C" #include "lvgl/lvgl.h" #endif +#include +#include + /** * Busy wait delay port * @@ -44,6 +47,15 @@ void display_port_gpio_dc(lv_disp_drv_t *drv, uint8_t state); */ void display_port_gpio_rst(lv_disp_drv_t *drv, uint8_t state); +/** + * Display is busy port + * + * @param drv Pointer to driver See @ref lv_disp_drv_t + * + * @retval Returns false when display is not busy, true otherwise. + */ +bool display_port_gpio_is_busy(lv_disp_drv_t *drv); + #ifdef __cplusplus } /* extern "C" */ #endif