The eighth chapter mainly learns to let the development Board make the sound: buzzer drive. The first thing you should know is that the buzzer is a hardware device on the s3c6410 Development Board. Then we have to learn the Linux-driven code reuse problem, he has many ways, you can use the standard C program, the code will be reused in other files. Alternatively, you can use another dynamic reuse approach, where a Linux driver can use resources from another Linux driver. Then the compilation is a Linux driver composed of multiple files, the relevant code see the textbook. Let's look at another way of sharing code: module dependencies, which are the symbols that are exported from another driver module in one drive module.
Then it is to forcibly uninstall the Linux driver, when the initialization function crashes and the Unload function is blocked, you need to do a Linux driver forced unloading.
Finally, the PWM driver is studied by means of pulses to control the opening and stopping of the buzzer. PWM can be switched on and off via the I/O command. The PWM driver consists of 3 files: pwm.c, PWM_FUN.C, Pwm_fun.h. Where PWM.C is the driver main program. Pwm_fun.h references the corresponding header file, as well as some of the macros defined. The Pwm_fun.c file contains two functions for opening and stopping the PWM. Then perform a buzzer-driven test.
In this chapter, I have mastered the common use of Linux Drive code reuse and forcibly uninstall the Liunx drive method, we can eliminate the pain of constantly restarting the machine.
Eighth Chapter Experience