Android Drive Development (eight)----make the board sound: Buzzer driver

Source: Internet
Author: User

The buzzer is a hardware device on the S3C6410 Development Board that can control the buzzer by writing a specific value to the register.

In the previous chapters, two complete Linux drivers were written: Word_count Drive and LED driver, two have one thing in common is a source code file.

Code reuse can be divided into two types: static and dynamic. An important code consumer is about to be compiled together, resulting in an executable file or library.

The buzzer is similar to the LED and is a simple hardware that comes with the s3c6410 Development Board. If the buzzer is turned on, the Development Board beeps like a beep and the buzzer is turned off to stop the scream.

If you are writing a Linux driver that is logically correct, it can be loaded and unloaded normally, but in some cases, some programs may get abnormal conditions. The Linux driver may not uninstall properly.

The buzzer is also called PWM, the basic principle is to control the buzzer by pulse to open and stop.

The PWM driver consists of three files: Pwm_c.pwm_fun.h, pwm_fun.c. Where PWM.C is the driver main program. Pwm_fun.h refers to the corresponding header file and defines some macros. The Pwm_fun.c file contains two functions for opening and stopping the PWM.

Android Drive Development (eight)----make the 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.