Hardware:
SAME54 Xplained Pro (ATSAME54P20A)
LCD Controller: SSD1963
I ran a test to see if my driver was fine, and that code is here (thanks to deonm) :
lv_area_t area = {
.x1 = 0, .x2 = LV_HOR_RES_MAX-1,
.y1 = 0, .y2 = 9,
};
static lv_color_t buf[LV_HOR_RES_MAX * 10];
for( int i = 0; i < LV_HOR_RES_MAX * 10; ++i )
{
/* This is the buffer you gave to lv_disp_buf_init */
buf[i] = LV_COLOR_WHITE;
}
ssd1963_flush(NULL, &area, buf);
The result is as expected (little white block at the top):
But when I run normal code (without calling flush manually), I get the following result:
main.c code:
int main(void)
{
project_init();lv_init();
ssd1963_init();
static lv_disp_buf_t disp_buf;
static lv_color_t buf[LV_HOR_RES_MAX * 10]; /Declare a buffer for 10 lines/
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10); /Initialize the display buffer/
lv_disp_drv_t disp_drv; /Descriptor of a display driver/
lv_disp_drv_init(&disp_drv); /Basic initialization/
disp_drv.flush_cb = ssd1963_flush; /Set your driver function/
disp_drv.buffer = &disp_buf; /Assign the buffer to the display/
lv_disp_drv_register(&disp_drv); /Finally register the driver/lv_obj_t * scr = lv_disp_get_scr_act(NULL); /Get the current screen/
///****************************************
//* BASE OBJECT + LABEL WITH DEFAULT STYLE
//****************************************/
///Create a simple objects/
lv_obj_t * obj1;
obj1 = lv_obj_create(scr, NULL);
lv_obj_set_pos(obj1, 0, 10);
lv_obj_set_size(obj1, 320, 30);/Add a label to the object/
lv_obj_t * label;
label = lv_label_create(obj1, NULL);
lv_label_set_text(label, “-- SAME54 LCD Demo --”);
lv_obj_align(label, obj1, LV_ALIGN_CENTER, 0, 0);/Create a simple objects/
lv_obj_t * body;
body = lv_obj_create(scr, NULL);
lv_obj_set_pos(body, 20, 50);
lv_obj_set_size(body, 280, 170);
lv_obj_set_style(body, &lv_style_plain_color);while (1) {
lv_task_handler();
delay_ms(1);}
}
This is odd because I’m running extremely similar code on a SAMD21 and I am not getting this tear.