//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. Requires reference to memory banks used /// in OTP operations. /// </summary> public MemoryBankEEPROMstatus(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // initialize attributes of this memory bank - DEFAULT: Main memory DS1985 w/o lock stuff generalPurposeMemory = false; bankDescription = "Main Memory"; numberPages = 1; readWrite = false; writeOnce = false; readOnly = false; nonVolatile = true; pageAutoCRC = true; programPulse = false; powerDelivery = false; writeVerification = false; startPhysicalAddress = 0; doSetSpeed = true; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[20]; for (int i = 0; i < 20; i++) { ffBlock[i] = (byte)SupportClass.Identity(0xFF); } }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankScratchTemp(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // initialize attributes of this memory bank bankDescription = "Temperature"; generalPurposeMemory = false; startPhysicalAddress = 0; size = 2; readWrite = false; readOnly = true; nonVolatile = false; powerDelivery = true; writeVerification = false; // not needed here but required for MemoryBank implementation // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[15]; for (int i = 0; i < 15; i++) { ffBlock[i] = (byte)SupportClass.Identity(0xFF); } // indicate speed has not been set doSetSpeed = true; }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankNVCRC(OneWireContainer ibutton, ScratchPad scratch) : base(ibutton, scratch) { // initialize attributes of this memory bank pageAutoCRC = true; readContinuePossible = true; numVerifyBytes = 0; }
//-------- //-------- Constructor //-------- /// <summary> /// Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankSBM(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // initialize attributes of this memory bank - DEFAULT: DS2438 Status byte bankDescription = "Status/Configuration"; generalPurposeMemory = false; startPhysicalAddress = 0; size = 1; readWrite = true; readOnly = false; nonVolatile = true; powerDelivery = true; writeVerification = true; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[20]; for (int i = 0; i < 20; i++) { ffBlock[i] = unchecked ((byte)0xFF); } // indicate speed has not been set doSetSpeed = true; }
//-------- //-------- Constructor //-------- /// <summary> /// Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankAD(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[50]; for (int i = 0; i < 50; i++) { ffBlock[i] = 0xFF; } // defaults for Page0 of DS2450 bankDescription = "A/D Conversion read-out"; generalPurposeMemory = false; startPhysicalAddress = 0; readWrite = false; writeOnce = false; readOnly = true; nonVolatile = false; writeVerification = true; // indicate speed has not been set doSetSpeed = true; }
//-------- //-------- Constructor //-------- /// <summary> /// Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankScratchEE(OneWireContainer ibutton) : base(ibutton) { // default copy scratchpad delay COPY_DELAY_LEN = (byte)5; // default ES mask for copy scratchpad ES_MASK = 0; }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankScratchEx(OneWireContainer ibutton) : base(ibutton) { // initialize attributes of this memory bank bankDescription = "Scratchpad Ex"; // change copy scratchpad command COPY_SCRATCHPAD_COMMAND = (byte)0x5A; }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankScratchCRC(OneWireContainer ibutton) : base(ibutton) { // initialize attributes of this memory bank - DEFAULT: DS1963L scratchapd bankDescription = "Scratchpad with CRC"; pageAutoCRC = true; // default copy scratchpad command COPY_SCRATCHPAD_COMMAND = (byte)0x55; }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. Requires reference to memory banks used /// in OTP operations. /// </summary> public MemoryBankEPROM(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // get references to MemoryBanks used in OTP operations, assume no locking/redirection mbLock = null; mbRedirect = null; mbLockRedirect = null; lockOffset = 0; redirectOffset = 0; lockRedirectOffset = 0; // initialize attributes of this memory bank - DEFAULT: Main memory DS1985 w/o lock stuff generalPurposeMemory = true; bankDescription = "Main Memory"; numberPages = 64; size = 2048; pageLength = 32; maxPacketDataLength = 29; readWrite = false; writeOnce = true; readOnly = false; nonVolatile = true; pageAutoCRC = true; redirectPage_Renamed_Field = false; lockPage_Renamed_Field = false; lockRedirectPage_Renamed_Field = false; programPulse = true; powerDelivery = false; extraInfo = true; extraInfoLength = 1; extraInfoDescription = "Inverted redirection page"; writeVerification = true; startPhysicalAddress = 0; READ_PAGE_WITH_CRC = MAIN_READ_PAGE_COMMAND; WRITE_MEMORY_COMMAND = MAIN_WRITE_COMMAND; numCRCBytes = 2; crcAfterAddress = true; normalReadCRC = false; doSetSpeed = true; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[50]; for (int i = 0; i < 50; i++) ffBlock[i] = (byte) SupportClass.Identity(0xFF); }
//-------- //-------- Protected Variables for OTPMemoryBank implementation //-------- //-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. Requires reference to memory banks used /// in OTP operations. /// </summary> public MemoryBankAppReg(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // defaults writeVerification = true; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[50]; for (int i = 0; i < 50; i++) { ffBlock[i] = (byte)SupportClass.Identity(0xFF); } }
/// <summary> Indicates whether some other object is "equal to" this one.</summary> /// <param name="obj"> the reference object with which to compare. /// </param> /// <returns> <code>true</code> if this object is the same as the obj /// argument; <code>false</code> otherwise. /// </returns> public override bool Equals(System.Object obj) { if (obj == this) { return(true); } if (obj is OneWireContainer) { OneWireContainer owc = (OneWireContainer)obj; // don't claim that all subclasses of a specific container are // equivalent to the parent container if (owc.GetType() == this.GetType()) { return(owc.AddressAsLong == this.AddressAsLong); } } return(false); }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. Requires reference to memory banks used /// in OTP operations. /// </summary> public MemoryBankEEPROM(OneWireContainer ibutton, ScratchPad scratch) { // keep reference to ibutton where memory bank is ib = ibutton; // keep reference to scratchPad bank sp = scratch; // get references to MemoryBanks used in OTP operations, assume locking mbLock = null; lockPage_Renamed_Field = true; // initialize attributes of this memory bank - DEFAULT: Main memory DS2431 generalPurposeMemory = true; bankDescription = "Main memory"; numberPages = 4; size = 128; pageLength = 32; maxPacketDataLength = 29; readWrite = true; writeOnce = false; readOnly = false; nonVolatile = true; pageAutoCRC = false; lockPage_Renamed_Field = true; programPulse = false; powerDelivery = true; extraInfo = false; extraInfoLength = 0; extraInfoDescription = null; writeVerification = false; startPhysicalAddress = 0; doSetSpeed = true; scratchPadSize = 8; // create the ffblock (used for faster 0xFF fills) for (int i = 0; i < 500; i++) { ffBlock[i] = (byte)SupportClass.Identity(0xFF); } }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankEE(OneWireContainer ibutton) { lock (this) { // keep reference to ibutton where memory bank is ib = ibutton; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[50]; for (int i = 0; i < 50; i++) { ffBlock[i] = (byte)SupportClass.Identity(0xFF); } // defaults writeVerification = true; // indicate speed has not been set doSetSpeed = true; } }
//-------- //-------- Constructor //-------- /// <summary> /// Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankScratch(OneWireContainer ibutton) { // keep reference to ibutton where memory bank is ib = ibutton; // initialize attributes of this memory bank - DEFAULT: DS199X scratchapd bankDescription = "Scratchpad"; generalPurposeMemory = false; startPhysicalAddress = 0; size = 32; readWrite = true; writeOnce = false; readOnly = false; nonVolatile = false; programPulse = false; powerDelivery = false; writeVerification = true; numberPages = 1; pageLength = 32; maxPacketDataLength = 29; pageAutoCRC = false; extraInfo = true; extraInfoLength = 3; extraInfoDescription = "Target address, offset"; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[96]; for (int i = 0; i < 96; i++) { ffBlock[i] = 0xFF; } // default copy scratchpad command COPY_SCRATCHPAD_COMMAND = 0x55; // indicate speed has not been set doSetSpeed = true; }
//-------- //-------- Constructor //-------- /// <summary> Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. DEFAULT: DS1993 main memory /// /// </summary> /// <param name="ibutton">ibutton container that this memory bank resides in /// </param> /// <param name="scratchPad">memory bank referece for scratchpad, used when writing /// </param> public MemoryBankNV(OneWireContainer ibutton, ScratchPad scratch) { // keep reference to ibutton where memory bank is ib = ibutton; // keep reference to scratchPad bank sp = scratch; // initialize attributes of this memory bank - DEFAULT: DS1993 main memory bankDescription = "Main Memory"; generalPurposeMemory = true; startPhysicalAddress = 0; size = 512; readWrite = true; writeOnce = false; readOnly = false; nonVolatile = true; programPulse = false; powerDelivery = false; writeVerification = true; numberPages = 16; pageLength = 32; maxPacketDataLength = 29; pageAutoCRC = false; extraInfo = false; extraInfoLength = 0; extraInfoDescription = null; // create the ffblock (used for faster 0xFF fills) ffBlock = new byte[96]; for (int i = 0; i < 96; i++) { ffBlock[i] = (byte)SupportClass.Identity(0xFF); } }
//-------- //-------- Constructor //-------- /// <summary> /// Memory bank contstuctor. Requires reference to the OneWireContainer /// this memory bank resides on. /// </summary> public MemoryBankScratchSHA(OneWireContainer ibutton) : base(ibutton) { // initialize attributes of this memory bank - DEFAULT: DS1963S scratchapd bankDescription = "Scratchpad with CRC and auto-hide"; }