JZ2440 Light an LED

Source: Internet
Author: User

LED labeled D10, its corresponding Gpio is GPF4, that is, set GPF4 for output, and pull low to low level "specific principle view JZ2440 schematic"

1 #defineGpfcon (* (volatile unsigned long *) 0x56000050)2 #defineGpfdat (* (volatile unsigned long *) 0x56000054)3 4 #defineGpf4_o (1<< (4*2))5 6 intMain ()7 {8     //set GPF4 to output IO9Gpfcon =Gpf4_o;Ten     //pull the GPF output all high OneGpfdat =0XFF; A      -      while(1){ -         //set the GPF4 output to a low level theGpfdat &= ~ (1<<4); -     } -  -     return 0; +}

As a result of the experiment, inadvertently found that the GPF output defaults to low level, that is, set GPF4 for export, do not set the level, LED will also light, so in order to achieve experimental results, in the 11th row gpf all IO port pull high.

JZ2440 lit an LED

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.