ButterflyMP3
|
00001 00035 00036 #define PINB_MASK ((1<<PINB4)|(1<<PINB6)|(1<<PINB7)) 00037 #define PINE_MASK ((1<<PINE2)|(1<<PINE3)) 00038 00040 #define BUTTON_A 6 ///< UP 00041 #define BUTTON_B 7 ///< DOWN 00042 #define BUTTON_C 2 ///< LEFT 00043 #define BUTTON_D 3 ///< RIGHT 00044 #define BUTTON_O 4 ///< PUSH 00045 00046 // defines for button press detection 00047 #define BUTTON_TIMEOUT_VALUE (TIMER0_TICKSPERSECOND/50) 00048 00049 // defines for Button Matrix Option 00050 #define MATRIXPORT PORTD ///< use PORTD to mux the joystick pins 00051 #define MATRIXDDR DDRD 00052 #define MATRIXCOLS 7 ///< setup 7 columns from 0..6 00053 #define MATRIXROWS 3 ///< setup 3 rows on PORTB4,6,7 00054 #define MATRIXDELAY TIMER0_TICKSPERSECOND/50 ///< number of timer calls before scanning next column 00055 00057 #define KEY_NULL 0 ///< No key has been pressed 00058 #define KEY_ENTER 1 ///< Center click detected 00059 #define KEY_NEXT 4 ///< Right click detected 00060 #define KEY_PREV 5 ///< left click detected 00061 #define KEY_PLUS 2 ///< up click detected 00062 #define KEY_MINUS 3 ///< down click detected 00063 #define KEY_JOYSTICKMAX 5 ///<Maxvalue for KEY from joystick press 00064 00065 void PinChangeInterrupt(void); 00066 void Button_Init(void); 00067 char getkey(void); 00068 char ButtonBouncing(void);