summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2024-09-09 20:18:14 +0800
committerSadeep Madurange <sadeep@asciimx.com>2024-09-09 20:18:14 +0800
commita2cff11cb50dca70fb4869e6ed7188504a398e27 (patch)
treee26877a65d4223b487c6d521f1b8d1c3e6f0c908 /main.c
parentccbba4c08477e8944aa8e64abfe8c8cfd6b7c5c9 (diff)
downloadbare-metal-arduino-due-a2cff11cb50dca70fb4869e6ed7188504a398e27.tar.gz
Linker script and a bunch of important fixes.
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..137e093
--- /dev/null
+++ b/main.c
@@ -0,0 +1,25 @@
+#define PIOC_PER *((volatile unsigned int *) 0x400E1200U)
+#define PIOC_OER *((volatile unsigned int *) 0x400E1210U)
+#define PIOC_IDR *((volatile unsigned int *) 0x400E1244U)
+#define PIOC_CODR *((volatile unsigned int *) 0x400E1234U)
+#define PIOC_IFDR *((volatile unsigned int *) 0x400E1224U)
+#define PIOC_MDDR *((volatile unsigned int *) 0x400E1254U)
+#define PIOC_ODSR *((volatile unsigned int *) 0x400E1238U)
+#define PIOC_PUDR *((volatile unsigned int *) 0x400E1260U)
+#define PIOC_OWDR *((volatile unsigned int *) 0x400E12A4U)
+
+int main(void)
+{
+ PIOC_PER = 0x00000001;
+ PIOC_OER = 0x00000001;
+ PIOC_IDR = 0x00000001;
+ PIOC_CODR = 0x00000001;
+ PIOC_IFDR = 0x00000001;
+ PIOC_MDDR = 0x00000001;
+ PIOC_PUDR = 0x00000001;
+ PIOC_OWDR = 0x00000001;
+
+ PIOC_ODSR = 0x00000001;
+
+ return 0;
+}