cewkomator/firmware/src/keyboard.h

27 lines
483 B
C

#pragma once
/*
Keys, in order:
123A 456B 789C *0#D
*/
typedef uint8_t Key;
#define KEY_NONE 255
extern const char *allKeys;
bool setupKeyboard();
/**
* Returns pressed key once upon its release
* or KEY_NONE if no key is pressed
*
* NOTE: Only one key can be pressed at a time;
* if multiple keys are pressed, the behavior is undefined
*/
Key handleKeyboard();
/**
* Returns pressed digit or KEY_NONE if the key is not a digit
*/
uint8_t getPressedDigit(Key key);