Android Deep Exploration (Vol. 1) HAL and Driver development Eighth Chapter summary

Source: Internet
Author: User

This chapter is mainly about the buzzer driver, the buzzer iss3cc6410Development Board with a hardware device, this section will introduce the principle of the buzzer, and achieve a complete buzzer driver. This section describes theLinuxthe way the drive is divided into multiple files. The data structure, function code in these files can also be used by several different drivers, so this is also an important method of code reuse. In theLinuxDrive code reuse, for exampleCThe language source code file hasmain.c,fun.c,product.cand theproduct.h. Whichmain.cis aLinuxDrive the main program. In thefun.cand theproduct.cdefined and implemented in themain.cthe function used in the. In themain.cthrough theexternkeyword Usagefun.cand then learn the forced unloadLinuxdriver, can only unload due to unloading abnormal conditions caused byLinuxThe driver module cannot be uninstalled. Situation1: initialization function crashes2: Unload function is blocked

Buzzer driver is a focus, through the corresponding register to control the buzzer opening and closing, and in the experimental buzzer driver, the opening and closing of the honey device function in another C source code file. The PWM driver consists of three files:PWM. C,PWM-fun.h,pwm-fun.c, wherein PWM.C is to drive the main program.

Through the study of this chapter, We can master the common code reuse mode of Linux driver. In addition, the method of forcibly uninstalling Linux drivers was learned.

http://home.cnblogs.com/u/zivjeli/

Android Deep Exploration (Vol. 1) HAL and Driver development Eighth Chapter summary

Related Article

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.