# Path: pymoku/instruments.py

# 
# Path: pymoku/_lockinamp.py
# REG_LIA_PM_BW1 = 90
# REG_LIA_PM_AUTOA1 = 91
# REG_LIA_PM_REACQ = 92
# REG_LIA_PM_RESET = 93
# REG_LIA_PM_OUTDEC = 94
# REG_LIA_PM_OUTSHIFT = 94
# REG_LIA_SIG_SELECT = 95
# REG_LIA_ENABLES = 96
# REG_LIA_PIDGAIN1 = 97
# REG_LIA_PIDGAIN2 = 98
# REG_LIA_INT_IGAIN1 = 99
# REG_LIA_INT_IGAIN2 = 100
# REG_LIA_INT_IFBGAIN1 = 101
# REG_LIA_INT_IFBGAIN2 = 102
# REG_LIA_INT_PGAIN1 = 103
# REG_LIA_INT_PGAIN2 = 104
# REG_LIA_GAIN_STAGE = 105
# REG_LIA_DIFF_DGAIN2 = 106
# REG_LIA_DIFF_PGAIN1 = 107
# REG_LIA_DIFF_PGAIN2 = 108
# REG_LIA_DIFF_IGAIN1 = 109
# REG_LIA_DIFF_IGAIN2 = 110
# REG_LIA_DIFF_IFBGAIN1 = 111
# REG_LIA_DIFF_IFBGAIN2 = 112
# REG_LIA_IN_OFFSET1 = 113
# REG_LIA_OUT_OFFSET1 = 114
# REG_LIA_INPUT_GAIN = 117
# REG_LIA_FREQDEMOD_L = 118
# REG_LIA_FREQDEMOD_H = 119
# REG_LIA_PHASEDEMOD_L = 120
# REG_LIA_PHASEDEMOD_H = 121
# REG_LIA_LO_FREQ_L = 122
# REG_LIA_LO_FREQ_H = 123
# REG_LIA_LO_PHASE_L = 124
# REG_LIA_LO_PHASE_H = 125
# REG_LIA_SINEOUTAMP = 126
# REG_LIA_SINEOUTOFF = 126
# REG_LIA_MONSELECT = 127
# _LIA_INPUT_SMPS = ADC_SMP_RATE
# _LIA_CHN_BUFLEN = CHN_BUFLEN
# _LIA_MON_NONE = 0
# _LIA_MON_IN1 = 1
# _LIA_MON_I = 2
# _LIA_MON_Q = 3
# _LIA_MON_OUT = 4
# _LIA_MON_AUX = 5
# _LIA_MON_IN2 = 6
# _LIA_MON_DEMOD = 7
# _LIA_SOURCE_A = 0
# _LIA_SOURCE_B = 1
# _LIA_SOURCE_IN1 = 2
# _LIA_SOURCE_IN2 = 3
# _LIA_SOURCE_EXT = 4
# _LIA_OSC_SOURCES = {
#     'a': _LIA_SOURCE_A,
#     'b': _LIA_SOURCE_B,
#     'in1': _LIA_SOURCE_IN1,
#     'in2': _LIA_SOURCE_IN2,
#     'ext': _LIA_SOURCE_EXT
# }
# _LIA_CONTROL_FS = 25.0e6
# _LIA_FREQSCALE = 1.0e9 / 2**48
# _LIA_PHASESCALE = 1.0 / 2**48
# _LIA_P_GAINSCALE = 2.0**16
# _LIA_ID_GAINSCALE = 2.0**24 - 1
# _LIA_SIGNALS = ['x', 'y', 'r', 'theta']
# _NON_PLL_ALLOWED_SIGS = ['x', 'sine', 'offset', 'none']
# class LockInAmp(PIDController, _CoreOscilloscope):
#     def __init__(self):
#     def set_defaults(self):
#     def set_input_gain(self, gain=0):
#     def set_outputs(self, main, aux, main_offset=0.0, aux_offset=0.0):
#     def _update_pid_gain_selects(self):
#         def _signal_select(sig):
#     def set_pid_by_frequency(self, lia_ch, kp=1, i_xover=None, d_xover=None,
#                              si=None, sd=None, in_offset=0, out_offset=0):
#     def set_pid_by_gain(self, lia_ch, g, kp=1.0, ki=0, kd=0, si=None,
#                         sd=None, in_offset=0, out_offset=0):
#     def set_gain(self, lia_ch, g):
#     def set_demodulation(self, mode, frequency=1e6, phase=0,
#                          output_amplitude=0.5):
#     def set_filter(self, f_corner, order):
#     def set_lo_output(self, amplitude, frequency, phase):
#     def set_monitor(self, monitor_ch, source):
#     def set_trigger(self, source, edge, level, minwidth=None,
#                     maxwidth=None, hysteresis=10e-3, hf_reject=False,
#                     mode='auto'):
#     def _signal_source_volts_per_bit(self, source, scales, trigger=False):
#     def _monitor_source_volts_per_bit(self, source, scales):
#         def _demod_mode_to_gain(mode):
#     def _update_dependent_regs(self, scales):
#     def set_control_matrix(self):


import pytest
from pymoku.instruments import LockInAmp
from pymoku import _lockinamp
    from unittest.mock import ANY
    from mock import ANY


try:
except ImportError:


@pytest.fixture
def dut(moku):

# Path: pymoku/instruments.py

# 
# Path: pymoku/_lockinamp.py
# REG_LIA_PM_BW1 = 90
# REG_LIA_PM_AUTOA1 = 91
# REG_LIA_PM_REACQ = 92
# REG_LIA_PM_RESET = 93
# REG_LIA_PM_OUTDEC = 94
# REG_LIA_PM_OUTSHIFT = 94
# REG_LIA_SIG_SELECT = 95
# REG_LIA_ENABLES = 96
# REG_LIA_PIDGAIN1 = 97
# REG_LIA_PIDGAIN2 = 98
# REG_LIA_INT_IGAIN1 = 99
# REG_LIA_INT_IGAIN2 = 100
# REG_LIA_INT_IFBGAIN1 = 101
# REG_LIA_INT_IFBGAIN2 = 102
# REG_LIA_INT_PGAIN1 = 103
# REG_LIA_INT_PGAIN2 = 104
# REG_LIA_GAIN_STAGE = 105
# REG_LIA_DIFF_DGAIN2 = 106
# REG_LIA_DIFF_PGAIN1 = 107
# REG_LIA_DIFF_PGAIN2 = 108
# REG_LIA_DIFF_IGAIN1 = 109
# REG_LIA_DIFF_IGAIN2 = 110
# REG_LIA_DIFF_IFBGAIN1 = 111
# REG_LIA_DIFF_IFBGAIN2 = 112
# REG_LIA_IN_OFFSET1 = 113
# REG_LIA_OUT_OFFSET1 = 114
# REG_LIA_INPUT_GAIN = 117
# REG_LIA_FREQDEMOD_L = 118
# REG_LIA_FREQDEMOD_H = 119
# REG_LIA_PHASEDEMOD_L = 120
# REG_LIA_PHASEDEMOD_H = 121
# REG_LIA_LO_FREQ_L = 122
# REG_LIA_LO_FREQ_H = 123
# REG_LIA_LO_PHASE_L = 124
# REG_LIA_LO_PHASE_H = 125
# REG_LIA_SINEOUTAMP = 126
# REG_LIA_SINEOUTOFF = 126
# REG_LIA_MONSELECT = 127
# _LIA_INPUT_SMPS = ADC_SMP_RATE
# _LIA_CHN_BUFLEN = CHN_BUFLEN
# _LIA_MON_NONE = 0
# _LIA_MON_IN1 = 1
# _LIA_MON_I = 2
# _LIA_MON_Q = 3
# _LIA_MON_OUT = 4
# _LIA_MON_AUX = 5
# _LIA_MON_IN2 = 6
# _LIA_MON_DEMOD = 7
# _LIA_SOURCE_A = 0
# _LIA_SOURCE_B = 1
# _LIA_SOURCE_IN1 = 2
# _LIA_SOURCE_IN2 = 3
# _LIA_SOURCE_EXT = 4
# _LIA_OSC_SOURCES = {
#     'a': _LIA_SOURCE_A,
#     'b': _LIA_SOURCE_B,
#     'in1': _LIA_SOURCE_IN1,
#     'in2': _LIA_SOURCE_IN2,
#     'ext': _LIA_SOURCE_EXT
# }
# _LIA_CONTROL_FS = 25.0e6
# _LIA_FREQSCALE = 1.0e9 / 2**48
# _LIA_PHASESCALE = 1.0 / 2**48
# _LIA_P_GAINSCALE = 2.0**16
# _LIA_ID_GAINSCALE = 2.0**24 - 1
# _LIA_SIGNALS = ['x', 'y', 'r', 'theta']
# _NON_PLL_ALLOWED_SIGS = ['x', 'sine', 'offset', 'none']
# class LockInAmp(PIDController, _CoreOscilloscope):
#     def __init__(self):
#     def set_defaults(self):
#     def set_input_gain(self, gain=0):
#     def set_outputs(self, main, aux, main_offset=0.0, aux_offset=0.0):
#     def _update_pid_gain_selects(self):
#         def _signal_select(sig):
#     def set_pid_by_frequency(self, lia_ch, kp=1, i_xover=None, d_xover=None,
#                              si=None, sd=None, in_offset=0, out_offset=0):
#     def set_pid_by_gain(self, lia_ch, g, kp=1.0, ki=0, kd=0, si=None,
#                         sd=None, in_offset=0, out_offset=0):
#     def set_gain(self, lia_ch, g):
#     def set_demodulation(self, mode, frequency=1e6, phase=0,
#                          output_amplitude=0.5):
#     def set_filter(self, f_corner, order):
#     def set_lo_output(self, amplitude, frequency, phase):
#     def set_monitor(self, monitor_ch, source):
#     def set_trigger(self, source, edge, level, minwidth=None,
#                     maxwidth=None, hysteresis=10e-3, hf_reject=False,
#                     mode='auto'):
#     def _signal_source_volts_per_bit(self, source, scales, trigger=False):
#     def _monitor_source_volts_per_bit(self, source, scales):
#         def _demod_mode_to_gain(mode):
#     def _update_dependent_regs(self, scales):
#     def set_control_matrix(self):


# Path: tests/test_lockinamp.py
import pytest
from pymoku.instruments import LockInAmp
from pymoku import _lockinamp
    from unittest.mock import ANY
    from mock import ANY



try:
except ImportError:


@pytest.fixture
def dut(moku):

    i = LockInAmp()