E698PM LED test.c

From wiki
Revision as of 01:06, 22 December 2020 by imported>Bkavanagh (Created page with " #include <stdlib.h> #include <stdio.h> #define GPIO_DIR_REG *(volatile unsigned int *)(0x80000608) // GPIO direction register int main(void) { int i,j; printf(...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#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;
}