ButterflyMP3

button.c File Reference

AVR Butterfly button handling routines. More...

#include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>
#include "main.h"
#include "types.h"
#include "button.h"
#include "timer0.h"
#include "vs1001.h"
#include "mmc.h"
#include "uart.h"
Include dependency graph for button.c:

Go to the source code of this file.

Functions

void ButtonTimer (void)
void Button_Init (void)
 Button_Init.
void PinChangeInterrupt (void)
 PinChangeInterrupt.
char getkey (void)
 getkey

Variables

volatile uint8_t gPowerSaveTimer
volatile uint16 gPlayTimeSeconds
 # of seconds current file has been playing.
volatile uint8 gMode
 mode of player, idle, playing, off, etc
volatile uint16 gButtonTimeout = 0
volatile uint8 gButtonLongTimeout = 0
volatile uint8 KEY = 0
volatile uint8 KEY_VALID = 0
volatile uint8 KEY_SHIFT = 0
int long_timeout_count = 0

Detailed Description

AVR Butterfly button handling routines.

Author:
ATMEL Norway Target(s)...: ATmega169

Compiler....: AVR-GCC 3.3.1; avr-libc 1.0

Revisions...: 1.2

Id:
button.c,v 1.17 2009/01/11 23:39:59 brokentoaster Exp

YYYYMMDD - VER. - COMMENT - SIGN.

20030116 - 1.0 - Created - KS 20031009 port to avr-gcc/avr-libc - M.Thomas 20041105 - 1.2 Altered for Butterfly MP3 use - N.Lott

Definition in file button.c.


Function Documentation

void Button_Init ( void  )

Button_Init.

Initializes the five button pin

Definition at line 111 of file button.c.

References PINB_MASK, and PINE_MASK.

Referenced by init_HW().

void ButtonTimer ( 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  )

PinChangeInterrupt.

Check status on the joystick

Definition at line 139 of file button.c.

References BUTTON_A, BUTTON_B, BUTTON_C, BUTTON_D, BUTTON_O, FALSE, gButtonTimeout, KEY, KEY_ENTER, KEY_MINUS, KEY_NEXT, KEY_NULL, KEY_PLUS, KEY_PREV, KEY_VALID, MATRIXROWS, PINB_MASK, PINE_MASK, and TRUE.


Variable Documentation

volatile uint8 gButtonLongTimeout = 0

Definition at line 43 of file button.c.

volatile uint16 gButtonTimeout = 0

Definition at line 42 of file button.c.

Referenced by getkey(), mainTimer(), and PinChangeInterrupt().

volatile uint8 gMode

mode of player, idle, playing, off, etc

Definition at line 75 of file main.c.

Referenced by handle_interface(), handle_mmc(), LEDMatrix_timer(), main(), mainTimer(), play_track_number(), restore_player(), save_player_state(), streaming(), and update_LCD().

# of seconds current file has been playing.

Definition at line 92 of file main.c.

Referenced by cue_file(), mainTimer(), restore_player(), save_player_state(), and update_LCD().

volatile uint8_t gPowerSaveTimer

Definition at line 55 of file power.h.

Referenced by handle_interface(), handle_mmc(), main(), mainTimer(), and Power_off().

volatile uint8 KEY = 0

Definition at line 47 of file button.c.

Referenced by getkey(), and PinChangeInterrupt().

volatile uint8 KEY_SHIFT = 0

Definition at line 49 of file button.c.

volatile uint8 KEY_VALID = 0

Definition at line 48 of file button.c.

Referenced by getkey(), and PinChangeInterrupt().

Definition at line 56 of file button.c.

 All Files Functions Variables Typedefs Enumerations Enumerator Defines