Esempio n. 1
0
	('window',			REG_SA_RBW,			lambda r, old: (old & ~0x3000000) | r << 24 if r in [SA_WIN_NONE, SA_WIN_BH, SA_WIN_HANNING, SA_WIN_FLATTOP] else None,
											lambda rval: (rval & 0x3000000) >> 24),
	('ref_level',		REG_SA_REFLVL,		lambda r, old: (old & ~0x0F) | _usgn(r, 4),
											lambda rval: rval & 0x0F),
	('gain_sos0',		REG_SA_SOS0_GAIN,	lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('a1_sos0',			REG_SA_SOS0_A1,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('a2_sos0',			REG_SA_SOS0_A2,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('b1_sos0',			REG_SA_SOS0_B1,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('gain_sos1',		REG_SA_SOS1_GAIN,	lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('a1_sos1',			REG_SA_SOS1_A1,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('a2_sos1',			REG_SA_SOS1_A2,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('b1_sos1',			REG_SA_SOS1_B1,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('gain_sos2',		REG_SA_SOS2_GAIN,	lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('a1_sos2',			REG_SA_SOS2_A1,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('a2_sos2',			REG_SA_SOS2_A2,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
	('b1_sos2',			REG_SA_SOS2_B1,		lambda r, old: _sgn(r, 18),
											lambda rval: rval),
]
_instrument._attach_register_handlers(_sa_reg_hdl, SpecAn)
Esempio n. 2
0
    (
        "out1_modsource",
        REG_SG_MODSOURCE,
        lambda s, old: old & ~0x00000006 | s << 1
        if s in [SG_MODSOURCE_INT, SG_MODSOURCE_ADC, SG_MODSOURCE_DAC]
        else None,
        lambda rval: rval & 0x00000006 >> 1,
    ),
    (
        "out2_modsource",
        REG_SG_MODSOURCE,
        lambda s, old: old & 0x00000018 | s << 3
        if s in [SG_MODSOURCE_INT, SG_MODSOURCE_ADC, SG_MODSOURCE_DAC]
        else None,
        lambda rval: rval & 0x00000018 >> 3,
    ),
    (
        "out1_amp_pc",
        REG_SG_PRECLIP,
        lambda a, old: old & 0xFFFF0000 | _usgn(1 / a, 16),
        lambda rval: rval & 0x0000FFFF * _SG_AMPSCALE,
    ),
    (
        "out2_amp_pc",
        REG_SG_PRECLIP,
        lambda a, old: old & 0x0000FFFF | _usgn(1 / a, 16) << 16,
        lambda rval: rval >> 16 * _SG_AMPSCALE,
    ),
]
_instrument._attach_register_handlers(_siggen_reg_hdl, SignalGenerator)
Esempio n. 3
0
		self.calibration = dict(self._moku._get_property_section("calibration"))

	attach_moku.__doc__ = _instrument.MokuInstrument.attach_moku.__doc__

_osc_reg_hdl = [
	('source_ch1',		REG_OSC_OUTSEL,		lambda s, old: (old & ~1) | s if s in [OSC_SOURCE_ADC, OSC_SOURCE_DAC] else None,
											lambda rval: rval & 1),
	('source_ch2',		REG_OSC_OUTSEL,		lambda s, old: (old & ~2) | s << 1 if s in [OSC_SOURCE_ADC, OSC_SOURCE_DAC] else None,
											lambda rval: rval & 2 >> 1),
	('trig_mode',		REG_OSC_TRIGMODE,	lambda s, old: (old & ~3) | s if s in [OSC_TRIG_AUTO, OSC_TRIG_NORMAL, OSC_TRIG_SINGLE] else None,
											lambda rval: rval & 3),
	('trig_edge',		REG_OSC_TRIGCTL,	lambda s, old: (old & ~3) | s if s in [OSC_EDGE_RISING, OSC_EDGE_FALLING, OSC_EDGE_BOTH] else None,
											lambda rval: rval & 3),
	('trig_ch',			REG_OSC_TRIGCTL,	lambda s, old: (old & ~0x7F0) | s << 4 if s in
												[OSC_TRIG_CH1, OSC_TRIG_CH2, OSC_TRIG_DA1, OSC_TRIG_DA2] else None,
											lambda rval: rval & 0x7F0 >> 4),
	('hf_reject',		REG_OSC_TRIGCTL,	lambda s, old: (old & ~0x1000) | s << 12 if int(s) in [0, 1] else None,
											lambda rval: rval & 0x1000 >> 12),
	('hysteresis',		REG_OSC_TRIGCTL,	lambda s, old: (old & ~0xFFFF0000) | s << 16 if 0 <= s < 2**16 else None,
											lambda rval: rval & 0xFFFF0000 >> 16),
	('trigger_level',	REG_OSC_TRIGLVL,	lambda s, old: _sgn(s, 32),
											lambda rval: rval),
	('loopback_mode',	REG_OSC_ACTL,		lambda m, old: (old & ~0x01) | m if m in [_OSC_LB_CLIP, _OSC_LB_ROUND] else None,
											lambda rval: rval & 0x01),
	('ain_mode',		REG_OSC_ACTL,		lambda m, old: (old & ~0x300) | m << 16 if m in [_OSC_AIN_DDS, _OSC_AIN_DECI] else None,
											lambda rval: (rval & 0x300) >> 16),
	('decimation_rate',	REG_OSC_DECIMATION,	lambda r, old: _usgn(r, 32), lambda rval: rval),
]
_instrument._attach_register_handlers(_osc_reg_hdl, Oscilloscope)