This chapter describes the buzzer driver, which is a hardware device on the Development Board that can control the buzzer by writing a specific value to the register. The principle of the buzzer is realized and a complete buzzer driver is realized. PWM the drive is implemented in a different way than LED Drive, consisting of multiple files.
There are many ways to reuse Linux-driven code. For complex Linux drivers, it is necessary to use multiple source code files to store different function codes, facilitate code categorization and management, and compile multiple source code files.
Code reuse can be divided into two types: static and dynamic. This section describes the way a code is shared, which is dependent on the module.
For some Linux drivers that are not properly unloaded , such as initialization function crashes, the Unload function is blocked. This is required to obtain a module struct pointer that represents the Linux driver module to unload .
Next describes how to control the buzzer by the corresponding register to open and close, and in the implementation of the buzzer driver, the call and close the buzzer function is placed in another C source code file.
http://www.cnblogs.com/SJ-0325/
Buzzer Drive Reading notes