Пример #1
0
def create_wolverine_dbg(ad7175_bus_name, vref, i2c_bus0_name, i2c_bus1_name,
                         i2c_dev_addr1, range_sel_bit, meter_sel_bit,
                         ip_dev_name):

    if ad7175_bus_name == '':
        ad7175 = None
    else:
        axi4_bus = AXI4LiteBus(ad7175_bus_name, 8192)
        ad7175 = MIXAd7175SG(axi4_bus, vref)
    if i2c_bus0_name == '':
        i2c_bus0 = None
    else:
        if utility.is_pl_device(i2c_bus0_name):
            axi4_bus = AXI4LiteBus(i2c_bus0_name, 256)
            i2c_bus0 = MIXI2CSG(axi4_bus)
        else:
            i2c_bus0 = I2C(i2c_bus0_name)

    if i2c_bus1_name == '':
        cat9555 = None
    else:
        if utility.is_pl_device(i2c_bus1_name):
            axi4_bus = AXI4LiteBus(i2c_bus1_name, 256)
            i2c_bus1 = MIXI2CSG(axi4_bus)
        else:
            i2c_bus1 = I2C(i2c_bus1_name)
        cat9555 = CAT9555(i2c_dev_addr1, i2c_bus1)

    if ip_dev_name == '':
        ipcore = None
    else:
        axi4_bus = AXI4LiteBus(ip_dev_name, 0x8000)
        ipcore = MIXDAQT1SGR(axi4_bus,
                             ad717x_chip='AD7175',
                             use_spi=False,
                             use_gpio=True)

    if range_sel_bit == '':
        range_sel_bit = None
    else:
        range_sel_bit = int(range_sel_bit)

    if meter_sel_bit == '':
        meter_sel_bit = None
    else:
        meter_sel_bit = int(meter_sel_bit)

    wolverine_dbg = WolverineDebugger(
        Wolverine(i2c_bus0, ad7175, Pin(cat9555, range_sel_bit),
                  Pin(cat9555, meter_sel_bit), ipcore))
    return wolverine_dbg
Пример #2
0
def create_mimic_dbg(ipcore_name, ad7175_bus_name, vref, i2c_bus_name):
    mimic_dbg = DMM003004Debuger()
    daqt1 = None
    ad7175 = None
    if ipcore_name != '':
        axi4_bus = AXI4LiteBus(ipcore_name, 9548)
        daqt1 = MIXDAQT1SGR(axi4_bus,
                            ad717x_mvref=vref,
                            use_spi=False,
                            use_gpio=False)
    elif ad7175_bus_name != '':
        axi4_bus = AXI4LiteBus(ad7175_bus_name, 256)
        ad7175 = MIXAd7175SG(axi4_bus, vref)

    if i2c_bus_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(i2c_bus_name):
            axi4_bus = AXI4LiteBus(i2c_bus_name, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_bus_name)

    mimic_dbg.mimic = DMM003004(i2c_bus, daqt1, ad7175)
    mimic_dbg.mimic.post_power_on_init()
    return mimic_dbg
Пример #3
0
def create_dazzler_dbg(i2s_rx_en_pin, adc_rst_pin, gpio_dev,
                       i2s_tx_en_pin, dac_rst_pin,
                       i2c_dev, mix_aut1_dev):

    dazzler_dbg = DazzlerDebuger()

    if utility.is_pl_device(i2c_dev):
        axi4_bus = AXI4LiteBus(i2c_dev, 256)
        i2c_bus = MIXI2CSG(axi4_bus)
    else:
        i2c_bus = I2C(i2c_dev)

    axi4 = AXI4LiteBus(mix_aut1_dev, 0x8000)
    mix_aut1 = MIXAUT1SGR(axi4)

    if gpio_dev != "":
        axi4 = AXI4LiteBus(gpio_dev, 256)
        gpio = MIXGPIOSG(axi4)
        analyzer_rst = Pin(gpio, adc_rst_pin)
        analyzer_en = Pin(gpio, i2s_rx_en_pin)
        signal_source_rst = Pin(gpio, dac_rst_pin)
        signal_source_en = Pin(gpio, i2s_tx_en_pin)
        dazzler_dbg.audio = Audio001004(i2c=i2c_bus, adc_rst_pin=analyzer_rst,
                                        i2s_rx_en_pin=analyzer_en,
                                        dac_rst_pin=signal_source_rst,
                                        i2s_tx_en_pin=signal_source_en,
                                        ipcore=mix_aut1)
    else:
        dazzler_dbg.audio = Audio001004(i2c=i2c_bus, ipcore=mix_aut1)

    return dazzler_dbg
Пример #4
0
def create_dmm_dbg(ad7175_bus_name, i2c_bus_name, axi4_bus_name):
    dmm_dbg = DMM010001Debuger()

    if axi4_bus_name == '':
        daqt1 = MIXDAQT1SGREmulator(axi4_bus=None,
                                    ad717x_chip='AD7175',
                                    ad717x_mvref=5000,
                                    use_spi=False,
                                    use_gpio=False)
        ad7175 = None
    elif 'MIX_DAQT' in axi4_bus_name:
        daqt1_axi4_bus = AXI4LiteBus(axi4_bus_name, 65535)
        daqt1 = MIXDAQT1SGR(axi4_bus=daqt1_axi4_bus,
                            ad717x_chip='AD7175',
                            ad717x_mvref=5000,
                            use_spi=False,
                            use_gpio=False)
        ad7175 = None
    else:
        daqt1 = None
        ad717x_axi4_bus = AXI4LiteBus(ad7175_bus_name, 8192)
        ad7175 = MIXAd7175SG(ad717x_axi4_bus, 5000)

    if i2c_bus_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(i2c_bus_name):
            axi4_bus = AXI4LiteBus(i2c_bus_name, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_bus_name)

    dmm_dbg.dmm = DMM010001(ad7175, i2c_bus, daqt1)
    dmm_dbg.dmm.module_init()
    return dmm_dbg
Пример #5
0
def create_dbg(file, gpio_number, spi_bus_name, adc_channel,
               i2c_bus_name, uart_drv, ad5667r_drv):
    dbg = DarkBeastFDebuger()

    firmware_path = file
    aid_connect = GPIO(int(gpio_number))

    if spi_bus_name == '':
        ad5592r = None
    else:
        axi4_bus = AXI4LiteBus(spi_bus_name, 256)
        spi_bus = MIXQSPISG(axi4_bus)
        ad5592r = AD5592R(spi_bus, 2500, 'internal', 1, 2)

    if i2c_bus_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(i2c_bus_name):
            axi4_bus = AXI4LiteBus(i2c_bus_name, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_bus_name)

    pl_uart_drv_ko_file = uart_drv
    ad5667r_drv_ko_file = ad5667r_drv
    dbg.darkbeastf = DarkBeastF(firmware_path, aid_connect, ad5592r, adc_channel,
                                i2c_bus, pl_uart_drv_ko_file, ad5667r_drv_ko_file)
    return dbg
Пример #6
0
def create_beast_dbg(ip_name, i2c_bus_name):
    starlord_dbg = MIX_StarLord_SGDebuger()

    if utility.is_pl_device(i2c_bus_name):
        axi4_bus = AXI4LiteBus(i2c_bus_name, 256)
        i2c_bus = MIXI2CSG(axi4_bus)
    else:
        i2c_bus = PSI2CBus(i2c_bus_name)

    mux = TCA9548(0x77, i2c_bus)
    i2c_bus_1 = I2CDownstreamBus(mux, 5)
    axi4_bus = AXI4LiteBus(ip_name, 65535)
    mix_aut5_r = MIXAUT5SGR(axi4_bus, fft_data_cnt=1234, ad717x_mvref=2500)
    starlord_dbg.starlord = StarLord(i2c=i2c_bus_1, ipcore=mix_aut5_r)
    return starlord_dbg
Пример #7
0
def create_beast_dbg(ip_name, i2c_bus_name):
    audio005002_dbg = MIX_Audio005002_Debuger()

    if utility.is_pl_device(i2c_bus_name):
        axi4_bus = AXI4LiteBus(i2c_bus_name, 256)
        i2c_bus = MIXI2CSG(axi4_bus)
    else:
        i2c_bus = PSI2CBus(i2c_bus_name)

    mux = TCA9548(0x77, i2c_bus)
    i2c_bus_1 = I2CDownstreamBus(mux, 5)
    axi4_bus = AXI4LiteBus(ip_name, 65535)
    mix_aut5_r = MIXAudio005SGR(axi4_bus, fft_data_cnt=1234)
    audio005002_dbg.audio005002 = Audio005002(i2c=i2c_bus_1, ipcore=mix_aut5_r)
    return audio005002_dbg
Пример #8
0
def create_elektra_dbg(i2c_name, spi_name, ad760x_name, gpio_id, volt_ch_1,
                       volt_ch_2, curr_ch_1, curr_ch_2):
    scope_dbg = ElektraDebuger()
    if i2c_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(i2c_name):
            axi4_bus = AXI4LiteBus(i2c_name, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_name)

    if spi_name == '':
        spi_bus = None
    else:
        axi4_bus = AXI4LiteBus(spi_name, 8192)
        spi_bus = MIXQSPISG(axi4_bus)

    if ad760x_name == '':
        ad7608_ip = None
    else:
        axi4 = AXI4LiteBus(ad760x_name, 8192)
        ad7608_ip = MIXAd7608SG(axi4)

    if gpio_id == '':
        gpio_bus = None
    else:
        io = GPIO(gpio_id, "output")
        gpio_bus = Pin(io, gpio_id, "output")

    volt_1 = int(volt_ch_1)
    volt_2 = int(volt_ch_2)
    curr_1 = int(curr_ch_1)
    curr_2 = int(curr_ch_2)
    scope_dbg.elektra = Elektra(i2c=i2c_bus,
                                spi=spi_bus,
                                ad7608=ad7608_ip,
                                gpio=gpio_bus,
                                volt_ch1=volt_1,
                                volt_ch2=volt_2,
                                curr_ch1=curr_1,
                                curr_ch2=curr_2)
    return scope_dbg
Пример #9
0
def create_dmm003004A_dbg(ipcore_name, vref, i2c_bus_name):
    dmm003004A_dbg = DMM003004ADebuger()
    daqt1 = None
    if ipcore_name != '':
        axi4_bus = AXI4LiteBus(ipcore_name, 9548)
        daqt1 = MIXDAQT1SGR(axi4_bus, ad717x_chip='AD7175', ad717x_mvref=vref, use_spi=False, use_gpio=False)

    if i2c_bus_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(i2c_bus_name):
            axi4_bus = AXI4LiteBus(i2c_bus_name, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_bus_name)

    dmm003004A_dbg.dmm003004A = DMM003004A(i2c_bus, daqt1)
    dmm003004A_dbg.dmm003004A.module_init()
    return dmm003004A_dbg
Пример #10
0
def create_dazzler_dbg(fftrt_dev, i2s_rx_en_pin, adc_rst_pin, gpio_dev,
                       signal_source_dev, i2s_tx_en_pin, dac_rst_pin, i2c_dev,
                       mix_aut1_dev):

    dazzler_dbg = DazzlerDebuger()

    if i2c_dev != '':
        if utility.is_pl_device(i2c_dev):
            axi4_bus = AXI4LiteBus(i2c_dev, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_dev)
    else:
        i2c_bus = None

    if mix_aut1_dev != '':
        axi4 = AXI4LiteBus(mix_aut1_dev, 0x8000)
        mix_aut1 = MIXAUT1SGR(axi4)
        dazzler_dbg.audio = Dazzler(i2c_bus, ip=mix_aut1)
    else:
        axi4 = AXI4LiteBus(fftrt_dev, 256)
        analyzer = MIXFftAnalyzerSG(axi4)

        axi4 = AXI4LiteBus(signal_source_dev, 256)
        signal_source = MIXSignalSourceSG(axi4)

        axi4 = AXI4LiteBus(gpio_dev, 256)
        gpio = MIXGPIOSG(axi4)
        analyzer_rst = Pin(gpio, adc_rst_pin)
        analyzer_en = Pin(gpio, i2s_rx_en_pin)
        signal_source_rst = Pin(gpio, dac_rst_pin)
        signal_source_en = Pin(gpio, i2s_tx_en_pin)
        dazzler_dbg.audio = Dazzler(i2c_bus,
                                    analyzer=analyzer,
                                    signal_source=signal_source,
                                    adc_rst_pin=analyzer_rst,
                                    i2s_rx_en_pin=analyzer_en,
                                    dac_rst_pin=signal_source_rst,
                                    i2s_tx_en_pin=signal_source_en,
                                    ip=mix_aut1)

    return dazzler_dbg
Пример #11
0
def create_elektra_dbg(i2c_name, spi_name, ad717x_name, gpio_id, ipcore_name):
    scope_dbg = ElektraDebuger()
    if i2c_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(i2c_name):
            axi4_bus = AXI4LiteBus(i2c_name, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c_name)

    if spi_name == '':
        spi_bus = None
    else:
        axi4_bus = AXI4LiteBus(spi_name, 8192)
        spi_bus = MIXQSPISG(axi4_bus)

    ipcore = None
    ad7175 = None
    vref = 5000
    if ipcore_name != '':
        axi4_bus = AXI4LiteBus(ipcore_name, 9548)
        ipcore = MIXDAQT1SGR(axi4_bus,
                             ad717x_mvref=vref,
                             use_spi=True,
                             use_gpio=False)
    elif ad717x_name != '':
        axi4_bus = AXI4LiteBus(ad717x_name, 256)
        ad7175 = MIXAd7175SG(axi4_bus, vref)

    if gpio_id == '':
        gpio_bus = None
    else:
        io = GPIO(gpio_id, "output")
        gpio_bus = Pin(io, gpio_id, "output")

    scope_dbg.elektra = EL004002A(i2c=i2c_bus,
                                  spi=spi_bus,
                                  ad7175=ad7175,
                                  gpio=gpio_bus,
                                  ipcore=ipcore)
    return scope_dbg
Пример #12
0
def create_negasonic_dbg(fftrt_dev, i2s_rx_en_pin, adc_rst_pin, gpio_dev,
                         signal_source_dev, i2s_tx_en_pin, dac_rst_pin,
                         i2c_dev, mix_aut1_dev):

    audio002002_dbg = NegasonicDebuger()

    if utility.is_pl_device(i2c_dev):
        axi4_bus = AXI4LiteBus(i2c_dev, 256)
        i2c_bus = MIXI2CSG(axi4_bus)
    else:
        i2c_bus = I2C(i2c_dev)

    if mix_aut1_dev != '':
        axi4 = AXI4LiteBus(mix_aut1_dev, 0x8000)
        mix_aut1 = MIXAUT1(axi4)
        audio002002_dbg.audio = Negasonic(i2c_bus, ip=mix_aut1)
    else:
        axi4 = AXI4LiteBus(fftrt_dev, 256)
        analyzer = MIXFftAnalyzerSG(axi4)

        axi4 = AXI4LiteBus(signal_source_dev, 256)
        signal_source = MIXSignalSourceSG(axi4)

        axi4 = AXI4LiteBus(gpio_dev, 256)
        gpio = MIXGPIOSG(axi4)
        analyzer_rst = Pin(gpio, adc_rst_pin)
        analyzer_en = Pin(gpio, i2s_rx_en_pin)
        signal_source_rst = Pin(gpio, dac_rst_pin)
        signal_source_en = Pin(gpio, i2s_tx_en_pin)
        audio002002_dbg.audio = Negasonic(i2c_bus,
                                          analyzer=analyzer,
                                          signal_sourc=signal_source,
                                          analyzer_rst=analyzer_rst,
                                          analyzer_en=analyzer_en,
                                          signal_source_rst=signal_source_rst,
                                          signal_source_en=signal_source_en)

    return audio002002_dbg