The eighth chapter makes the Development Board sound: buzzer Drive reading notes

Source: Internet
Author: User

Code reuse is divided into static and dynamic. Static reuse is when you use certain features, include the corresponding header file. Dynamic reuse is a Linux driver that can use resources from another Linux driver. When compiling multiple source code files in the C or C + + language, if A.C uses the functions in the B.C file, you need to use extern to pre-define the B.C in the a.c file, and extern is to tell the compiler the function name, the number of arguments, the parameter type, and the return value type. extern only works in the compile phase.

The Linux driver cannot be uninstalled using the Rmmod command when the Linux driver exception fails to unload properly. There are several situations: 1. Initialization function is dashed. 2. The Unload function is blocked. When this happens, the machine can be restarted, but it is cumbersome to reboot each time, so you can remove the Linux driver by modifying the corresponding memory address of the Linux driver.

The buzzer is a hardware device on the S3C6410 Development Board that controls the buzzer screaming by writing a specific value to the register. The basic principle uses pulses to control the opening and stopping of the buzzer. PWM is controlled using the Gpfcon register of Port F. The macro corresponding to the register in the Linux kernel is S3c64xx-gpfcon, which represents the virtual address of the Gpfcon register. The Gpfcon only uses up to two bits (30 and 31 bits) to control the PWM. When the maximum bit is 10 o'clock, the PWM is turned on. Stop the PWM for 00 o'clock.

The eighth chapter makes the Development Board sound: buzzer Drive reading notes

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.