8th, make the Development Board sound: Buzzer driver

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.