LkdGui is a graphical library designed for monochrome displays. It's used in the industrial control field for the simple and beautiful graphic interface. Its source code is written in C language and conforms to the C99 standard. LkdGui contains commonly used graphical functions to drawing points, lines, rectangles, text display, button widgets and progress bars. It uses 'Windows' for unified management and scheduling of widgets, making the display modules lowly coupled and beneficial to application development.

The presentation video is posting on RT-Thread Youtube Channel!

LkdGui Source Code

lkdGui_source file: lkdGui all source code.

A. include file: It contains all the header files of GUI. This path should be added to the project when porting to a new platform.

B. portFile: This file contains the porting files.

C. source file: Gui drawing function, window management function and other related functions to implement the source code.

图片1.png图片2.png图片3.png

lkdGui Porting:

The font porting interface contains fontDriver folder and userFontPort.c. The porting process is as follows:

A. You should look at the fontDriver folder to see if there is a font library or font library chip driver you want. If not you need to add it.

B. Then modify userFontPort.c. Fill in the related functions in this file.

LCD Porting interface contains lcdDriverPort folder and lcdDriverPort.c. The porting process is as follows:

A. You should look at the lcdDriverPort folder to see if there has the LCD driver you want. If not you need to add it.

B. Then modify lcdDriverPort.c. Fill in the related functions in this file. (Some functions can be filled in as you need). Here are the required functions need to be fill in:

Modify lkdGuiConfig.h in the LCD size related macro GUI_LCM_XMAXGUI_LCM_YMAX.

User interface: Available user interface functions are included in lkdGui.huserAppPort.c is a template that you can use.

lkdGui Window Introduction

LkdGui uses windows as a management and scheduling unit. All user drawings should be included in a specific window.

1、The GUIWINMANAGE_NUM in lkdGuiConfig.h is used to modify the maximum number of nested windows.

2、You should use it to initialize window-related resources when powering on GuiWinInit() systems.

3、GuiWinDisplay() is a window scheduling function that requires programs to execute all the time.

4、lkdWin is the structure of the window. Use it to create any number of window entity objects. lkdWin-WindowsFunction() is an interface for users to draw in this window, etc.

5、The GuiWinAdd() function is used to add window entity objects of the lkdWin structure to the window scheduling stack.

6、The GuiWinDeleteTop() function is used to remove the top window entity object from the window scheduling stack.

7、The GuiGetTopWin() function gets the window( the currently displayed window) at the top of the window scheduling stack.

lkdGui Menu:

The menu is a distinctive widget in lkdGui and is often used in industrial control.

LkdGui Font Introduction:

You can add a number of font libraries into LkdGui, using the GuiFontSet() function to switch among them at runtime. Use the GetCurrentFont() function can get the current font pointer;

图片4.png

Other Controls & Drawing Functions: Please refer to lkdGui.h. for detailed instructions.

How to Use lkdGui on RT-Thread:

Users can simply select lkdGui in the RT-Thread management tool env.

RT-Thread ENV User Manual

Download RT-Thread Env

The following image shows the location of lkdGui in menuconfig:

图片6.png

Obtain lkdGui Source Code:

github.com/guoweilkd/lkdGui.git

For more information about RT-Thread RTOS: github.com/RT-Thread


RT-Thread Contact Info:

Website | Github | Twitter | Facebook | Youtube