Seventh chapter LED will blink for me: Control the Light emitting diode

Source: Internet
Author: User

For most Linux drivers, the need to interact directly with the hardware, this chapter focuses on the use of Linux drivers to control the light and dark of the diode, that is, the Linux drive to send data control on the Development board LED lights switch.

The first section introduces the realization principle of LED driver. The Linux driver does not write data directly to the memory in the hardware, but interacts with the native I/O memory, the Linux kernel provides multiple functions that interact with I/O memory, each hardware connected to Linux has a map header in I/O memory, and the LED on the Board has its first address.

In the second section, the LED driver is written in the following steps:

(1) Test the Development Board, turn on the power switch

(2) Create the LED drive device file

(3) Uninstalling the LED driver's device files

(4) Set register and initialize led driver

(5) Control LED

(6) Set the module parameters of the LED driver

(7) The complete code for the LED driver is given.

Section III describes the test led driver

(1) General program for writing test I/O control commands

(2) test led driver with NDK

(3) test led driver using Java

The fourth section introduces the porting of LED driver, the simplest porting is to compile it under different Linux kernel versions, while porting driver should pay attention to modify the driver's source code, try not to modify the driver interface.

This chapter is to realize the driver development through the specific control light emitting diode, through the experiment to understand the Android drive The example, understands the Android drive the transplant. Drive transplant is the essence of Android, in the process of learning must be careful to master every detail concept.

Seventh chapter LED will blink for me: Control the Light emitting diode

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.