Пример #1
0
/*****************************************************************************
 * Function: ADCStoreTemperature()
 *
 * Preconditions: SPIMPolInit and EEPROMInit must be called before.
 *
 * Overview: The function stores the current temperature into EEPROM.
 *
 * Input: None.
 *
 * Output: None.
 *
 *****************************************************************************/
void ADCStoreTemperature(){
unsigned Temp;
    // Get temperature
    Temp = _uADCTemperature>>4;
    // Write MS byte into EEPROM address = 0
    EEPROMWriteByte(Hi(Temp),0);
    // Write LS byte into EEPROM address = 1
    EEPROMWriteByte(Lo(Temp),1);
}
Пример #2
0
void EEPROMWrite(WORD addr, BYTE length, BYTE xdata *buf)
{
	BYTE	i;
	LED=!LED;
	for(i=0;i<length;++i)
		EEPROMWriteByte(addr++,buf[i]);
}
Пример #3
0
void EEPROMWriteWord(unsigned char Address, unsigned short Word)
{
	if (Address < EEPROM_SIZE_BYTES - 1)
	{
		// Store data in little-endian form
		EEPROMWriteByte(Address, Word);
		EEPROMWriteByte(Address + 1, Word >> 8);
	}