/// <summary>
 /// Creates an instance of an 8-bit register.
 /// </summary>
 /// <param name="n">Identifier for debugging</param>
 /// <param name="del">Delegate for talking to hardware</param>
 /// <param name="user">Pointer to specific data such as config</param>
 /// <param name="default_val">Default value for the register</param>
 public Register8(string n, Register8WriteDel del, object user, byte default_val)
 {
     name          = n;
     HardwareWrite = del;
     user_data     = user;
     hardware_data = software_data = default_val;
 }
		/// <summary>
		/// Creates an instance of an 8-bit register.
		/// </summary>
		/// <param name="n">Identifier for debugging</param>
		/// <param name="del">Delegate for talking to hardware</param>
		/// <param name="user">Pointer to specific data such as config</param>
		/// <param name="default_val">Default value for the register</param>
		public Register8(string n, Register8WriteDel del, object user, byte default_val)
		{
			name = n;
			HardwareWrite = del;
			user_data = user;
			hardware_data = software_data = default_val;
		}
Exemple #3
0
 public AD9854_v2()
 {
     byte[] default_vals = {   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x64, 0x01,
                               0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 };
     write_reg = new Register8WriteDel(WriteRegister);
     registers = new Register8[40];
     for(int i=0; i<40; i++)
         registers[i] = new Register8(i.ToString(), write_reg, (byte)i, default_vals[i]);
 }
Exemple #4
0
 public AD9854_v2()
 {
     byte[] default_vals = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                             0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x64, 0x01,
                             0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 };
     write_reg = new Register8WriteDel(WriteRegister);
     registers = new Register8[40];
     for (int i = 0; i < 40; i++)
     {
         registers[i] = new Register8(i.ToString(), write_reg, (byte)i, default_vals[i]);
     }
 }
Exemple #5
0
 public AD9854_v2(ushort addr, ControlMode mode)
 {
     byte[] default_vals = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                             0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x64, 0x01,
                             0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 };
     write_reg = new Register8WriteDel(WriteRegister);
     registers = new Register8[40];
     for (int i = 0; i < 40; i++)
     {
         registers[i] = new Register8(i.ToString(), write_reg, (byte)i, default_vals[i]);
     }
     lpt_addr             = addr;
     current_control_mode = mode;
 }
        public HW(int addr)
        {
            Parallel.InitPortTalk();
            lpt_addr  = (ushort)addr;
            write_reg = new Register8WriteDel(UpdateRegister8);

            pio_ic1   = new Register8("pio_ic1", write_reg, new Config(PIO, PIO_IC1));
            MuteRelay = false;
            pio_ic1.SetBit(5);
            pio_ic3   = new Register8("pio_ic3", write_reg, new Config(PIO, PIO_IC3));
            GainRelay = true;
            rfe_ic7   = new Register8("rfe_ic7", write_reg, new Config(RFE, RFE_IC7));
            PABias    = false;
            rfe_ic9   = new Register8("rfe_ic9", write_reg, new Config(RFE, RFE_IC9));
            rfe_ic10  = new Register8("rfe_ic10", write_reg, new Config(RFE, RFE_IC10));
            rfe_ic11  = new Register8("rfe_ic11", write_reg, new Config(RFE, RFE_IC11));
        }
        private Register8WriteDel HardwareWrite;        // function pointer for hardware writing

        #endregion

        #region Constructor

        /// <summary>
        /// Creates an instance of an 8-bit register.
        /// </summary>
        /// <param name="n">Identifier for debugging</param>
        /// <param name="del">Delegate for talking to hardware</param>
        /// <param name="user">Pointer to specific data such as config</param>
        public Register8(string n, Register8WriteDel del, object user)
        {
            name          = n;
            HardwareWrite = del;
            user_data     = user;
        }
Exemple #8
0
        private object user_data; // used to pass specific data (config, etc)

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates an instance of an 8-bit register.
        /// </summary>
        /// <param name="n">Identifier for debugging</param>
        /// <param name="del">Delegate for talking to hardware</param>
        /// <param name="user">Pointer to specific data such as config</param>
        public Register8(string n, Register8WriteDel del, object user)
        {
            name = n;
            HardwareWrite = del;
            user_data = user;
        }
Exemple #9
0
		public HW(int addr)
		{
			Parallel.InitPortTalk();
			lpt_addr = (ushort)addr;
			write_reg = new Register8WriteDel(UpdateRegister8);

			pio_ic1 = new Register8("pio_ic1", write_reg, new Config(PIO, PIO_IC1));
			MuteRelay = false;
			pio_ic1.SetBit(5);
			pio_ic3 = new Register8("pio_ic3", write_reg, new Config(PIO, PIO_IC3));
			GainRelay = true;
			rfe_ic7 = new Register8("rfe_ic7", write_reg, new Config(RFE, RFE_IC7));
			PABias = false;
			rfe_ic9 = new Register8("rfe_ic9", write_reg, new Config(RFE, RFE_IC9));
			rfe_ic10 = new Register8("rfe_ic10", write_reg, new Config(RFE, RFE_IC10));
			rfe_ic11 = new Register8("rfe_ic11", write_reg, new Config(RFE, RFE_IC11));
		}
Exemple #10
0
 public AD9854_v2(ushort addr, ControlMode mode)
 {
     byte[] default_vals = {   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x64, 0x01,
                               0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 };
     write_reg = new Register8WriteDel(WriteRegister);
     registers = new Register8[40];
     for(int i=0; i<40; i++)
         registers[i] = new Register8(i.ToString(), write_reg, (byte)i, default_vals[i]);
     lpt_addr = addr;
     current_control_mode = mode;
 }