i2c相关修改,触摸屏功能
This commit is contained in:
1 parent
4f8260accc
commit
ea0a67e506
8 files changed
+19
-64
No files matched your search
@@ -20,56 +20,7 @@
|
||||
#define LCD_BL_PIN GET_PIN(D,12)
|
||||
#define LCD_RST_PIN GET_PIN(D,11)
|
||||
|
||||
static void btn_led_on_evt_handler(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_CLICKED)
|
||||
{
|
||||
rt_kprintf("LED ON\n");
|
||||
//led_on();
|
||||
}
|
||||
}
|
||||
|
||||
static void btn_led_off_evt_handler(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_CLICKED)
|
||||
{
|
||||
rt_kprintf("LED OFF\n");
|
||||
// led_off();
|
||||
}
|
||||
}
|
||||
|
||||
void lv_user_gui_init(void)
|
||||
{
|
||||
lv_demo_widgets();
|
||||
/* lv_obj_t *scr = lv_scr_act();
|
||||
|
||||
// 创建“按钮” —— 实际是一个可点击的普通对象
|
||||
lv_obj_t *btn_on = lv_obj_create(scr);
|
||||
lv_obj_set_size(btn_on, 100, 50);
|
||||
lv_obj_align(btn_on, LV_ALIGN_CENTER, -60, 0);
|
||||
lv_obj_add_flag(btn_on, LV_OBJ_FLAG_CLICKABLE); // 启用点击
|
||||
lv_obj_clear_flag(btn_on, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
lv_obj_t *label_on = lv_label_create(btn_on);
|
||||
lv_label_set_text(label_on, "LED ON");
|
||||
lv_obj_center(label_on);
|
||||
|
||||
lv_obj_add_event_cb(btn_on, btn_led_on_evt_handler, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
// 第二个按钮
|
||||
lv_obj_t *btn_off = lv_obj_create(scr);
|
||||
lv_obj_set_size(btn_off, 100, 50);
|
||||
lv_obj_align(btn_off, LV_ALIGN_CENTER, 60, 0);
|
||||
lv_obj_add_flag(btn_off, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_clear_flag(btn_off, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
lv_obj_t *label_off = lv_label_create(btn_off);
|
||||
lv_label_set_text(label_off, "LED OFF");
|
||||
lv_obj_center(label_off);
|
||||
|
||||
lv_obj_add_event_cb(btn_off, btn_led_off_evt_handler, LV_EVENT_CLICKED, NULL);*/
|
||||
}
|
||||
Reference in new issue
Block a user