aboutsummaryrefslogtreecommitdiff
path: root/driver/config.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-05-12 15:21:19 +0200
committerlonkaars <loek@pipeframe.xyz>2024-05-12 15:21:19 +0200
commit891595b9307eb2695411d8e32e4addd9cd927ec8 (patch)
treeb24c323ad3e09f05ca75386ac8fef38a6fff3e74 /driver/config.h
parent6926a88695ce2e9fca51e01a1bf6fded3e4cbcca (diff)
rename folders
Diffstat (limited to 'driver/config.h')
-rw-r--r--driver/config.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/driver/config.h b/driver/config.h
new file mode 100644
index 0000000..dbe3a86
--- /dev/null
+++ b/driver/config.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#define DRV_NAME "lork"
+
+#include <linux/types.h>
+
+// values from <https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf>
+
+typedef uint32_t ti_am335x_word_t;
+
+// p. 180: "Control Module"
+#define TI_AM335X_CM_ADDR 0x44E10000
+// p. 182: "GPIO1"
+#define TI_AM335X_GPIO1_ADDR 0x4804C000
+// p. 1459: "conf_gpmc_a3"
+#define TI_AM335X_CM_GPMC_A3_ADDR (TI_AM335X_CM_ADDR + 0x84C)
+
+// p. 4990, variable names copied as-is
+#define GPIO_OE (0x134 / (sizeof(ti_am335x_word_t)))
+#define GPIO_DATAIN (0x138 / (sizeof(ti_am335x_word_t)))
+#define GPIO_CLEARDATAOUT (0x190 / (sizeof(ti_am335x_word_t)))
+#define GPIO_SETDATAOUT (0x194 / (sizeof(ti_am335x_word_t)))
+// total size of GPIO registers from p. 4990 (in bytes)
+#define GPIO_REG_SIZE 0x198
+
+#define PIN 19