2013年8月7日星期三

Embedded system implementation principle of LCD driver

LCD (liquid crystal display) module to meet the increasing demands of embedded systems, it can display Chinese characters, characters and graphics, but also has low voltage, low power consumption, small size, light weight and slim, and many other advantages. As embedded systems more widely, more powerful functions, human-machine interface for the system requirements are also increasing, driven by the application needs a lot of work under Linux graphical interface software package development and porting work are related to the underlying LCD driver development issues. Therefore in embedded systems developers lcd module driver can be widely used.
A device driver is operating system kernel and te interface between the machine hardware, device drivers for the application shielding the details of the hardware, so that appears in the application, the hardware device is a device file, the application can be like ordinary file operations on hardware devices. A device driver is part of the kernel, it is mainly to complete the function are: the device initialization and release; transfer the data from the kernel to the hardware and the data is read from the hardware; read the application data sent to the device file, loopback application requested data and detecting errors and processing equipment.
 Linux is the most basic equipment is divided into two categories: one is a character device, and the other is a block device. Character devices and block devices is the main difference: the right character device issue read / write requests, the actual hardware I / O generally ensued. Character device to a single byte units sequential read and write operations, typically do not use buffering techniques; block device is based on a fixed-size blocks of data storage and read-write, such as hard disk, floppy disk, etc., and use a system memory as a buffer areas. To improve efficiency, the system provides for block devices to read and write caching mechanism, as it involves buffer management, scheduling and synchronization problems, to implement much more complex than the character device. Character LCD Module is the way to be a character device access and management, Linux display driver seen the character device, the data to display a byte by byte sent an LCD driver.
Linux device and file system management is closely integrated, variety of devices in the form of documents stored in the / dev directory, called device files. Application can open, close, and read and write files of these devices to complete the operation of the device, just like the ordinary operation of the data files. In order to manage these devices, the system for devices numbered, each device number is divided into main and minor device numbers. The main equipment used to distinguish different types of equipment, and minor device number used to distinguish multiple devices of the same type. For commonly used equipment, Linux has the number of convention, such as the hard disk master device number is 3. Linux device files for all operating functions provides a unified interface method is to use the data structure struct file_operations. This data structure includes pointers to many operating functions, such as open (), close (), read () and write (), etc., but due to more types of peripherals, operating in different ways. Struct file_operations the members of the structure as a series of interface functions, such as for read / write read / write functions and is used to control the ioctl like. Open a file is to call this file file_operations the open operation. Different types of files have different file_operations member functions, such as ordinary disk data files, interface functions complete disk data block read and write operations; while for a variety of device files, you end up calling each driver I / O functions for specific equipment operation. Thus, applications do not have to consider the operation of the device or ordinary file, you can always as document processing, has a very clear and unified I / O interface. So file_operations is a file-level I / O interface.

没有评论:

发表评论