The PWM,PWM driver can be opened and stopped by having an I/O command consisting of 3 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 (Pwm_start and Pwm_stop) that open and stop the PWM. After running, from the contents of the makefile file, the compiler first compiles the PWM.C and pwm_fun.c files into PWM.O and PWM_FUN.O, then links the two *.o files to PWM_DRIVER.O, and finally generates Pwm_driver.ko. Next Test the buzzer driver, first enter the/root/drivers/ioctl directory, execute the build script file to compile and upload the IOCTL file (if you start multiple Android devices, choose Upload to the s3c6410 board). Before testing the PWM driver, the PWM driver must be compiled and installed according to the method in the previous section, and then go to the Idata/local Directory of the Development Board terminal and enter the instructions for opening and closing the PWM. Because the IOCTL command must require parameters for input I/O commands, the PWM driver does not use I/o command parameters. So the last command line parameter of the IOCTL can be entered arbitrarily. After executing the above command, if the output (#. /ioctl/dev/pwm_dev 1 0) information, and PWM. A normal scream can be made, indicating that the PWM driver test was successful.
8th, make the Development Board sound: Buzzer driver