Andriod Deep Exploration (Vol. 1) Hal and Driver Development Nineth Chapter reading experience

Source: Internet
Author: User

This chapter focuses on the hardware abstraction layer:HAL, it is built onLinuxA set of libraries on top of the driver. I was just beginning to explain whyAndroidJoin inHAL, the purpose is to have three, one, unified hardware call interface. Two, to solve theGPL Copyright issue. Third, for some special requirements. You can use the HAL code located in user space to assist the Linux driver in doing some work.

The next section saysAndroid HALArchitecture. Next, we'll talk aboutLedDrive increaseHal, which mainly moves all the business logic from the led driver to the HAL module, while the LED driver retains only the function of the read-write register.

Involved inHALSteps:1.WriteLinuxDriven2. Write HAL Library 3. Write Service Library Lite LED driver

hal

The first step: defining structs and Macros writing HAL modules requires 3 very important structures, and in the first step you need to define two new structures.

Step Two: WriteHALModule'sOpenFunctionOpenfunction isHALThe entry point of the module. In this example, you are using theThe led_device_open function. This function mainly does the following three work. Initializes the hw_device_t of the sub-structure. Open the device file. initializes the register.

Step three: Define hw_module_methhods_t structure variables

Fourth step: Define the hal_module_info_sym function

Fifth Step: WriteHALModule'sclose when halclose

led

In summary, this chapter describes a way to drive Linux in an Android system .

My Blog Park address is: http://www.cnblogs.com/zzp036/p/5449784.html

Andriod Deep Exploration (Vol. 1) Hal and Driver Development Nineth Chapter reading experience

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.