eeprom.h File Reference

#include "t89c51cc02.h"
#include "datatypes.h"

Go to the source code of this file.

Defines

#define EEPROM_CANID_RECV   0
#define EEPROM   CANID_SEND 2
#define EEPROM_MONITOR   4
#define EEPROM_DIRECTION   8
#define EEPROM_BOUNDARY   12
#define EEPROM_CHECKSUM   48
#define EEPROM_wait()   while((EECON&MSK_EECON_EEBUSY)!=0)

Functions

BYTE EEPROM_read (BYTE)
 read a byte from the EEPROM
void EEPROM_write (BYTE, BYTE)
 write a byte into the EEPROM latches
void EEPROM_flush (void)
 writes latched EEPROM contents to the EEPROM


Detailed Description

Definition in file eeprom.h.


Define Documentation

#define EEPROM   CANID_SEND 2
 

offset address for CAN sending ID inside of EEPROM

Definition at line 17 of file eeprom.h.

#define EEPROM_BOUNDARY   12
 

offset address into EEPROM for storing boundary values for all sensors

Definition at line 23 of file eeprom.h.

Referenced by Command_ReadDefaultConfiguration().

#define EEPROM_CANID_RECV   0
 

offset address for CAN reception ID inside of EEPROM

Definition at line 15 of file eeprom.h.

#define EEPROM_CHECKSUM   48
 

offset address into EEPROM to store the checksum

Definition at line 25 of file eeprom.h.

Referenced by Command_ReadDefaultConfiguration().

#define EEPROM_DIRECTION   8
 

offset address into EEPROM to store monitoring direction bits

Definition at line 21 of file eeprom.h.

Referenced by Command_ReadDefaultConfiguration().

#define EEPROM_MONITOR   4
 

offset address into EEPROM to store monitor flags

Definition at line 19 of file eeprom.h.

Referenced by Command_ReadDefaultConfiguration().

 
#define EEPROM_wait  )     while((EECON&MSK_EECON_EEBUSY)!=0)
 

waits while the EEPROM is busy

Definition at line 27 of file eeprom.h.

Referenced by EEPROM_flush(), EEPROM_read(), and EEPROM_write().


Function Documentation

void EEPROM_flush void   ) 
 

writes latched EEPROM contents to the EEPROM

Prepare the new contents with EEPROM_write before writing them to the EEPROM.
Interrupts are disabled (and restored afterwards) during the actual EEPROM write.

Definition at line 77 of file eeprom.c.

References EEPROM_wait.

BYTE EEPROM_read BYTE  address  ) 
 

read a byte from the EEPROM

A byte is read from the EEPROM at the given EEPROM address.
This routine is limited for reading the first 256 Bytes of the EEPROM memory.

Parameters:
address address offset into EEPROM to read from
Returns:
value of EEPROM at the given address

Definition at line 23 of file eeprom.c.

References EEPROM_wait, and eepromptr.

Referenced by Command_ReadDefaultConfiguration().

void EEPROM_write BYTE  d,
BYTE  address
 

write a byte into the EEPROM latches

This function only latches data but the data is not written to the EEPROM.
Execute EEPROM_flush to actually write the new contents into the EEPROM.

Parameters:
d data byte to write
address address of EEPROM cell

Definition at line 54 of file eeprom.c.

References EEPROM_wait, and eepromptr.


Generated on Wed Oct 24 12:57:24 2007 for SensorControl by  doxygen 1.4.6