Description
I am trying to set up a GC9A01 round display on STM32F4 with LVGL. I have got it to work but the label appears many times. I think it may be a problem with my driver. The display works fine without LVGL so not sure what i’ve done here.
What MCU/Processor/Board and compiler are you using?
STM32F401 with GCC (STM32CubeIDE)
What LVGL version are you using?
9.0
What do you want to achieve?
I want to be able to display temperature readings on the display
What have you tried so far?
Code to reproduce
/Flush function/
static void disp_flush(lv_display_t *disp_drv, const lv_area_t *area,
uint8_t *px_map)
{
if (disp_flush_enabled)
{
frame.start.X = area->x1;
frame.end.X = area->x2;
frame.start.Y = area->y1;
frame.end.Y = area->y2;
uint32_t size = lv_area_get_width(area) * lv_area_get_height(area);
GC9A01_set_addr_win(area->x1, area->y1, area->x2, area->y2);
GC9A01_write((uint8_t*)px_map, size*2);
}
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_display_flush_ready(disp_drv);
}
/Code from the main.c file/
lv_init();
/*Init the display*/
lv_port_disp_init();
lv_obj_t * mainScreen = lv_screen_active();
lv_obj_t * label = lv_label_create(mainScreen);
lv_obj_set_style_text_font(label, &lv_font_montserrat_24, LV_PART_MAIN);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
lv_obj_align(mainScreen, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_style_bg_color(mainScreen, lv_color_white(), LV_PART_MAIN);
lv_label_set_text(label, "HELP!");
/* Loop forever */
while (1)
{
lv_timer_handler();
Time_Delay_Ms(100);
}
The code block(s) should be formatted like:
/*You code here*/
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.