LED will blink for me: Control curtain J-Glow two-stage tube

Source: Internet
Author: User

This chapter is the switch that sends data control LED lights through the Linux drive. At the beginning of the LED lights through the drive control we need to create the LED drive device files: Step One: Initialize Cdev using the Cdev-init function step two: Specify the device number step three: Use the Cdev-add function to add a character device to a character device array in the kernel fourth step: Create a struct with a Class-create macro Class Fifth: Using the device creat function to create the equipment files while uninstalling the LED-driven device files, you need to call Device-destory, Class-destory, and unregistor-chrder-region (dev __t from,.unsigned count)

We must be aware of the register before controlling the LED on and off: including the LED has two pins, the control led needs to be completed by 3 registers, each register can use 4 characters, use the low 4 bits of the Gpmdat register to control the light off of 4 LEDs.

The LED driver can control the driver using two methods: 1, controlling the led;2 via string, and control the LED through the I/O command

The LED driver test method can not only send strings to the LED device files, but also send I/O control commands. These test methods include executable program testing, NDK testing, and Java testing.

LED driver is a real Linux driver that deals with hardware. We need a more comprehensive understanding of the advanced technologies of Linux drivers and learn more about Linux drive technology so that you can skillfully write driver code.

LED will blink for me: Control curtain J-Glow two-stage tube

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.