From 6d4ad089c5b758ad8af4f68bf385a26ec4e9653a Mon Sep 17 00:00:00 2001 From: Thomas Albers Raviola Date: Thu, 21 Nov 2024 15:55:03 +0100 Subject: Initial commit --- include/input.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/input.h (limited to 'include/input.h') diff --git a/include/input.h b/include/input.h new file mode 100644 index 0000000..a2f03e2 --- /dev/null +++ b/include/input.h @@ -0,0 +1,22 @@ +#ifndef INPUT_H +#define INPUT_H + +#include + +static inline uint8_t +poll_keys(void) +{ + return (port_b_data & 0x7C) >> 2; +} + +enum keys { + KEY1 = 0x01, + KEY2 = 0x02, + KEY3 = 0x04, + KEY4 = 0x08, + KEY5 = 0x10 +}; + +extern struct fifo input_fifo; + +#endif // INPUT_H -- cgit v1.2.3