/******************************************************************************
	
	Project: Ex1_BlinkLed

	Author: Gerhard Buger
	Date: 22th of March 2008
	Compiler: gnu gcc with Eclipse as IDE
	Platform: LPC2148, ARM7 TDMI micro controller

	Description: Example project for AKKON Controller Board V1.4

	This proram denonstrates a blinkin led

	Serial port settings: 115200 Baud, 8 data bit, 1 stop bit, no parity

******************************************************************************/	

#define __MAIN_C__

/* General Purpose Input/Output (GPIO) */
#define GPIO_BASE_ADDR		0xE0028000
#define IOSET0         (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x04))
#define IODIR0         (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x08))
#define IOCLR0         (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x0C))

#define MODUL_LED_PIN  25
#define MODUL_LED_MASK (1<< MODUL_LED_PIN)
#define MODUL_Led_On	IOSET0 = MODUL_LED_MASK
#define MODUL_Led_Off	IOCLR0 = MODUL_LED_MASK


static void InitLed()
{
	IODIR0 |= MODUL_LED_MASK;
	IOSET0 = MODUL_LED_MASK;
}

void Delay(long count)
{
	volatile long l;
	l = count;
	while (l>=0)
		l--;		
}


int main(void)
{
	InitLed(); 	
	while (1==1)		   
	{
		Delay(50000L);				
		MODUL_Led_On;
		Delay(50000L);				
		MODUL_Led_Off;
	}
}