aboutsummaryrefslogtreecommitdiff
path: root/driver_fw/include/iomacros.h
diff options
context:
space:
mode:
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__