1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-01 08:06:16 +02:00

add init LCD and keyboard

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
Xiangfu Liu 2010-04-22 15:05:52 +08:00
parent f348f4f104
commit 40242c948f

View File

@ -55,6 +55,10 @@ void load_args()
ARG_COL_ADDR = 9;
}
#define GPIO_LCD_CS (2 * 32 + 21)
#define GPIO_KEYOUT_BASE (2 * 32 + 10)
#define GPIO_KEYIN_BASE (3 * 32 + 18)
void gpio_init()
{
__gpio_as_nand();
@ -63,7 +67,17 @@ void gpio_init()
__gpio_as_lcd_18bit();
__gpio_as_msc();
#define GPIO_LCD_CS (2 * 32 + 21)
unsigned int i;
for (i = 0; i < 7; i++){
__gpio_as_input(GPIO_KEYIN_BASE + i);
__gpio_enable_pull(GPIO_KEYIN_BASE + i);
}
for (i = 0; i < 8; i++) {
__gpio_as_output(GPIO_KEYOUT_BASE + i);
__gpio_clear_pin(GPIO_KEYOUT_BASE + i);
}
__gpio_as_output(GPIO_LCD_CS);
__gpio_clear_pin(GPIO_LCD_CS);
}