예제 #1
0
        /// <summary> Construct the memory banks used for I/O.</summary>
        private void  initMem()
        {
            // scratch pad
            sp                     = new MemoryBankScratchEE(this);
            sp.size                = 32;
            sp.pageLength          = 32;
            sp.maxPacketDataLength = 29;
            sp.pageAutoCRC         = true;
            sp.COPY_DELAY_LEN      = 10;
            sp.ES_MASK             = (byte)0;

            // main memory
            main_mem = new MemoryBankEEPROM(this, sp);

            // initialize main memory
            main_mem.size           = 2560;
            main_mem.numberPages    = 80;
            main_mem.scratchPadSize = 32;
            //readOnly = false;
            //nonVolatile = true;
            //pageAutoCRC = false;
            //lockPage = true;
            //programPulse = false;
            //powerDelivery = true;
            //extraInfo = false;
            //extraInfoLength = 0;
            //extraInfoDescription = null;
            //writeVerification = false;
            //startPhysicalAddress = 0;
            //doSetSpeed = true;

            // register memory
            register = new MemoryBankEEPROM(this, sp);

            // initialize attributes of this memory bank
            register.generalPurposeMemory = false;
            register.bankDescription      = "Write-protect/EPROM-Mode control register";
            register.numberPages          = 2;
            register.size                   = 64;
            register.pageLength             = 32;
            register.maxPacketDataLength    = 0;
            register.readWrite              = true;
            register.writeOnce              = false;
            register.readOnly               = false;
            register.nonVolatile            = true;
            register.pageAutoCRC            = false;
            register.lockPage_Renamed_Field = false;
            register.programPulse           = false;
            register.powerDelivery          = true;
            register.extraInfo              = false;
            register.extraInfoLength        = 0;
            register.extraInfoDescription   = null;
            register.writeVerification      = false;
            register.startPhysicalAddress   = 2560;
            register.doSetSpeed             = true;

            // set the lock mb
            main_mem.mbLock = register;
        }
예제 #2
0
        /// <summary>
        /// Construct the memory banks used for I/O.
        /// </summary>
        private void initMem()
        {
            // scratch pad
            MemoryBankScratchEE sp = new MemoryBankScratchEE(this);

            sp.size                = 8;
            sp.pageLength          = 8;
            sp.maxPacketDataLength = 5;
            sp.pageAutoCRC         = true;
            sp.COPY_DELAY_LEN      = 30;
            sp.ES_MASK             = 0;

            // main memory
            main_mem = new MemoryBankEEPROM(this, sp);

            // register memory
            register = new MemoryBankEEPROM(this, sp);

            // initialize attributes of this memory bank
            register.generalPurposeMemory = false;
            register.bankDescription      = "Write-protect/EPROM-Mode control register";
            register.numberPages          = 1;
            register.size                 = 8;
            register.pageLength           = 8;
            register.maxPacketDataLength  = 0;
            register.readWrite            = true;
            register.writeOnce            = false;
            register.readOnly             = false;
            register.nonVolatile          = true;
            register.pageAutoCRC          = false;
            register._lockPage            = false;
            register.programPulse         = false;
            register.powerDelivery        = true;
            register.extraInfo            = false;
            register.extraInfoLength      = 0;
            register.extraInfoDescription = null;
            register.writeVerification    = false;
            register.startPhysicalAddress = 128;
            register.doSetSpeed           = true;

            // set the lock mb
            main_mem.mbLock = register;
        }
예제 #3
0
        //--------
        //-------- 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);
            }
        }