E698PM LED test.c

From wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
#include <stdlib.h>
#include <stdio.h>  

#define GPIO_DIR_REG 	*(volatile unsigned int *)(0x80000608)	// GPIO direction register
 
int main(void) {

	int i,j;
	printf("Hello world!!!");
	while (1)
	{
		for (i=1; i<=0b10000; i<<=1)
		{
			GPIO_DIR_REG = i;
			for (j=0; j<400000; j++); // delay
		}
	}
	// should never reach here
	return EXIT_SUCCESS;
}