diff options
| author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-11-21 15:55:03 +0100 | 
|---|---|---|
| committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-11-21 15:55:03 +0100 | 
| commit | 6d4ad089c5b758ad8af4f68bf385a26ec4e9653a (patch) | |
| tree | 2fd65006b57d646b53e121aef42bba5ee5852840 /include/input.h | |
Initial commit
Diffstat (limited to 'include/input.h')
| -rw-r--r-- | include/input.h | 22 | 
1 files changed, 22 insertions, 0 deletions
| 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 <fifo.h> + +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 | 
