ButterflyMP3
|
Butterfly MP3 Button Handling. More...
Go to the source code of this file.
Defines | |
#define | PINB_MASK ((1<<PINB4)|(1<<PINB6)|(1<<PINB7)) |
Button masks for pin change interupt handling. | |
#define | PINE_MASK ((1<<PINE2)|(1<<PINE3)) |
#define | BUTTON_A 6 |
Button Hardware definitions. | |
#define | BUTTON_B 7 |
DOWN. | |
#define | BUTTON_C 2 |
LEFT. | |
#define | BUTTON_D 3 |
RIGHT. | |
#define | BUTTON_O 4 |
PUSH. | |
#define | BUTTON_TIMEOUT_VALUE (TIMER0_TICKSPERSECOND/50) |
#define | MATRIXPORT PORTD |
use PORTD to mux the joystick pins | |
#define | MATRIXDDR DDRD |
#define | MATRIXCOLS 7 |
setup 7 columns from 0..6 | |
#define | MATRIXROWS 3 |
setup 3 rows on PORTB4,6,7 | |
#define | MATRIXDELAY TIMER0_TICKSPERSECOND/50 |
number of timer calls before scanning next column | |
#define | KEY_NULL 0 |
Button logical definitions ( virtual keys) | |
#define | KEY_ENTER 1 |
Center click detected. | |
#define | KEY_NEXT 4 |
Right click detected. | |
#define | KEY_PREV 5 |
left click detected | |
#define | KEY_PLUS 2 |
up click detected | |
#define | KEY_MINUS 3 |
down click detected | |
#define | KEY_JOYSTICKMAX 5 |
Maxvalue for KEY from joystick press. | |
Functions | |
void | PinChangeInterrupt (void) |
PinChangeInterrupt. | |
void | Button_Init (void) |
Button_Init. | |
char | getkey (void) |
getkey | |
char | ButtonBouncing (void) |
Butterfly MP3 Button Handling.
Copyright (C) 2005 Nick Lott <nick_Lott@bigfoot.com>
This is a simple MP3 player based around the AVR Butterfly.It currently uses a VS1001 mp3 decoder, MMC card and Nokia LCD. It has been heavily influenced by the Yampp system by Jesper Hansen <jesperh@telia.com>.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Target(s)...: ATmega169
Compiler....: AVR-GCC 3.3.1; avr-libc 1.0
Definition in file button.h.
#define BUTTON_A 6 |
Button Hardware definitions.
UP
Definition at line 40 of file button.h.
Referenced by PinChangeInterrupt().
#define BUTTON_B 7 |
#define BUTTON_C 2 |
#define BUTTON_D 3 |
#define BUTTON_O 4 |
#define BUTTON_TIMEOUT_VALUE (TIMER0_TICKSPERSECOND/50) |
Definition at line 47 of file button.h.
Referenced by mainTimer().
#define KEY_ENTER 1 |
Center click detected.
Definition at line 58 of file button.h.
Referenced by handle_interface(), and PinChangeInterrupt().
#define KEY_JOYSTICKMAX 5 |
Maxvalue for KEY from joystick press.
Definition at line 63 of file button.h.
Referenced by handle_interface().
#define KEY_MINUS 3 |
down click detected
Definition at line 62 of file button.h.
Referenced by handle_interface(), and PinChangeInterrupt().
#define KEY_NEXT 4 |
Right click detected.
Definition at line 59 of file button.h.
Referenced by handle_interface(), and PinChangeInterrupt().
#define KEY_NULL 0 |
Button logical definitions ( virtual keys)
No key has been pressed
Definition at line 57 of file button.h.
Referenced by getkey(), handle_interface(), and PinChangeInterrupt().
#define KEY_PLUS 2 |
up click detected
Definition at line 61 of file button.h.
Referenced by handle_interface(), and PinChangeInterrupt().
#define KEY_PREV 5 |
left click detected
Definition at line 60 of file button.h.
Referenced by handle_interface(), and PinChangeInterrupt().
#define MATRIXDELAY TIMER0_TICKSPERSECOND/50 |
#define MATRIXROWS 3 |
setup 3 rows on PORTB4,6,7
Definition at line 53 of file button.h.
Referenced by PinChangeInterrupt().
#define PINB_MASK ((1<<PINB4)|(1<<PINB6)|(1<<PINB7)) |
Button masks for pin change interupt handling.
Definition at line 36 of file button.h.
Referenced by Button_Init(), and PinChangeInterrupt().
#define PINE_MASK ((1<<PINE2)|(1<<PINE3)) |
Definition at line 37 of file button.h.
Referenced by Button_Init(), and PinChangeInterrupt().
void Button_Init | ( | void | ) |
char ButtonBouncing | ( | void | ) |
char getkey | ( | void | ) |
getkey
Get the valid key
The valid key
Definition at line 228 of file button.c.
References FALSE, gButtonTimeout, KEY, KEY_NULL, and KEY_VALID.
Referenced by handle_interface(), and Power_off().
void PinChangeInterrupt | ( | void | ) |