The buzzer is a hardware device on the s3c6410 Development Board. You can control the buzzer by writing a specific value to the register. A complete buzzer drive (can turn the buzzer on and off). PW when the drive is implemented differently from the LED driver, the PWM driver will be composed of several files. This is also the standard implementation of most Linux drivers. That is to say-a complex driver is unlikely to put all the code in one file. It is a good idea to put the relevant code in the appropriate file. These files are co-compiled when the Linux driver is compiled. The data structure, function code in these files can also be used by several different drivers, so this is also an important method of code reuse. When developing a Linux driver, it is possible to have errors in functions such as Mountain T, exit, and so on, the Linux driver may fail to install, and, worse still, the Linux driver cannot be uninstalled properly using the Rmmod command, which will cause a dilemma that cannot be installed again. Of course, in this case, restarting the machine can be solved. But it's too much trouble to restart the machine every time. This eliminates the hassle of restarting the machine by directly modifying the Linux driver's corresponding memory address when encountering the inability to uninstall Linux drivers.
The PWM drive is similar to the LED driver implementation process and may be simpler. In this chapter it is only to demonstrate how to divide a Linux driver into multiple implementation files before using a relatively simple PWM driver. Through the study of this chapter, readers can master the common code reuse methods of Linux drivers. In addition, this chapter introduces a method of forcibly uninstalling Linux drivers. Through this method. Readers will be spared the pain of constantly restarting the machine.
Android Deep Exploration and Driver development (eight)