testing minimal program
[rpikern] / src / gpio.h
index 19ca6c3..3a2e253 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef GPIO_H_
 #define GPIO_H_
 
+#include "config.h"
 #include "asm.h"
 
-#define GPIO_BASE      0x3f200000
+#define GPIO_BASE      (IO_BASE | 0x200000)
 #define GPIO_REG(x)    (*(volatile uint32_t*)(GPIO_BASE | (x)))
 
 /* function select */
@@ -83,6 +84,8 @@ static inline void gpio_fsel(int x, int f)
        }
 }
 
+void delay(uint32_t x);        /* in startup.s */
+
 static inline void gpio_pullups(uint32_t mask0, uint32_t mask1, int state)
 {
        REG_GPPUD = state;