aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2018-03-26 12:29:10 -0400
committerClyne Sullivan <clyne@bitgloo.com>2018-03-26 12:29:10 -0400
commit2b034ffa10bc6d14adccec6cef5b3c587a70a283 (patch)
tree30825b8ea4452004001406d8c0f438f2a60ea73c /include
parent603d04992cbf6c02cfc16f06ffab7d014d817634 (diff)
keypad driver progress
Diffstat (limited to 'include')
-rw-r--r--include/keypad.h28
1 files changed, 6 insertions, 22 deletions
diff --git a/include/keypad.h b/include/keypad.h
index 2e5fa9c..3dbebdf 100644
--- a/include/keypad.h
+++ b/include/keypad.h
@@ -23,34 +23,18 @@
#include <stdint.h>
-#define K0 (uint16_t)(1 << 0)
-#define K1 (uint16_t)(1 << 1)
-#define K2 (uint16_t)(1 << 2)
-#define K3 (uint16_t)(1 << 3)
-#define K4 (uint16_t)(1 << 4)
-#define K5 (uint16_t)(1 << 5)
-#define K6 (uint16_t)(1 << 6)
-#define K7 (uint16_t)(1 << 7)
-#define K8 (uint16_t)(1 << 8)
-#define K9 (uint16_t)(1 << 9)
-#define KS (uint16_t)(1 << 10)
-#define KP (uint16_t)(1 << 11)
-
/**
- * Initializes GPIO for the keypad. Must be called before any keypad reading.
+ * Initializes GPIO for the keypad.
+ * Starts a task to poll the buttons. Must be called before any keypad reading.
*/
void keypad_init(void);
/**
- * Reads the state of the keypad and returns it.
- * @return the keypad's state
+ * Reads the last pressed key on the keypad.
+ * This driver keeps an 8 key buffer for key presses.
+ * @return the pressed key (as the character it represents), zero if no presses
*/
-uint16_t keypad_get(void);
+int keypad_get(void);
-/**
- * Tests if the given key is currently pressed, returning non-zero if it is.
- * @return non-zero if pressed
- */
-uint8_t keypad_isdown(uint16_t);
#endif // KEYPAD_H_