Led tick driver

Source: Internet
Author: User
Hardware resource LED2--GPO_06 control. Porting code gpio underlying API gpio-related underlying API is implemented in the arch/ARM/mach-lpc32xx/include/Mach/lpc32xx_gpio.h file. Usage example: 536/* Set led gpio as an output */537 _ raw_writel (outp_state_gpo (1), gpio_p2_dir_set (gpio_iobase )); 292/* enable the backlight */293 # If defined (outputs) 294 _ raw_writel (outp_state_gpo (4), gpio_p3_outp_clr (gpio_iobase); 295 # Elif defined (outputs) 296 _ raw_writel (outp_state_gpo (4), gpio_p3_outp_set (gpio_iobase); 297 # endif LED driver GP O_06 is a function reuse pin, gpo_06 and lcdvd [18]. Select the register p3_mux_clr [6] and set it to gpo_06: Code __raw_writel (1 <6), lower (gpio_iobase); pull high and lower gpo_06, registers: p3_outp_set and p3_outp_clr, all are bit6: Code :__ raw_writel (outp_state_gpo (6), round (gpio_iobase); _ raw_writel (outp_state_gpo (6), round (gpio_iobase); definition of round :. /ARCH/ARM/mach-lpc32xx/arch-lpc32xx.c: # define gpio_iobase io_p2v (gpio_base ). /ARCH/ARM/mach-lpc32xx/sys-lpc32xx.h: # define gpio_iobase io_p2v (gpio_base) Tick implementation code ARCH/ARM/mach-lpc32xx/sys-lpc32xx.h file: 69 # Elif defined (config_smartarm3250_enable_led_tick) 70 # define ledtick {\ 71 static int blink = 0; \ 72 static int tick1 = 0; \ 73 tick1 ++; \ 74 if (tick1> Hz) \ 75 {\ 76 tick1 = 0; \ 77 blink = 1-blink; \ 78 If (blink = 0) {\ 79 _ raw_writel (outp_state_gpo (6 ), gpio_p3_outp_set (gpio_iobase); \ 80} \ 81 else {\ 82 _ raw_writel (outp_state_gpo (6), gpio_p3_outp_clr (gpio_iobase )); \ 83} \ 84} \ 85} 86 # else

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.