aboutsummaryrefslogtreecommitdiffstats
path: root/source/buttons.h
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-06-05 18:36:34 -0400
committerClyne Sullivan <clyne@bitgloo.com>2022-06-05 18:36:34 -0400
commit7fbb94cb15fdd20cd9ada11588568583128c77f4 (patch)
treeb774f823d35c9c77bf719d17a7dd70715effadce /source/buttons.h
parentfedc108c8f664b44ae1a4c0d6b6378584533c314 (diff)
move source to folder; openocd.sh programs directly
Diffstat (limited to 'source/buttons.h')
-rw-r--r--source/buttons.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/buttons.h b/source/buttons.h
new file mode 100644
index 0000000..ba7e02d
--- /dev/null
+++ b/source/buttons.h
@@ -0,0 +1,34 @@
+/**
+ * buttons.h - Provides ability to read button state.
+ * Copyright (C) 2020 Clyne Sullivan
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * See the GNU General Public License for more details.
+ */
+
+#ifndef BUTTONS_H_
+#define BUTTONS_H_
+
+#define BUTTON_JOYUL (1 << 7)
+#define BUTTON_JOYUR (1 << 6)
+#define BUTTON_JOYDR (1 << 5)
+#define BUTTON_JOYDL (1 << 4)
+#define BUTTON_JOY (1 << 3)
+#define BUTTON_1 (1 << 2)
+#define BUTTON_2 (1 << 1)
+#define BUTTON_3 (1 << 0)
+
+#define BUTTON_JOYUP (BUTTON_JOYUL | BUTTON_JOYUR)
+#define BUTTON_JOYDOWN (BUTTON_JOYDL | BUTTON_JOYDR)
+#define BUTTON_JOYLEFT (BUTTON_JOYUL | BUTTON_JOYDL)
+#define BUTTON_JOYRIGHT (BUTTON_JOYUR | BUTTON_JOYDR)
+
+extern unsigned char button_state;
+
+void buttons_init();
+
+#endif // BUTTONS_H_
+