0. Preparation
(a) Create the following directory:
minigui
|--build_x86 /Build MiniGUI running on PC
|--build_arm /Build MiniGUI running on ARM
|--tarball /All package resource storage points
(b) download MiniGUI:
Download libminigui-1.3.3.tar.gz and minigui-res-1.3.3.tar.gz from www.minigui.com and put
tarball directory
(Starting directory: minigui)
#cd build_x86
#tar zxvf ../tarball/libminigui-1.3.3.tar.gz
#tar zxvf ../tarball/minigui-res-1.3.3.tar.gz
#cd ../build_arm
#tar zxvf ../tarball/libminigui-1.3.3.tar.gz
#cd ..
(c) download and install qvfb:
Download qvfb-1.0.tar.gz from www.minigui.com and put it into the tarball directory
#cd build_x86
#tar zxvf ../tarball/qvfb-1.0.tar.gz
#cd qvfb-1.0
#./configure
#make
#make install
#cd ..
(d) Create a sample program:
test.c
--------------------------------------------------------------------------test.c begin
#include #include #include #include #include #define MWINDOW_LX 10 #define MWINDOW_TY 50 #define MWINDOW_RX 230 #define MWINDOW_BY 180 static char * hello_str = "HelloMiniGUI!"; HWND hMainWnd; static int WinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam) { HDC hdc; RECT rc; switch (message) { case MSG_PAINT : hdc = BeginPaint(hWnd); GetClientRect(hWnd, &rc); DrawText(hdc, hello_str, -1, &rc, DT_LEFT); EndPaint(hWnd, hdc); break; case MSG_CLOSE : DestroyMainWindow(hWnd); PostQuitMessage(hWnd); break; default : return(DefaultMainWinProc(hWnd, message, wParam, lParam)); } return(0); } int InitMainWindow(void) { MAINWINCREATE window_info; window_info.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION; window_info.dwExStyle = WS_EX_NONE; window_info.spCaption = "MiniGUI"; window_info.hMenu = 0; window_info.hCursor = GetSystemCursor(0); window_info.hIcon = 0; window_info.MainWindowProc = WinProc; window_info.lx = MWINDOW_LX; window_info.ty = MWINDOW_TY; window_info.rx = MWINDOW_RX; window_info.by = MWINDOW_BY; window_info.iBkColor = COLOR_lightwhite; window_info.dwAddData = 0; window_info.hHosting = HWND_DESKTOP; hMainWnd = CreateMainWindow(&window_info); if (hMainWnd == HWND_INVALID) return(0); else return(1); } int MiniGUIMain (int argc, const char ** argv) { MSG Msg; #ifdef _LITE_VERSION SetDesktopRect(0, 0, 800, 600); #endif InitMainWindow(); ShowWindow(hMainWnd, SW_SHOWNORMAL); while (GetMessage(&Msg, hMainWnd)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } MainWindowThreadCleanup(hMainWnd); return(0); } #ifndef _LITE_VERSION #include #endif --------------------------------------------------------------------------test.c end 1. Build MiniGUI for PC: (a) build lib #Cd build_x86 #Cd libminigui-1.3.3 #./configure #make #make install #cd .. (b) install resource #cd minigui-res-1.3.3 #make install #cd .. (Resources are installed to /usr/local/lib/minigui/) (c) build and run test #gcc –o test test.c –lpthread –lminigui –ljpeg –lpng –lz –lttf Change the values of gal_engine and ial_engine of the [system] group in /usr/local/etc/MiniGUI.cfg to qvfb #qvfb –width 640 –height 480 –depth 16 & #./test #cd .. 2. Build MiniGUI for ARM: (a) build lib #cd build_arm #cd libminigui-1.3.3 #make menuconfig In the default settings Change "NEWGAL" to "OLDGAL" in "GAL engine options"; Keep the last three items in "Font options" and uncheck the rest; Remove support for JPG and PNG in "Image options"; In the "Development environment options", set "Compiler" to "arm-linux-gcc" and "Path prefix" to "/usr/local/arm/2.95.3/arm-linux" (assuming the cross-compilation environment is installed in /usr/local/arm). All other options are set to their default values. Save the changes and exit menuconfig #make #make install #cd .. (b) build test.c #arm-linux-gcc –o test test.c –lpthread –lminigui This will create a file called test. (c) Setting up the root file system Assume that there is already a root file system available Copy the library files previously installed in /usr/local/arm/2.95.3/arm-linux/lib to the /lib directory of the target file system. If you are not sure which library files in that directory need to be copied, you can repeat the process of 2.(a) and change the value of "Path prefix" to the path of an empty directory you created in advance. For example, I created a new directory /root/need and changed the value of "Path prefix" to "/root/need". Then after executing 2.(a), all the files in the /root/need/lib directory are the MiniGUI library files we need to copy. (This method is very redundant-_-) Copy the /usr/local/etc/MiniGUI.cfg file to the /usr/local/etc/ directory of the target file system, and modify the file, change the value of gal_engine in the [system] group to "fbcon", the value of ial_engine to "console", the value of mdev to "/dev/mouse", the value of mtype to "PS2", and change the defaultmode in the [fbcon] group to "640x480-16bpp" (depending on the actual situation). Copy the entire directory /usr/local/lib/minigui/res to /usr/local/lib/minigui on the target file system. Finally, copy the compiled test file to /bin of the target file system. (d) Setting up the mouse My LCD doesn't have a touch screen, so I need to set up a mouse. My mouse uses a USB port. Modify the file system's /etc/init.d/rcS and add a line: "ln /dev/input/mice /dev/mouse" (e) run Power on the board and execute via minicom: #test & You can see the running results on the LCD.
Previous article:Remote multi-channel data acquisition system solution and hardware details
Next article:Research on audio decoder single chip system based on ARM core
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Let you know about brushless DC motor
- EETalk: What pitfalls have you encountered during PCB design?
- Harbin Institute of Technology and Harbin Engineering University are banned from using genuine MATLAB software. What do you think about this?
- How to design an RC oscillator circuit with an output frequency of 1k to 3.2MHz
- Will power management integrated circuits (PMIC) be the mainstream direction in the future?
- What is the minimum power consumption of the Zigbee module?
- Summary of EMC principles for PCB design
- TI UCC28782 makes a miniaturized adapter
- What does N/A mean in TI chip manuals?
- How non-isolated switching power supplies work