aboutsummaryrefslogtreecommitdiffstats
path: root/src/sam3x8e/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sam3x8e/internal.h')
-rw-r--r--src/sam3x8e/internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sam3x8e/internal.h b/src/sam3x8e/internal.h
new file mode 100644
index 00000000..733ef694
--- /dev/null
+++ b/src/sam3x8e/internal.h
@@ -0,0 +1,13 @@
+#ifndef __SAM3_INTERNAL_H
+#define __SAM3_INTERNAL_H
+// Local definitions for sam3 code
+
+#include <stdint.h> // uint32_t
+
+#define GPIO(PORT, NUM) (((PORT)-'A') * 32 + (NUM))
+#define GPIO2PORT(PIN) ((PIN) / 32)
+#define GPIO2BIT(PIN) (1<<((PIN) % 32))
+
+void gpio_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up);
+
+#endif // internal.h