eeprom.h File Reference

handles eeprom storage for persistent data More...

#include <bom.h>

Go to the source code of this file.

Defines

#define EEPROM_ROBOT_ID_ADDR   0x10
#define EEPROM_BOM_TYPE_ADDR   0x14

Functions

int eeprom_put_byte (unsigned int addr, unsigned char byte)
 store a byte to eeproem
int eeprom_get_byte (unsigned int addr, unsigned char *byte)
 reads a byte from eeprom
unsigned char get_robotid (void)
 get stored robot ID
unsigned char get_bom_type (void)
 get stored robot ID


Detailed Description

handles eeprom storage for persistent data

Contains functions and definitions for reading and writing to eeprom

Author:
Colony Project, Brad Neuman

Function Documentation

int eeprom_get_byte ( unsigned int  addr,
unsigned char *  byte 
)

reads a byte from eeprom

Pass it thge address and a pointer to a byte where the byte at the address will be stored

Returns:
0 if successful (byte is set to the eeprom value at addr), nonzero if there was a problem

int eeprom_put_byte ( unsigned int  addr,
unsigned char  byte 
)

store a byte to eeproem

Returns:
0 if success, nonzero on failure

unsigned char get_bom_type ( void   ) 

get stored robot ID

checks that EEPROM has been programed with an BOM type and returns it

Returns:
the robot bom type as defined in bom.h, if it is stored. If it returns 0xFF it is probably invalid

unsigned char get_robotid ( void   ) 

get stored robot ID

checks that EEPROM has been programed with an ID and returns it

Returns:
the robot id, if it is stored. If it returns 0xFF it is probably invalid


Generated on Mon Sep 7 19:07:28 2009 for libdragonfly by  doxygen 1.5.9