Through the study of this chapter I learned the following knowledge:
First, the knowledge of buzzer: Buzzer is also known as PWM (pulse width modulation), the basic principle is to control the buzzer by pulse to open and close, the output pin of the timer and the transistor of the buzzer connected, this circuit transistor is PNP, when the pin is high, the transistor is in saturation, circuit conduction, Current flow through the buzzer, at this time the buzzer audible, conversely, when the pin is high, the transistor is in the cut-off state, circuit shutdown, buzzer stop sound. The buzzer 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.
The buzzer is a hardware device on the S3C6410 Development Board that can control the buzzer by writing a specific value to the register.
Study of the Experiment: Compile 3. c files into 3.0 files, and deliver the 3.0 file chains to the. ko file. 1. Write main.c files, as well as FUN.C, product.c, and product.h files. 2. Write Makefile file obj-m: = main.o multi_file_driver-y: = FUN.O PRODUCT.O
Second, code reuse: 1, static reuse: The code to be reused in other files, if you want to use some features, include the corresponding header file can be 2, dynamic reuse: A Linux driver can use another Linux driver resources in the third, Uninstall the Linux driver module due to abnormal conditions can not be uninstalled in the following two scenarios:
1, initialization function crash: The current Linux driver module to clear the reference counter 0 can
2. The Unload function is blocked: Replace the original unload function with an empty unload function
The eighth chapter, let the Development Board sound: Buzzer driver