Android Deep Explore (Volume one) HAL and Driver Development chapter Eighth

Source: Internet
Author: User

By learning Android Deep Exploration (Volume one) HAL and Driver Development eighth chapter Let me know how to make the Development Board sound, how to write a buzzer driver. Understand the code reuse of Linux drive, code reuse is divided into static and dynamic two kinds.

Linux-driven code reuse there are many ways, you can use the standard C program, the code of the important code in other files, if you want to use some features, include the corresponding header file, this method is called static reuse, Another way of dynamic reuse is that a Linux driver can use resources from another Linux driver.

If you test the Linux driver in a way that dynamically loads the. ko file on the emulator or board, even if the Linux driver is not normal, the dynamic Linux module will unload from memory if you restart the emulator or development version, but if you restart the computer every time it is easy to crash the machine, you need a way to solve this problem , the Linux driver can still be uninstalled without booting the machine when the Linux drive cannot be uninstalled via the Rmmod command. Our solution is to find the first address of the system assigned to the Linux-powered module struct to be unloaded from the/proc/kallsyms file, and then forcibly convert the first address to the module struct pointer.

Buzzer driver principle: Buzzer is also called PWM (pulse width modulation), the basic principle is to control the buzzer by pulse to open and stop.

Android Deep Explore (Volume one) HAL and Driver Development chapter Eighth

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.