/***************************************************************************** * 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); }
void EEPROMWrite(WORD addr, BYTE length, BYTE xdata *buf) { BYTE i; LED=!LED; for(i=0;i<length;++i) EEPROMWriteByte(addr++,buf[i]); }
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); }