Science Memeseum / Mbed 2 deprecated BeaconDemo_RobotCode

Dependencies:   mbed

Fork of PsiSwarm-BeaconDemo_Bluetooth by James Wilson

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers eprom.h Source File

eprom.h

00001 /** University of York Robotics Laboratory PsiSwarm Library: Eprom Functions Header File
00002  * 
00003  * File: eprom.h
00004  *
00005  * (C) Dept. Electronics & Computer Science, University of York
00006  * James Hilder, Alan Millard, Homero Elizondo, Jon Timmis
00007  * 
00008  * PsiSwarm Library Version: 0.3, October 2015
00009  *
00010  * Functions for accessing the 64Kb EPROM chip and reading the reserved firmware block
00011  *
00012  * Example:
00013  * @code
00014  * #include "psiswarm.h"
00015  * 
00016  * int main() {
00017  *     init();
00018  *     write_eeprom_byte(0,0xDD);    //Writes byte 0xDD in EPROM address 0
00019  *     char c = read_eeprom_byte(0); //c will hold 0xDD
00020  *     //Valid address range is from 0 to 65279
00021  * }
00022  * @endcode
00023  */
00024        
00025 #ifndef EPROM_H
00026 #define EPROM_H
00027 
00028 /** Write a single byte to the EPROM
00029  *
00030  * @param address The address to store the data, range 0-65279
00031  * @param data The character to store
00032  */
00033 void write_eeprom_byte ( int address, char data );
00034 
00035 /** Read a single byte from the EPROM
00036  *
00037  * @param address The address to read from, range 0-65279
00038  * @return The character stored at address
00039  */
00040 char read_eeprom_byte ( int address );
00041 
00042 /** Read the next byte from the EPROM, to be called after read_eeprom_byte
00043  *
00044  * @return The character stored at address after the previous one read from
00045  */
00046 char read_next_eeprom_byte ( void );
00047 
00048 /** Read the data stored in the reserved firmware area of the EPROM
00049  *
00050  * @return 1 if a valid firmware is read, 0 otherwise
00051  */
00052 char read_firmware ( void );
00053 
00054 #endif