Difference between revisions of "E698PM LED test.c"

From wiki
Jump to navigation Jump to search
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(...")
 
imported>Bkavanagh
 
Line 1: Line 1:
  #include <stdlib.h>
  #include <stdlib.h>
  #include <stdio.h>   
  #include <stdio.h>   
 
  #define GPIO_DIR_REG *(volatile unsigned int *)(0x80000608) // GPIO direction register
  #define GPIO_DIR_REG *(volatile unsigned int *)(0x80000608) // GPIO direction register
 
  int main(void) {
  int main(void) {
   
   

Latest revision as of 01:06, 22 December 2020

#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;
}