1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2025-04-21 12:27:27 +03:00
This commit is contained in:
Bas Wijnen
2009-06-22 16:13:00 +02:00
parent ef229121ed
commit 40a9a29c2d
5 changed files with 21 additions and 17 deletions

View File

@@ -0,0 +1,9 @@
#pypp 0
#ifndef __IRIS_DEVICES_HH
#define __IRIS_DEVICES_HH
// lcd driver.
#define LCD_BACKLIGHT 1
#define LCD_RESET 2
#endif

View File

@@ -85,11 +85,8 @@ static void lcd_disable ():
set_backlight (0)
static void reset ():
// Use gpio pins as pwm.
GPIO_GPAUR (2) = (GPIO_GPAUR (2) & ~0x0fffffff) | 0x50000000
// Use gpio pins as lcd master.
GPIO_GPALR (1) = (GPIO_GPALR (1) & ~0x0000ffff) | 0x55550000
GPIO_GPAUR (1) = 0x556a5555
gpio_as_pwm ()
gpio_as_lcd_master ()
// initialize things.
GPIO_GPIER (2) &= ~(PWM_ENABLE | LCD_RET | SPEN | SPCK | SPDA)
@@ -126,12 +123,6 @@ static void reset ():
CPM_MSCR &= ~(1 << 7)
mdelay (1)
static void map_io (unsigned physical, unsigned address):
Capability page = memory_create_page (__my_memory)
alloc_physical (page, physical, 0)
memory_map (__my_memory, page, address, 1)
//drop (page)
int main ():
map_gpio ()
map_pwm0 ()
@@ -140,6 +131,13 @@ int main ():
reset ()
while true:
for unsigned i = 0; i <= 300; i += 30:
set_backlight (i)
kdebug (0)
mdelay (50)
schedule ()
while true:
Message msg
if !wait (&msg):