aboutsummaryrefslogtreecommitdiff
path: root/driver_fw/include/iomacros.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-08-27 22:31:09 +0200
committerjaseg <git@jaseg.de>2023-08-27 22:31:09 +0200
commitec28fcd9f905358759eea98161f451567135d17e (patch)
treeed8f0f4f96811433ddca5f294f731c7584549a36 /driver_fw/include/iomacros.h
parent7c2cb09fad601facbb142d9378033d64d19b6488 (diff)
download8seg-ec28fcd9f905358759eea98161f451567135d17e.tar.gz
8seg-ec28fcd9f905358759eea98161f451567135d17e.tar.bz2
8seg-ec28fcd9f905358759eea98161f451567135d17e.zip
new driver blinkenlights
Diffstat (limited to 'driver_fw/include/iomacros.h')
-rw-r--r--driver_fw/include/iomacros.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/driver_fw/include/iomacros.h b/driver_fw/include/iomacros.h
new file mode 100644
index 0000000..8d84c9e
--- /dev/null
+++ b/driver_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__