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