aboutsummaryrefslogtreecommitdiffstats
path: root/sw/init.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-08-16 13:01:15 -0230
committerSam Anthony <sam@samanthony.xyz>2025-08-16 13:01:15 -0230
commit478a91bd82e27d8d6b2e597fd659e484ca6b205a (patch)
tree05c58d2018059cbf9b60baeb26409f4df97358eb /sw/init.c
parenta8a68e5e77cac2fedb03a164acc666ccc1a1a8b1 (diff)
downloadcan-gauge-interface-478a91bd82e27d8d6b2e597fd659e484ca6b205a.zip
add systests to makefile
Diffstat (limited to 'sw/init.c')
-rw-r--r--sw/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/init.c b/sw/init.c
new file mode 100644
index 0000000..9c89bee
--- /dev/null
+++ b/sw/init.c
@@ -0,0 +1,17 @@
+#include <xc.h>
+
+#include "init.h"
+
+void
+clockInit(void) {
+ OSCCON = 0xFC; // HFINTOSC @ 16MHz, 3x PLL, PLL enabled
+ ACTCON = 0x90; // active clock tuning enabled for USB
+}
+
+void
+pinsInit(void) {
+ // Disable all analog pin functions
+ ANSELA = 0;
+ ANSELB = 0;
+ ANSELC = 0;
+}