Driver and display LCD screen with gpio port-mini2440

Source: Internet
Author: User
Tags usleep

-------------------------------------------

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.