ButterflyMP3

eeprom.c File Reference

AVR Butterfly EEPROM routines. More...

#include <avr/io.h>
#include <avr/pgmspace.h>
#include "types.h"
#include "eeprom.h"
#include "eeprom169.h"
#include "main.h"
#include "uart.h"
Include dependency graph for eeprom.c:

Go to the source code of this file.

Functions

void StoreEEPROM (uint8 *pBuffer, uint8 num_bytes, unsigned int EE_START_ADR)
void LoadEEPROM (uint8 *pBuffer, uint8 num_bytes, unsigned int EE_START_ADR)
uint8 ReadEEPROM (unsigned int EE_START_ADR)
uint8 findCurrentEepromAddr (uint16 index_buffer)
 findCurrentEepromAddr
void save_player_options (void)
 save_player_options
void save_player_state (void)
 save_player_state
void load_player_options (void)
 load_player_options
void load_player_state (uint8 *mode, uint32 *file, uint32 *sector, uint32 *played, uint16 *time, uint32 *dir)
 load_player_state

Variables

uint8 gmusic_vol
 music volume.
uint8 gbass_boost
 bass boost off.
uint8 gMode
 mode of player, idle, playing, off, etc
uint32 gFAT_entry
 global current entry number in FAT table. (aka file number)
uint32 gCluster
 current cluster in song
uint32 gFileSectorsPlayed
 number of full sectors played. (aka position)
uint32 FAT16_dir_first_sector
volatile uint16 gPlayTimeSeconds
 # of seconds current file has been playing.

Detailed Description

AVR Butterfly EEPROM routines.

Author:
ATMEL Norway
Id:
eeprom.c,v 1.9 2007/12/16 18:42:22 brokentoaster Exp

Target ATmega169 Compiler....: AVR-GCC 3.3.1; avr-libc 1.0 Revisions...: 1.0

YYYYMMDD - VER. - COMMENT - SIGN. 20030116 - 1.0 - Created - LHM 20031009 port to avr-gcc/avr-libc - M.Thomas

Definition in file eeprom.c.


Function Documentation

uint8 findCurrentEepromAddr ( uint16  index_buffer)

findCurrentEepromAddr

index_buffer uint16 pointing to buffer index of interest

Returns:
index to last used entry in buffer

0Finds the last used entry in a ring buffer

Definition at line 113 of file eeprom.c.

References EEPROM_BFFRSZE, and ReadEEPROM().

Referenced by load_player_options(), load_player_state(), save_player_options(), and save_player_state().

Here is the call graph for this function:

void load_player_options ( void  )

load_player_options

load current state of player from eeprom

Definition at line 255 of file eeprom.c.

References EEPROM_OPTIONS_INDEX, EEPROM_VOL, findCurrentEepromAddr(), gmusic_vol, and LoadEEPROM().

Referenced by init_HW().

Here is the call graph for this function:

void load_player_state ( uint8 mode,
uint32 file,
uint32 sector,
uint32 played,
uint16 time,
uint32 dir 
)

load_player_state

load current state of player from eeprom

Definition at line 282 of file eeprom.c.

References EEPROM_DIR, EEPROM_FILE, EEPROM_MODE, EEPROM_PLAYED, EEPROM_SECTOR, EEPROM_STATE_INDEX, EEPROM_TIME, findCurrentEepromAddr(), and LoadEEPROM().

Referenced by restore_player().

Here is the call graph for this function:

void LoadEEPROM ( uint8 pBuffer,
uint8  num_bytes,
unsigned int  EE_START_ADR 
)

Definition at line 77 of file eeprom.c.

Referenced by load_player_options(), load_player_state(), and save_player_options().

uint8 ReadEEPROM ( unsigned int  EE_START_ADR)

Definition at line 98 of file eeprom.c.

Referenced by findCurrentEepromAddr(), save_player_options(), and save_player_state().

void save_player_options ( void  )

save_player_options

Save current state of player to eeprom

Definition at line 148 of file eeprom.c.

References EEPROM_BFFRSZE, EEPROM_OPTIONS_INDEX, EEPROM_VOL, findCurrentEepromAddr(), gmusic_vol, LoadEEPROM(), ReadEEPROM(), and StoreEEPROM().

Referenced by mainTimer(), and Power_off().

Here is the call graph for this function:

void save_player_state ( void  )

save_player_state

Save current state of player to eeprom

Definition at line 201 of file eeprom.c.

References EEPROM_BFFRSZE, EEPROM_DIR, EEPROM_FILE, EEPROM_MODE, EEPROM_PLAYED, EEPROM_SECTOR, EEPROM_STATE_INDEX, EEPROM_TIME, FAT16_dir_first_sector, findCurrentEepromAddr(), gCluster, gFAT_entry, gFileSectorsPlayed, gMode, gPlayTimeSeconds, ReadEEPROM(), and StoreEEPROM().

Referenced by mainTimer(), and Power_off().

Here is the call graph for this function:

void StoreEEPROM ( uint8 pBuffer,
uint8  num_bytes,
unsigned int  EE_START_ADR 
)

Definition at line 55 of file eeprom.c.

Referenced by save_player_options(), and save_player_state().


Variable Documentation

bass boost off.

Definition at line 71 of file main.c.

Referenced by flush_decoder(), and update_LCD().

current cluster in song

current sector (cluster) in song main.h

Definition at line 79 of file main.c.

global current entry number in FAT table. (aka file number)

Definition at line 78 of file main.c.

Referenced by cue_file(), handle_interface(), handle_mmc(), init_mmc_fat(), open_Dir(), play_track_number(), restore_player(), save_player_state(), streaming(), and update_LCD().

number of full sectors played. (aka position)

Definition at line 81 of file main.c.

Referenced by cue_file(), restore_player(), save_player_state(), and streaming().

mode of player, idle, playing, off, etc

Definition at line 75 of file main.c.

# of seconds current file has been playing.

Definition at line 92 of file main.c.

 All Files Functions Variables Typedefs Enumerations Enumerator Defines