mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-19 16:56:34 +00:00
Merge branch 'development' of https://github.com/arendst/Tasmota into lvgl_chrono
This commit is contained in:
commit
f0fb65c56d
@ -1031,9 +1031,19 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean first) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) {
|
||||||
|
// special version 8 bit spi I or II
|
||||||
|
#ifdef ESP8266
|
||||||
while (len--) {
|
while (len--) {
|
||||||
color = *data++;
|
uspi->write(*data++);
|
||||||
WriteColor(color);
|
}
|
||||||
|
#else
|
||||||
|
uspi->writePixels(data, len * 2);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
while (len--) {
|
||||||
|
WriteColor(*data++);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -481,6 +481,9 @@ void RA8876::DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RA8876::initDisplay() {
|
bool RA8876::initDisplay() {
|
||||||
|
|
||||||
|
lvgl_param = 10;
|
||||||
|
|
||||||
SPI.beginTransaction(m_spiSettings);
|
SPI.beginTransaction(m_spiSettings);
|
||||||
|
|
||||||
// Set chip config register
|
// Set chip config register
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
name=RA8876
|
name=RA8876
|
||||||
version=1.0.0
|
version=1.0.2
|
||||||
author=Jaret Burkett / Gerhard Mutz
|
author=Jaret Burkett
|
||||||
maintainer=Gerhard Mutz
|
maintainer=Jaret Burkett <jaretburkett@gmail.com>
|
||||||
sentence=Tasmota Library for RA8876 displays
|
sentence=Library for RA8876 displays
|
||||||
paragraph=Tasmota Library for RA8876 displays
|
paragraph=Library for RA8876 displays
|
||||||
category=Display
|
category=Display
|
||||||
url=https://github.com/arendst/Tasmota
|
url=https://github.com/jaretburkett/ILI9488
|
||||||
architectures=*
|
architectures=*
|
||||||
|
@ -31,11 +31,9 @@ uint32_t Touch_Status(uint32_t sel);
|
|||||||
static bool touchscreen_read(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data) {
|
static bool touchscreen_read(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data) {
|
||||||
//lv_coord_t last_x = 0, last_y = 0;
|
//lv_coord_t last_x = 0, last_y = 0;
|
||||||
//static uint8_t release_count = 0;
|
//static uint8_t release_count = 0;
|
||||||
#if defined(USE_FT5206) || defined(USE_XPT2046)
|
|
||||||
data->point.x = Touch_Status(1); // Last-pressed coordinates
|
data->point.x = Touch_Status(1); // Last-pressed coordinates
|
||||||
data->point.y = Touch_Status(2);
|
data->point.y = Touch_Status(2);
|
||||||
data->state = Touch_Status(0);
|
data->state = Touch_Status(0);
|
||||||
#endif
|
|
||||||
return false; /*No buffering now so no more data read*/
|
return false; /*No buffering now so no more data read*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2629,7 +2629,7 @@ chknext:
|
|||||||
len = 0;
|
len = 0;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // USE_LVGL
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
if (!strncmp(vname, "med(", 4)) {
|
if (!strncmp(vname, "med(", 4)) {
|
||||||
@ -7764,39 +7764,34 @@ void btn_event_cb(lv_obj_t * btn, lv_event_t event) {
|
|||||||
if (event == LV_EVENT_CLICKED) {
|
if (event == LV_EVENT_CLICKED) {
|
||||||
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
|
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
|
||||||
}
|
}
|
||||||
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t lvgl_test(int32_t p) {
|
int32_t lvgl_test(int32_t p) {
|
||||||
|
|
||||||
start_lvgl(ili9342);
|
start_lvgl(ili9342);
|
||||||
|
|
||||||
lv_obj_clean(lv_scr_act());
|
lv_obj_clean(lv_scr_act());
|
||||||
|
|
||||||
|
if (p == 0) {
|
||||||
lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL);
|
lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL);
|
||||||
|
|
||||||
/*Modify the Label's text*/
|
/*Modify the Label's text*/
|
||||||
lv_label_set_text(label1, "Hello world!");
|
lv_label_set_text(label1, "Hello world!");
|
||||||
|
|
||||||
/* Align the Label to the center
|
/* Align the Label to the center
|
||||||
* NULL means align on parent (which is the screen now)
|
* NULL means align on parent (which is the screen now)
|
||||||
* 0, 0 at the end means an x, y offset after alignment*/
|
* 0, 0 at the end means an x, y offset after alignment*/
|
||||||
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
|
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||||
|
|
||||||
|
|
||||||
lvgl_setup();
|
|
||||||
|
|
||||||
/*Add a button*/
|
/*Add a button*/
|
||||||
lv_obj_t *btn1 = lv_btn_create(lv_scr_act(), NULL); /*Add to the active screen*/
|
lv_obj_t *btn1 = lv_btn_create(lv_scr_act(), NULL); /*Add to the active screen*/
|
||||||
lv_obj_set_pos(btn1, 2, 2); /*Adjust the position*/
|
lv_obj_set_pos(btn1, 2, 2); /*Adjust the position*/
|
||||||
lv_obj_set_size(btn1, 96, 30); /* set size of button */
|
lv_obj_set_size(btn1, 96, 30); /* set size of button */
|
||||||
lv_obj_set_event_cb(btn1, btn_event_cb);
|
lv_obj_set_event_cb(btn1, btn_event_cb);
|
||||||
|
|
||||||
/*Add text*/
|
/*Add text*/
|
||||||
lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/
|
lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/
|
||||||
lv_label_set_text(label, "Click");
|
lv_label_set_text(label, "Click");
|
||||||
|
} else {
|
||||||
|
lvgl_setup();
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7898,7 +7893,7 @@ void lvgl_setup(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif // USE_LVGL
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Interface
|
* Interface
|
||||||
|
@ -2677,14 +2677,32 @@ void AddValue(uint8_t num,float fval) {
|
|||||||
* Touch panel control
|
* Touch panel control
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
#if defined(USE_FT5206) || defined(USE_XPT2046)
|
|
||||||
bool FT5206_found = false;
|
bool FT5206_found = false;
|
||||||
bool XPT2046_found = false;
|
bool XPT2046_found = false;
|
||||||
|
|
||||||
int16_t touch_xp;
|
int16_t touch_xp;
|
||||||
int16_t touch_yp;
|
int16_t touch_yp;
|
||||||
bool touched;
|
bool touched;
|
||||||
|
|
||||||
|
uint32_t Touch_Status(uint32_t sel) {
|
||||||
|
if (FT5206_found || XPT2046_found) {
|
||||||
|
switch (sel) {
|
||||||
|
case 0:
|
||||||
|
return touched;
|
||||||
|
case 1:
|
||||||
|
return touch_xp;
|
||||||
|
case 2:
|
||||||
|
return touch_yp;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(USE_FT5206) || defined(USE_XPT2046)
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_M5STACK_CORE2
|
#ifdef USE_M5STACK_CORE2
|
||||||
uint8_t tbstate[3];
|
uint8_t tbstate[3];
|
||||||
#endif // USE_M5STACK_CORE2
|
#endif // USE_M5STACK_CORE2
|
||||||
@ -2747,21 +2765,7 @@ int16_t XPT2046_y() {
|
|||||||
}
|
}
|
||||||
#endif // USE_XPT2046
|
#endif // USE_XPT2046
|
||||||
|
|
||||||
uint32_t Touch_Status(uint32_t sel) {
|
|
||||||
if (FT5206_found || XPT2046_found) {
|
|
||||||
switch (sel) {
|
|
||||||
case 0:
|
|
||||||
return touched;
|
|
||||||
case 1:
|
|
||||||
return touch_xp;
|
|
||||||
case 2:
|
|
||||||
return touch_yp;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
|
void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user