예제 #1
0
 public void WriteEEPROM(Re4xEEPROM eeprom)
 {
     if (theDevice != null)
     {
         eeprom.Version = 0x00010000;
         WriteEEPROMLong(theDevice, 0xc0, eeprom.Version);
         WriteEEPROMLong(theDevice, 0xc4, eeprom.Slots);
         for (uint i = 0; i < 4; i++)
         {
             uint offset = i * 12;
             WriteEEPROMLong(theDevice, 0xc8 + offset, (uint)eeprom.SlotInfo[i].ModuleId);
             WriteEEPROMLong(theDevice, 0xcc + offset, eeprom.SlotInfo[i].Clock);
             WriteEEPROMLong(theDevice, 0xd0 + offset, (uint)eeprom.SlotInfo[i].Location);
         }
     }
 }
예제 #2
0
 public Re4xEEPROM ReadEEPROM()
 {
     if (theDevice != null)
     {
         Re4xEEPROM eeprom = new Re4xEEPROM();
         eeprom.Version = ReadEEPROMLong(theDevice, 0xc0);
         eeprom.Slots   = ReadEEPROMLong(theDevice, 0xc4);
         for (uint i = 0; i < 4; i++)
         {
             uint offset = i * 12;
             eeprom.SlotInfo[i]          = new Re4xSlotInfo();
             eeprom.SlotInfo[i].ModuleId = (Re4xModules)ReadEEPROMLong(theDevice, 0xc8 + offset);
             eeprom.SlotInfo[i].Clock    = ReadEEPROMLong(theDevice, 0xcc + offset);
             eeprom.SlotInfo[i].Location = (Re4xLocation)ReadEEPROMLong(theDevice, 0xd0 + offset);
         }
         return(eeprom);
     }
     return(null);
 }