Merge pull request #112 from lvgl/feat-add_busy_signal_handler_to_generic_driver
feat(lv_port): Add abstraction for busy signal
This commit is contained in:
commit
f6999a52fe
|
@ -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);
|
gpio_set_level(CONFIG_LV_DISP_PIN_RST, state);
|
||||||
#endif
|
#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;
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,9 @@ extern "C"
|
||||||
#include "lvgl/lvgl.h"
|
#include "lvgl/lvgl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Busy wait delay port
|
* 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);
|
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
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue