2020-02-10 15:05:33 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libs/lvgl/src/lv_hal/lv_hal.h>
|
|
|
|
#include <drivers/St7789.h>
|
2020-02-16 12:32:36 -05:00
|
|
|
#include <drivers/Cst816s.h>
|
2020-02-10 15:05:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
|
2020-02-16 12:32:36 -05:00
|
|
|
static bool touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data);
|
2020-02-10 15:05:33 -05:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Components {
|
|
|
|
class LittleVgl {
|
|
|
|
public:
|
2020-02-16 12:32:36 -05:00
|
|
|
LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel);
|
2020-02-10 15:05:33 -05:00
|
|
|
void FlushDisplay(const lv_area_t * area, lv_color_t * color_p);
|
|
|
|
|
|
|
|
|
2020-02-16 12:32:36 -05:00
|
|
|
bool GetTouchPadInfo(lv_indev_data_t *ptr);
|
2020-02-10 15:05:33 -05:00
|
|
|
private:
|
2020-02-16 12:32:36 -05:00
|
|
|
void InitDisplay();
|
|
|
|
void InitTouchpad();
|
|
|
|
|
2020-02-10 15:05:33 -05:00
|
|
|
Pinetime::Drivers::St7789& lcd;
|
2020-02-16 12:32:36 -05:00
|
|
|
Pinetime::Drivers::Cst816S& touchPanel;
|
|
|
|
|
2020-02-10 15:05:33 -05:00
|
|
|
|
|
|
|
lv_disp_buf_t disp_buf_2;
|
|
|
|
lv_color_t buf2_1[LV_HOR_RES_MAX * 2];
|
|
|
|
lv_color_t buf2_2[LV_HOR_RES_MAX * 2];
|
|
|
|
|
|
|
|
lv_disp_drv_t disp_drv;
|
2020-02-16 12:32:36 -05:00
|
|
|
lv_point_t previousClick;
|
|
|
|
|
2020-02-10 15:05:33 -05:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|