aboutsummaryrefslogtreecommitdiff
path: root/center_fw/include/iomacros.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-09-25 23:57:36 +0200
committerjaseg <git@jaseg.de>2023-09-25 23:57:36 +0200
commit8cc05c79cea62609d02231492c054a0cca2b2289 (patch)
treee39d40456adefe9bb70bcd77ebdf97be1dcdc028 /center_fw/include/iomacros.h
parent583ac10d1450610a4110849c26cc16f03154d26e (diff)
download8seg-8cc05c79cea62609d02231492c054a0cca2b2289.tar.gz
8seg-8cc05c79cea62609d02231492c054a0cca2b2289.tar.bz2
8seg-8cc05c79cea62609d02231492c054a0cca2b2289.zip
Center firmware WIP
Diffstat (limited to 'center_fw/include/iomacros.h')
-rw-r--r--center_fw/include/iomacros.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/center_fw/include/iomacros.h b/center_fw/include/iomacros.h
new file mode 100644
index 0000000..8d84c9e
--- /dev/null
+++ b/center_fw/include/iomacros.h
@@ -0,0 +1,14 @@
+#ifndef __IOMACROS_H__
+#define __IOMACROS_H__
+
+#define IN(pin) (0)
+#define OUT(pin) (1<<(2*(pin)))
+#define AF(pin) (2<<(2*(pin)))
+#define ANALOG(pin) (3<<(2*(pin)))
+
+#define CLEAR(pin) (~(3<<(2*(pin))))
+
+#define AFRL(pin, val) ((val) << ((pin)*4))
+#define AFRH(pin, val) ((val) << (((pin)-8)*4))
+
+#endif __IOMACROS_H__