The eighth chapter makes the Development Board sound: Buzzer driver

Source: Internet
Author: User

The buzzer is also called PWM pulse width modulation, the basic principle is to control the buzzer by the pulse to open and stop. A buzzer is a hardware device on a development Board that can control the sound emitted by a buzzer by writing a specific value to the register. This section describes the principle of buzzer implementation and implements a complete buzzer driver that can be turned on and off. PWM drives are implemented differently than led drivers, and PWM drivers are made up of multiple files, which is the standard implementation of most Linux drivers.

There are many ways to reuse Linux-driven code. It is divided into static reuse and dynamic reuse, and static reuse is code-level reuse, which is to compile the code that needs to be reused and use the code, and eventually generate an executable file or library (. Ko and. So, etc.). Code sharing is the use of symbols (constants, variables, functions, etc.) that are exported from another driver module in one drive module.

If you write a Linux driver that is correct, it can be loaded and unloaded normally, but in some cases there may be exceptions for some programs, and Linux drivers may not unload properly. If you test the Linux driver in a way that dynamically loads. ko files on the emulator or on the board, even if the Linux driver cannot be uninstalled properly, the dynamic Linux module will be unloaded from memory as long as the emulator or Development Board is restarted.

The eighth chapter makes the Development Board sound: Buzzer driver

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.