Share this

Porting and Development of Embedded Graphics System μc/GUI

2026-04-06 08:09:09 · · #1
Abstract The development of embedded systems has become a new industry hotspot, and the development of embedded graphics systems has been constantly innovating in recent years with the deepening of embedded systems. This paper first outlines the current status of embedded systems and their embedded graphics GUIs, and then specifically describes the μC/GUI graphics system and its porting focus, program development, and advantages and disadvantages compared with other graphics systems. The Status of GUIs in Embedded or Real-Time Systems Increasing market demand data shows that high-end electronic products, including PDAs, consumer electronics, set-top boxes, DVDs, and WAP mobile phones, are widely used. GUI graphics systems, which were originally only used in military and industrial control fields, are receiving increasing attention. For lightweight GUI systems, the requirements for the GUI are relatively low. For example, traditional 51-type microcontroller systems generally do not want to be built on a large, cumbersome, and resource-intensive operating system and GUI, such as Windows or X Window. Currently, such systems directly use existing programming methods and adopt relatively simple techniques to implement the GUI. For overly large and bloated GUI systems, the demand for lightweight GUIs like μC/GUI, which can be applied to such resource-constrained systems, is even more prominent. μc/GUI Introduction and Configuration: μc/GUI is an excellent graphical user interface for embedded systems, produced by MiCCrium (USA). It provides a high-efficiency, processor- and LCD controller-independent graphical user interface for any application using LCD graphics displays, suitable for single-tasking or multi-tasking system environments. Its architecture is based on a modular design, composed of different layers within different modules. These include an LCD driver module, memory device module, window system module, window control module, anti-aliasing module, and touchscreen and peripheral modules. Its main features include a rich graphics library, multi-window and multi-tasking mechanisms, window management and a rich set of window controls (buttons, checkboxes, single/multi-line edit boxes, list boxes, progress bars, menus, etc.), support for multiple character sets and fonts, support for various common image files, mouse and touchscreen support, and flexible configuration. Figure 1 shows the μc/gui module and development kit. The development kit provides numerous tools to aid development, including a bitmap converter, font converter, μc/gui viewer, and a very comprehensive PC-based simulator, as shown in Figure 1. The μc/gui core module and LCD driver module are mandatory; the others are configurable and optional. Since μc/gui is not designed for a specific platform, it can run on all platforms supporting ANSI C. Therefore, applications successfully debugged on a PC can be ported directly to the platform, avoiding the cumbersome on-chip debugging process. μc/gui can run on any CPU and is compatible with most applications using black-and-white or color LCDs, providing excellent color management that allows grayscale processing. It also provides an extensible 2D graphics library and a window management system with minimal RAM usage. The initial typical configuration of μc/gui may include numerous options such as whether operating system support, memory device support, window support, and anti-aliasing support are required. These are crucial for GUI customization and size. The small system requires 100 bytes of RAM, 500 bytes of stack, and 10 kilobytes of ROM, which is sufficient for systems with very limited resources. μc/gui porting focus and application development (1) First, define the two files guiconf.h and lcdconf.h. The former defines the basic GUI predefined controls such as the size of μc/gui functional modules and dynamic storage space (used for memory devices and window objects), and default font settings. The latter, lcdconf.h, is the LCD parameter control file for LCD size, controller type, bus width, color selection, etc. All default LCD configuration options can be found in the gui/core/lcd_confdefaults.h file, including the number of LCD screens, the number of controllers, the color palette, screen inversion settings, and many other configuration options. If a touchscreen is provided, it can be configured through guitouchconf.h. The following functions are compiled according to the touchscreen and its control chip: void touch_x_activatex (void); // Prepare y-axis data measurement void touch_x_activatey (void); // Prepare x-axis data measurement int touch_x_measurex (void); // Return the value of x based on the AD conversion result int touch_x_measurey (void); // Return the value of y based on the AD conversion result The above functions will be called in gui_touch_exec(). (2) For LCD screens with built-in controllers, the hardware interface is configured and defined through the bus interface and register interface in lcdconf.h. For on-chip integrated LCD controller platforms, the LCD interface signals are configured by setting the on-chip LCD controller registers. The LCD interface signals that need to be configured in a general LCD include the vframe frame synchronization signal, the vline line synchronization pulse signal, the vclk pixel clock signal, the vm signal, and the pixel data output signal with different data bits. (3) The essence of LCD driver programming is the programming of the video memory corresponding to the dots on the LCD screen. The lowest level function is the drawing function. Users can operate according to their own platform situation based on the bus interface and register interface or LCD controller register. _setpixel(), _getpixel(), and xorpixel() are the lowest level functions that directly operate on the video memory. MC/GUI provides some controller drivers, the file is gui/lcddriver/lcdslin.c, such as simple LCD controllers such as SED1335 and T6963. The core function is lcd_write(). _setpixel() calls lcd_write() to write to the video memory. (4) The sample\gui_x folder contains files closely related to the hardware, including gui_x.c, gui_x_embos.c, gui_x_ucos.c, etc. gui_x.c includes most of the hardware-related functions, such as timer initialization and touch screen related functions. The core of MC/GUI's connection with the operating system is the setting and connection of the timer. μc/GUI calls gui_x_delay via the delay function gui_delay(), and then calls gui_exec() to process the callback function in the widget for redrawing. In any embedded operating system, a timer is essential. μc/GUI, which supports the OS, can achieve real-time and synchronous operation between the embedded operating system and the graphics system through timer settings. Integration is achieved in gui_x_ucos.c by connecting the delay program in μc/os with μc/GUI. Figure 2 shows the μc/GUI software structure (5). After porting, GUI application development becomes very easy through μc/GUI. After calling gui_init(), users can correctly configure μc/GUI as needed and then use its powerful library functions and rich GUI resources for programming. During GUI programming, anti-aliasing can be enabled to reduce graphic distortion and obtain high-quality graphics and font effects. Using memory devices can effectively overcome flickering and achieve faster display speeds, but like anti-aliasing, it requires additional memory overhead. Comparison of μc/gui with other graphics systems (1) The advantage of μc/gui lies in its small size, strong configurability, and wide range of applications. Compared with many embedded graphics systems, such as MICrowindows/nanox, OpenGUI, Qt/embedded, MiniGUI, etc., μc/gui can run in small systems that meet the requirements of 100 bytes of RAM, 500 bytes of stack, and 10kbytes of ROM. This requirement is not met by other graphics systems. It can be widely used in domestic microcontroller systems that are already very mature, enhancing system performance. In resource-rich large systems, only 2-6kb of RAM, 1200 bytes of stack, and 30-60kb of ROM are needed to meet the various functions of MC/gui. Compared with other graphics systems that cost at least several hundredk and often more than megabytes, it is very advantageous. Its numerous configurations meet the needs of different users, are convenient, flexible, compact, and greatly enhance practicality. (2) Wide platform coverage and easy portability. Because μc/gui is written in 100% C, it is compatible with most software and hardware platforms, making it highly adaptable. Compared to many hardware-specific graphics systems, its structure and module division are very clear, with a dedicated LCD driver module, making porting simple and convenient. The codebase is relatively small, easy to operate, and highly scalable, facilitating user customization and independent updates to meet individual needs. Conclusion This article focuses on μc/gui and its porting methods. As a graphical user interface support system for embedded systems, μc/gui excels in system requirements, execution efficiency, and customizability. It is small in size, easy to port, and adaptable to a wide range of platforms, greatly simplifying the development cycle and difficulty of graphics systems in embedded system development, and possesses high practical value.
Read next

CATDOLL 123CM Nanako (TPE Body with Soft Silicone Head)

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22