ButterflyMP3

ledgraphics.c File Reference

Basic LED display that lights up an LED for track number played. More...

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "types.h"
#include "lcdgraphics.h"
#include "main.h"
#include "timer0.h"
Include dependency graph for ledgraphics.c:

Go to the source code of this file.

Functions

void LEDMatrix_timer (void)
 LEDMatrix_timer.
void LCD_Initialize (void)
 Initialize hardware.
void LCD_Blank (void)
 clear LCD
void LCD_Sleep (void)
 Put LCD into powersave mode.
void LCD_Wake (void)
 Wake LCD from powersave mode.
void LCD_PrintfU4 (uint8 Data)
 Print a single 4bit digit.
void LCD_PrintfU8 (uint8 Data)
 Print two 4bit Digits.
uint8 LCD_Time (uint16 data)
 Print Play time on display.
uint8 LCD_FileName (uint8 resetScroll)
 Print long filename on display.
void LCD_Play (void)
 Display the "playing" symbol.
void LCD_Stop (void)
 Display the "stopped" symbol.
void LCD_Pause (void)
 Display the "Paused" symbol.
void LCD_Vol (uint8 volume, uint8 boostOn)
 Show the volume.
uint8 LCD_Tester (void)
 Print the startup message to the LCD screen.
void LCD_Scanning (void)
 Print Sanning message while searching MMC.
void LCD_Battery (uint8 percentage)
 Print Battery Status on LCD.

Variables

uint8 gCurrentSongNum
 current song being played 0-99
uint8 gMode
 mode of player, idle, playing, off, etc

Detailed Description

Basic LED display that lights up an LED for track number played.

Author:
Nick Lott
Date:
January 2009

These routines are inteded to be used to replache the LCD display with a matrix of 7 x 3 LEDs on PORTC0..6 and PORTG0..2

This file represents a convergence of a number of code snippets found on the web, some of the Yampp system by Jesper Hansen and the work done by Sylvain.Bissonnette@microsyl.com. The goal of this code is to run the graphical LCD for the Butterfly MP3 project. http://butterflymp3.sourceforge.net/

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.

Definition in file ledgraphics.c.


Function Documentation

void LCD_Battery ( uint8  percentage)

Print Battery Status on LCD.

Definition at line 242 of file ledgraphics.c.

void LCD_Blank ( void  )

clear LCD

Definition at line 99 of file ledgraphics.c.

uint8 LCD_FileName ( uint8  resetScroll)

Print long filename on display.

Parameters:
name[]null terminated string containing filename

Definition at line 180 of file ledgraphics.c.

void LCD_Initialize ( void  )

Initialize hardware.

Set the scanning port as an ouput, disable all columns and setup the timer to scan the columns over time.

Definition at line 84 of file ledgraphics.c.

References LEDMatrix_timer(), and Timer0_RegisterCallbackFunction().

Here is the call graph for this function:

void LCD_Pause ( void  )

Display the "Paused" symbol.

Definition at line 206 of file ledgraphics.c.

void LCD_Play ( void  )

Display the "playing" symbol.

Definition at line 188 of file ledgraphics.c.

void LCD_PrintfU4 ( uint8  Data)

Print a single 4bit digit.

Parameters:
Data8bit int to print, upper nibble is ignored

Definition at line 131 of file ledgraphics.c.

void LCD_PrintfU8 ( uint8  Data)

Print two 4bit Digits.

Parameters:
Data8bit int to print

Definition at line 153 of file ledgraphics.c.

void LCD_Scanning ( void  )

Print Sanning message while searching MMC.

Definition at line 234 of file ledgraphics.c.

void LCD_Sleep ( void  )

Put LCD into powersave mode.

Definition at line 108 of file ledgraphics.c.

void LCD_Stop ( void  )

Display the "stopped" symbol.

Definition at line 197 of file ledgraphics.c.

uint8 LCD_Tester ( void  )

Print the startup message to the LCD screen.

Returns:
uint8 status code (always zero)

Definition at line 224 of file ledgraphics.c.

uint8 LCD_Time ( uint16  data)

Print Play time on display.

Parameters:
data[]16bit integer array containting play time information.

Definition at line 170 of file ledgraphics.c.

void LCD_Vol ( uint8  volume,
uint8  boostOn 
)

Show the volume.

Parameters:
uint8containing the volumt lower nibble is used.

Definition at line 215 of file ledgraphics.c.

void LCD_Wake ( void  )

Wake LCD from powersave mode.

Definition at line 117 of file ledgraphics.c.

void LEDMatrix_timer ( void  )

LEDMatrix_timer.

Periodicaly updates the LED matrix depending on current song and mode Only one cell in Matrix is on at a time. Implemented as a Timer to allow for expansion later as a scanned matrix or to add lighting effects and PWM modes. (blinking, fading etc)

Definition at line 57 of file ledgraphics.c.

References gCurrentSongNum, gMode, and MODE_PLAY.

Referenced by LCD_Initialize().


Variable Documentation

current song being played 0-99

Referenced by LEDMatrix_timer(), and play_track_number().

mode of player, idle, playing, off, etc

Definition at line 75 of file main.c.

 All Files Functions Variables Typedefs Enumerations Enumerator Defines