46 #include <avr/pgmspace.h>
60 #define ENTER_PORT PINE
61 #define ENTER_PUR PORTE
62 #define ENTER_DDR DDRE
63 #define ENTER_PIN PINE2
68 #define KEY_STATE_UP 0x01
69 #define KEY_STATE_DOWN 0x02
70 #define KEY_STATE_LEFT 0x04
71 #define KEY_STATE_RIGHT 0x08
72 #define KEY_STATE_ENTER 0x10
73 #define KEY_STATE_NO_KEY 0x00
74 #define KEY_STATE_DONE 0x20
86 extern key_state_t button;
key_state_t key_task(void)
This will check the joystick state to return the current button status.
key_state_t key_state_get(void)
This function will start the ADC conversion and read the current converstion value to determine the b...
uint8_t is_button(void)
This will poll run key_task() to determine if a button has been pressed.
uint8_t get_button(void)
This function will wait for a user to press a button.
void key_init(void)
This will intialize the joystick and the ADC for button readings.
void key_deinit(void)
This will disable the ADC used for button readings.