-------------------------------------------
Target: LCD screen driver and display.
Understand the control method of gpio, and write a simple menu Test Program (including the display of colored Chinese characters and static pictures)
--------------------------------------------
I. Glossary
1. What is a gpio port? What are the related resources in mini2440?
A:
2.2416/2440 chip information on gpio ports (data sheet)
Ii. source code parsing
1. sys/IOCTL. h
2. ior, Iow
3. See the code architecture.
4. # functions of include <afxext. h>
A:
Define some extensions of MFC. The defined classes include: // classes declared in this file // cobject // csf-target; // cwnd // cbutton class cbitmapbutton; // Bitmap Button (self-draw) Class ccontrolbar; // control bar class cstatusbar; // status bar class ctoolbar; // toolbar class cdialogbar; // dialog as control bar class crebar; // ie40 Dock bar class csplitterwnd; // splitter manager // cview // cscrollview class cformview; // view with a dialog template class ceditview; // simple text editor view // CDC class cmetafiledc; // A Metafile with proxyclass crecttracker; // tracker for rectangle objects
5. usage of the extern variable
Extern can be placed before a variable or function to indicate that the definition of a variable or function is in another file, prompting the compiler to find its definition in other modules when it encounters this variable or function.
In addition, extern can be used to specify links.
Iii. LCD Driver Analysis
1. MMAP (void *) target, length, prot_read | prot_write, map_shared, FD, target) // parameter xiangjie? Especially target
2. Volatile byte * lcdw.adr // What does it mean? 3.
Void xadd (char startx, char endx) {lcdcom_master (0x2a); // understand the meaning of these addresses: lcddata_master (startx); lcddata_master (endx );}
4.
// Map the user space memory address to the kernel space memory address lcd1_adr = (byte *) mapdirectioregister (LCD _command, map_size );
5.
LCD _rst_low; usleep (100000); LCD _rst_hig; usleep (100000); // simulate a square wave LCD _on;
6.