Exemplo n.º 1
0
        // *****************************************************************************
        //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // Private initilizers
        //  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // *****************************************************************************

        /// <summary> Construct the memory banks used for I/O.</summary>
        private void  initMem()
        {
            // scratchpad
            scratch                     = new MemoryBankScratchCRCPW(this);
            scratch.pageLength          = 64;
            scratch.size                = 64;
            scratch.numberPages         = 1;
            scratch.maxPacketDataLength = 61;
            scratch.enablePower         = true;

            // User Data Memory
            userDataMemory                      = new MemoryBankNVCRCPW(this, scratch);
            userDataMemory.numberPages          = 511;
            userDataMemory.size                 = 32704;
            userDataMemory.pageLength           = 64;
            userDataMemory.maxPacketDataLength  = 61;
            userDataMemory.bankDescription      = "Data Memory";
            userDataMemory.startPhysicalAddress = 0x0000;
            userDataMemory.generalPurposeMemory = true;
            userDataMemory.readOnly             = false;
            userDataMemory.readWrite            = true;
            userDataMemory.enablePower          = true;

            // Register
            register                      = new MemoryBankNVCRCPW(this, scratch);
            register.numberPages          = 1;
            register.size                 = 64;
            register.pageLength           = 64;
            register.maxPacketDataLength  = 61;
            register.bankDescription      = "Register control";
            register.startPhysicalAddress = 0x7FC0;
            register.generalPurposeMemory = false;
            register.enablePower          = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Memory bank contstuctor.  Requires reference to the OneWireContainer
        /// this memory bank resides on.
        /// </summary>
        public MemoryBankNVCRCPW(PasswordContainer ibutton, MemoryBankScratchCRCPW scratch) : base((OneWireContainer)ibutton, scratch)
        {
            ibPass = ibutton;

            // initialize attributes of this memory bank
            pageAutoCRC          = true;
            readContinuePossible = true;
            numVerifyBytes       = 0;

            scratchpadPW = scratch;
        }