aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index 8ca6ada..3891e52 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -3,15 +3,18 @@ const gpio = @import("gpio.zig");
const rcc: *[39]u32 = @ptrFromInt(0x40021000);
const gpioa = gpio.gpioa;
+const gpioc = gpio.gpioc;
export fn _start() callconv(.C) noreturn {
cpu.interrupt_disable();
- rcc[19] |= 1; // gpioaen
+ rcc[19] |= 5; // gpio a and c
gpioa.set_mode(5, .output);
+ gpioc.set_mode(13, .input);
while (true) {
- gpioa.toggle(5);
+ const state = gpioc.read(13);
+ gpioa.write(5, state);
}
}