The main example of this is the buzzer driver, the buzzer is the s3c6410 Development Board comes with a hardware device. The first section of Linux-driven code reuse, code reuse is divided into static reuse and dynamic reuse, the code to be reused is declared in the header file, this is static reuse, the Linux driver can use the resources in another Linux drive, which is dynamic reuse. One of the code shares is a module dependency, also known as an export symbol, that is used in one drive module to use the exported symbol in another drive module. The second section of the Linux driver does not uninstall properly, need to forcibly uninstall, but this chapter of the method can not forcibly uninstall all the Linux driver module, only uninstall due to abnormal conditions caused by the Linux driver module can not be uninstalled. For example, the initialization function crashes, the performance is that the current Linux driver module is not used by any other Linux driver module, but the display has been referenced once. The workaround is to clear 0 of the current Linux driver Module reference counter. The Unload function is blocked, and the behavior is that a rmmod command will stop there and never return to the operating prompt of the system, and the workaround is to replace the original unload function with an empty unload function. In the third section, the driving principle of buzzer is to control the opening and stopping of buzzer by pulse, which is called PWM.
This chapter is a buzzer driver, the buzzer driver is more classic. In the learning process, you should carefully study each step and its code.
The eighth chapter makes the Development Board sound: Buzzer driver