From 3fff6023602822531efdae30bc8ebf862967f1ef Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Mon, 25 Jul 2022 17:55:39 +0200 Subject: Initial Commit --- .../projects/briey/timer/src/main.c | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 VexRiscvSocSoftware/projects/briey/timer/src/main.c (limited to 'VexRiscvSocSoftware/projects/briey/timer/src/main.c') diff --git a/VexRiscvSocSoftware/projects/briey/timer/src/main.c b/VexRiscvSocSoftware/projects/briey/timer/src/main.c new file mode 100755 index 0000000..1b3531b --- /dev/null +++ b/VexRiscvSocSoftware/projects/briey/timer/src/main.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include + +#include + +int main() { + interruptCtrl_init(TIMER_INTERRUPT); + prescaler_init(TIMER_PRESCALER); + timer_init(TIMER_A); + + TIMER_PRESCALER->LIMIT = 7; + + TIMER_A->LIMIT = 100; + TIMER_A->CLEARS_TICKS = 0x00010002; + + TIMER_INTERRUPT->PENDINGS = 0xF; + TIMER_INTERRUPT->MASKS = 0x1; +} + + +void irqCallback(){ + TIMER_INTERRUPT->PENDINGS = 1; +} + + -- cgit v1.2.3