hal.c
// Initializes the display, but does **not** register
// with lvgl. This will be registered once lvgl is initialized.
// This allows us to use the display driver information for
// things like setting up the DPI.
Initializes the display, but does **not** register
with lvgl. This will be registered once lvgl is initialized.
This allows us to use the display driver information for
things like setting up the DPI.
Initializes the display but does ** not ** register with lvgl . This will be registered once lvgl is initialized . This allows us to use the display driver information for things like setting up the DPI .
void hal_setup_display()
{
	static lv_color_t buf[DISP_BUF_SIZE];
	static lv_disp_buf_t disp_buf;
	lv_disp_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE);
	lv_disp_drv_init(&disp_drv);
	disp_drv.buffer = &disp_buf;
#if USE_FBDEV
	disp_drv.flush_cb = fbdev_flush;
#endif
#if USE_DRM
	disp_drv.flush_cb = drm_flush;
#endif
#if USE_MONITOR
    disp_drv.flush_cb = monitor_flush;
#endif
#if USE_FBDEV
	fbdev_init(&disp_drv);
#endif
#if USE_DRM
	drm_init(&disp_drv);
#endif
#if USE_MONITOR
    monitor_init();
    monitor_set_resolution(&disp_drv);
#endif
}
void hal_setup_display ( ) { static lv_color_t buf [ DISP_BUF_SIZE ] ; static lv_disp_buf_t disp_buf ; lv_disp_buf_init ( & disp_buf , buf , NULL , DISP_BUF_SIZE ) ; lv_disp_drv_init ( & disp_drv ) ; disp_drv . buffer = & disp_buf ; #if USE_FBDEV disp_drv . flush_cb = fbdev_flush ; #endif #if USE_DRM disp_drv . flush_cb = drm_flush ; #endif #if USE_MONITOR disp_drv . flush_cb = monitor_flush ; #endif #if USE_FBDEV fbdev_init ( & disp_drv ) ; #endif #if USE_DRM drm_init ( & disp_drv ) ; #endif #if USE_MONITOR monitor_init ( ) ; monitor_set_resolution ( & disp_drv ) ; #endif }
Initializes the display, but does **not** register
with lvgl.
Initializes the display but does ** not ** register with lvgl .
/*A small buffer for LittlevGL to draw the screen's content*/ /*Initialize a descriptor for the buffer*/ /*Initialize and register a display driver*/ // Configure the flush callback first... // As it's possible the driver re-configures it...