summaryrefslogtreecommitdiff
path: root/multiplexer.h
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-01 11:20:07 +0100
committerErich Eckner <git@eckner.net>2018-11-01 11:20:07 +0100
commitd9b831fcc29585eab34c58c5a67c060d886bc8a6 (patch)
tree6694c246dd55b33d73aaa01464bc73982b237953 /multiplexer.h
parent1da3a7ecddeff8c8ecbcc496f156651099dcf00d (diff)
downloadanzeige-d9b831fcc29585eab34c58c5a67c060d886bc8a6.tar.xz
multiplexer: set up pull-up resistor on SENSE_PIN
Diffstat (limited to 'multiplexer.h')
-rw-r--r--multiplexer.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/multiplexer.h b/multiplexer.h
index ed38ecd..86e99ee 100644
--- a/multiplexer.h
+++ b/multiplexer.h
@@ -5,6 +5,8 @@
// Dom and Gert
// Revised: 15-Feb-2013
+# include <stdint.h>
+
#ifndef __arm__
#define SKIP_GPIO
#endif
@@ -14,6 +16,23 @@
#define BCM2708_PERI_BASE 0x20000000
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */
+/** stolen/cited from wiringPi's wiringPi/wiringPi.c lines 536-548 **/
+
+// GPPUD:
+// GPIO Pin pull up/down register
+
+#define GPPUD 37
+// gpioToPUDCLK
+// (Word) offset to the Pull Up Down Clock regsiter
+
+static uint8_t gpioToPUDCLK [] =
+{
+ 38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
+ 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
+};
+
+/** cite end **/
+
#define PAGE_SIZE (4*1024)
#define BLOCK_SIZE (4*1024)