Added soclet with gpio banks to top
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#define GPIO_BASE 0x40000000u
|
||||
#define VOUT_BASE 0x40000004u
|
||||
|
||||
static volatile uint32_t * const gpio = (volatile uint32_t *)GPIO_BASE;
|
||||
static volatile uint32_t * const vout = (volatile uint32_t *)VOUT_BASE;
|
||||
|
||||
static void delay(volatile uint32_t ticks){
|
||||
while (ticks--) {
|
||||
@@ -15,8 +17,11 @@ int main(void)
|
||||
uint32_t v = 0;
|
||||
|
||||
for (;;) {
|
||||
*gpio = v;
|
||||
v++;
|
||||
delay(20000u);
|
||||
for(int i=0; i<1000; i++){
|
||||
*vout = v;
|
||||
v++;
|
||||
delay(5u);
|
||||
}
|
||||
*gpio ^= 0xffffffff;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user