Git Product home page Git Product logo

Comments (5)

zacck avatar zacck commented on July 2, 2024 1

The solution above fixes this issue thank you @kisvegabor 💯

from lvgl.

zacck avatar zacck commented on July 2, 2024

Update, I managed to get LVGL to work! however not completely as we expect. So now It does render but somehow my code drops a part of the screen.

Here is how I am initializing the screen now

/*Function to initialize the screen as a LVGL element*/
void screen_init(void){
	lv_color_t *draw_buf1;
	lv_color_t *draw_buf2;

	bsp_lcd_init();

	draw_buf1 = (lv_color_t*)bsp_lcd_get_draw_buffer1_addr();
	draw_buf2 = (lv_color_t*)bsp_lcd_get_draw_buffer2_addr();

	//Init LVGL
	lv_init();

	//Init LVGL with our screen size
	lv_display_t * disp = lv_display_create(BSP_LCD_ACTIVE_HEIGHT, BSP_LCD_ACTIVE_WIDTH);

	//Initialize and set a buffer
	lv_display_set_buffers(disp, draw_buf1, draw_buf2, ((10UL * 1024UL) / 2), LV_DISPLAY_RENDER_MODE_PARTIAL);

	//Set a flush callback so lvgl can draw to our screen
	lv_display_set_flush_cb(disp, lcd_flush_cb);

	lv_display_set_rotation(disp, LV_DISPLAY_ROTATION_90);

	lv_display_set_color_format(disp, LV_COLOR_FORMAT_RGB565);
}

Amazing I see elements on the screen but part of it is cut out see below.

IMG_9676_compressed.mp4

As you can see my base driver can use the whole screen but now when I hand over to LVGL it uses only a part of the screen, any help would be much appreciated.

from lvgl.

kisvegabor avatar kisvegabor commented on July 2, 2024

The clipping issue happens because you call lv_display_set_rotation(disp, LV_DISPLAY_ROTATION_90);. With this LVGL will swap the horizontal and vertical resolution so you also need to configure your display to this orientation.

In ILI9341 it can be set with the ADDRESS_MODE (0x36) command.

from lvgl.

zacck avatar zacck commented on July 2, 2024
  1. Thank you so much for the time!

I'll give that a bash!

from lvgl.

kisvegabor avatar kisvegabor commented on July 2, 2024

Great! 🙂

from lvgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.