292 /* Enable the backlight */
293 #if defined (CONFIG_SMARTARM3250_QVGA_PANEL_V1_00)
294 __raw_writel(OUTP_STATE_GPO(4), GPIO_P3_OUTP_CLR(GPIO_IOBASE));
295 #elif defined (CONFIG_SMARTARM3250_QVGA_PANEL_V1_01)
296 __raw_writel(OUTP_STATE_GPO(4), GPIO_P3_OUTP_SET(GPIO_IOBASE));
297 #endif
LED驱动
GPO_06是功能复用引脚,GPO_06和LCDVD[18]。选择寄存器p3_mux_clr[6],置位为GPO_06:
代码:__raw_writel((1<<6), GPIO_P3_MUX_CLR(GPIO_IOBASE);
拉高拉低GPO_06,寄存器:p3_outp_set和p3_outp_clr,都是bit6:
代码:__raw_writel(OUTP_STATE_GPO(6), GPIO_P3_OUTP_SET(GPIO_IOBASE));
__raw_writel(OUTP_STATE_GPO(6), GPIO_P3_OUTP_CLR(GPIO_IOBASE));
GPIO_IOBASE的定义:
./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实现代码
arch/arm/mach-lpc32xx/sys-lpc32xx.h文件:
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