summaryrefslogtreecommitdiffstats
path: root/ports/beagleboneblack/cpuio.h
diff options
context:
space:
mode:
authorEd Sutter <edsutterjr@gmail.com>2015-07-13 22:11:27 -0400
committerEd Sutter <edsutterjr@gmail.com>2015-07-13 22:11:27 -0400
commitb8ffb40eaadaf34b218578b818ece0323430c756 (patch)
tree2075de1194f0a19d08974d6ee1f41592336f245c /ports/beagleboneblack/cpuio.h
parentreplace bashrc with envsetup to eliminate implication that it is bash specific (diff)
downloadumon-b8ffb40eaadaf34b218578b818ece0323430c756.tar.bz2
BBB: Changes to support runtime blinking LED.
Diffstat (limited to 'ports/beagleboneblack/cpuio.h')
-rw-r--r--ports/beagleboneblack/cpuio.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/ports/beagleboneblack/cpuio.h b/ports/beagleboneblack/cpuio.h
index 2ae9891..d1c4fd7 100644
--- a/ports/beagleboneblack/cpuio.h
+++ b/ports/beagleboneblack/cpuio.h
@@ -1 +1,22 @@
#define DEFAULT_BAUD_RATE 115200
+
+#define HWREAD32(a) *(volatile unsigned long *)(a)
+#define HWREAD16(a) *(volatile unsigned short *)(a)
+#define HWREAD8(a) *(volatile unsigned char *)(a)
+
+#define HWWRITE32(a,b) *(volatile unsigned long *)(a) = (b)
+#define HWWRITE16(a,b) *(volatile unsigned short *)(a) = (b)
+#define HWWRITE8(a,b) *(volatile unsigned char *)(a) = (b)
+
+#define GPIO1_21 (1<<21)
+#define GPIO1_22 (1<<22)
+#define GPIO1_23 (1<<23)
+#define GPIO1_24 (1<<24)
+
+// Referring to BBB schematic...
+// Pg6 shows the 4 user leds, pg3 shows the pins on the Sitara
+// The four user leds are on GPIO1, pins 21-24
+#define USR0_LED GPIO1_21 // Ball V15: GPMC_A5 mode7 (D2)
+#define USR1_LED GPIO1_22 // Ball U15: GPMC_A6 mode7 (D3)
+#define USR2_LED GPIO1_23 // Ball T15: GPMC_A7 mode7 (D4)
+#define USR3_LED GPIO1_24 // Ball V16: GPMC_A8 mode7 (D5)