Exemplo n.º 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
Exemplo n.º 2
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
Exemplo n.º 3
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
Exemplo n.º 4
0
def create_magneto003002_dbg(i2c, spi, led1642_bus, pwm_gck_led, pwm_output, uart_rs485,
                             green_led_en, signal_out_en, spk_shdn_en, ringer_dir_pin,
                             acc1_relay, acc2_relay, relay1_res, relay2_res):

    i2c = I2C(i2c)
    axi4 = AXI4LiteBus(spi, 256)
    spi = MIXQSPISG(axi4)
    led1642_bus = AXI4LiteBus(led1642_bus, 256)
    pwm_gck_led = MIXPWMSG(pwm_gck_led, 1024)
    pwm_output = MIXPWMSG(pwm_output, 1024)

    uart_rs485 = UART(uart_rs485)

    green_led_en = GPIO(int(green_led_en))
    signal_out_en = GPIO(int(signal_out_en))
    spk_shdn_en = GPIO(int(spk_shdn_en))
    ringer_dir_pin = GPIO(int(ringer_dir_pin))
    acc1_relay = GPIO(int(acc1_relay))
    acc2_relay = GPIO(int(acc2_relay))
    relay1_res = GPIO(int(relay1_res))
    relay2_res = GPIO(int(relay2_res))

    magneto003002 = MAGNETO003002(i2c, spi, led1642_bus=led1642_bus, pwm_gck_led=pwm_gck_led,
                                  pwm_output=pwm_output, uart_rs485=uart_rs485, green_led_en=green_led_en,
                                  signal_out_en=signal_out_en, spk_shdn_en=spk_shdn_en,
                                  ringer_dir_pin=ringer_dir_pin, acc1_relay=acc1_relay, acc2_relay=acc2_relay,
                                  relay1_res=relay1_res, relay2_res=relay2_res)

    magneto003002_dbg = MAGNETO003002Debuger()
    magneto003002.module_init()
    magneto003002_dbg.magneto003002 = magneto003002
    return magneto003002_dbg
Exemplo n.º 5
0
def create_uel001003a_dbg(i2c_bus_name, spi_bus_name, gpio_device_name,
                          switch_pin_id):
    uel001003a_dbg = UEL001003ADebuger()

    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)

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

    if gpio_device_name == '':
        gpio_switch = GPIO(int(switch_pin_id), "output")
    else:
        axi4_bus = AXI4LiteBus(gpio_device_name, 256)
        gpio = MIXGPIOSG(axi4_bus)
        gpio_switch = Pin(gpio, int(switch_pin_id))

    uel001003a_dbg.uel001003a = UEL001003A(i2c=i2c_bus,
                                           spi=spi_bus,
                                           gpio_switch=gpio_switch)

    return uel001003a_dbg
Exemplo n.º 6
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
Exemplo n.º 7
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
Exemplo n.º 8
0
def create_ad9102_dbg(spi_bus_name,
                      cs_ctrl=None,
                      cs_chip=None,
                      cs_addr=None,
                      cs_i2c=None):
    ad9102_dbg = AD9102Debuger()
    if spi_bus_name == '':
        spi_bus = None
    else:
        axi4_bus = AXI4LiteBus(spi_bus_name, PLSPIDef.REG_SIZE)
        spi_bus = MIXQSPISG(axi4_bus)
        spi_bus.set_mode('MODE3')
        spi_bus.set_speed(800000)

    if cs_ctrl is not None:
        cs_chip = str(cs_chip)
        if '0x' in cs_addr:
            cs_addr = int(cs_addr, 16)
        else:
            cs_addr = int(cs_addr)
        cs_i2c = str(cs_i2c)
        cs_i2c = I2C(cs_i2c)
        exec('from ..ic.{} import {}'.format(cs_chip.lower(), cs_chip.upper()))
        cs_chip = eval(cs_chip.upper())(cs_addr, cs_i2c)
        cs = Pin(cs_chip, int(cs_ctrl))
    else:
        cs = None
    ad9102_dbg.ad9102 = AD9102(spi_bus, cs=cs)
    return ad9102_dbg
Exemplo n.º 9
0
def create_pca9557_dbg(dev_name, device_address):
    pca9557_dbg = PCA9557Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        i2c_bus = I2C(dev_name)
    pca9557_dbg.pca9557 = PCA9557(device_address, i2c_bus)
    return pca9557_dbg
Exemplo n.º 10
0
def create_bus(dev_name):
    if dev_name == '':
        return None

    if utility.is_pl_device(dev_name):
        axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
        i2c_bus = MIXI2CSG(axi4_bus)
    else:
        i2c_bus = I2C(dev_name)
    return i2c_bus
Exemplo n.º 11
0
def create_psu_dbg(i2c_ext, i2c_power, ad7175_bus_name, ipcore,
                   i2c_ext_use_tca9548_ch, i2c_power_use_tca9548_ch,
                   tca9548_addr):
    psu_dbg = OdinDebuger()
    daqt1 = None
    ad7175 = None
    if ipcore != '':
        axi4_bus = AXI4LiteBus(ipcore, 9548)
        daqt1 = MIXDAQT1SGR(axi4_bus,
                            ad717x_mvref=2500,
                            use_spi=False,
                            use_gpio=False)
    elif ad7175_bus_name != '':
        axi4_bus = AXI4LiteBus(ad7175_bus_name, 256)
        ad7175 = MIXAd7175SG(axi4_bus, 2500)

    if i2c_ext != '':
        if 'AXI4' in i2c_ext or 'MIX' in i2c_ext:
            axi4_bus = AXI4LiteBus(i2c_ext, 256)
            i2c_bus_ext = MIXI2CSG(axi4_bus)
        else:
            i2c_bus_ext = I2C(i2c_ext)

    if i2c_power != '':
        if 'AXI4' in i2c_power or 'MIX' in i2c_power:
            axi4_bus = AXI4LiteBus(i2c_power, 256)
            i2c_bus_power = MIXI2CSG(axi4_bus)
        else:
            i2c_bus_power = I2C(i2c_power)

    if i2c_ext_use_tca9548_ch != '' or i2c_power_use_tca9548_ch != '':
        tca9548_i2c = TCA9548(int(tca9548_addr), i2c_bus_ext)
        if i2c_ext_use_tca9548_ch != '':
            i2c_bus_ext = I2CDownstreamBus(tca9548_i2c,
                                           int(i2c_ext_use_tca9548_ch))
        if i2c_power_use_tca9548_ch != '':
            i2c_bus_power = I2CDownstreamBus(tca9548_i2c,
                                             int(i2c_power_use_tca9548_ch))

    psu_dbg.psu = Odin(i2c_bus_ext, i2c_bus_power, ad7175, daqt1)
    psu_dbg.psu.module_init()
    return psu_dbg
Exemplo n.º 12
0
def create_sg2251pw01pca_dbg(ip_name, signal_source_name, io_name, pin,
                             i2c_name):
    sg2251pw01pca_dbg = None
    if utility.is_pl_device(i2c_name):
        axi4_bus = AXI4LiteBus(i2c_name, 256)
        i2c = PLI2CBus(axi4_bus)
    else:
        i2c = I2C(i2c_name)
    sg2251pw01pca_dbg.sg2251pw01pca = SG2251PW01PCA(i2c)

    return sg2251pw01pca_dbg
Exemplo n.º 13
0
def create_sn65_dbg(dev_name, dev_addr):
    sn65dbg = SN65DSI86Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    sn65dbg.sn65dsi86 = SN65DSI86(dev_addr, i2c_bus)
    return sn65dbg
Exemplo n.º 14
0
def create_tmp108_dbg(dev_name, dev_addr):
    tmp108_dbg = TMP108Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    tmp108_dbg.tmp108 = TMP108(dev_addr, i2c_bus)
    return tmp108_dbg
Exemplo n.º 15
0
def create_mcp4725_dbg(dev_name, device_address):
    mcp4725_dbg = MCP4725Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    mcp4725_dbg.mcp4725 = MCP4725(device_address, i2c_bus)
    return mcp4725_dbg
Exemplo n.º 16
0
def create_bh1750_dbg(dev_name, dev_addr):
    bh1750_dbg = BH1750Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    bh1750_dbg.bh1750 = BH1750(dev_addr, i2c_bus)
    return bh1750_dbg
Exemplo n.º 17
0
def create_max6642_dbg(dev_name, dev_addr):
    max6642_dbg = MAX6642Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    max6642_dbg.max6642 = MAX6642(dev_addr, i2c_bus)
    return max6642_dbg
Exemplo n.º 18
0
def create_adc121c021_dbg(dev_name, vref, dev_addr):
    adc121c021_dbg = ADC121C021Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    adc121c021_dbg.adc121c021 = ADC121C021(dev_addr, vref, i2c_bus)
    return adc121c021_dbg
Exemplo n.º 19
0
def create_pcal6524_dbg(dev_name, device_address):
    pcal6524_dbg = PCAL6524Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = PLI2CBus(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    pcal6524_dbg.pcal6524 = PCAL6524(device_address, i2c_bus)
    return pcal6524_dbg
Exemplo n.º 20
0
def create_ad5693_dbg(dev_name, dev_addr):
    ad5693_dbg = AD5693Debuger()
    if dev_name == '':
        i2c_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(dev_name)
    ad5693_dbg.ad5693 = AD5693(dev_addr, i2c_bus)
    return ad5693_dbg
Exemplo n.º 21
0
def create_sg2238_dbg(i2c1):
    sg2238_dbg = Sg2238sp02pcaDebuger()
    if i2c1 == '':
        i2c1 = None
    else:
        if utility.is_pl_device(i2c1):
            axi4_bus = AXI4LiteBus(i2c1, 256)
            i2c_bus = MIXI2CSG(axi4_bus)
        else:
            i2c_bus = I2C(i2c1)
    sg2238_dbg.sg223802 = SG2238SP02PCA(i2c_bus)

    return sg2238_dbg
Exemplo n.º 22
0
def create_armor_dbg(dac_i2c_bus_name, eeprom_i2c_bus_name):
    armor_dbg = ArmorDebuger()

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

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

    armor_dbg.armor = Armor(dac_i2c_bus, eeprom_i2c_bus)
    return armor_dbg
Exemplo n.º 23
0
def create_magneto002002_dbg(i2c_bus0, led1642_bus, pwm_gck_led, pwm_output,
                             uart_rs485, ad5592r_spi, ad9833_spi, analyzer,
                             gpio_state_pin, pwm1_en_pin, pwm2_en_pin,
                             pwm3_en_pin, pwm4_en_pin, pwm5_en_pin,
                             pwm6_en_pin, pwm7_en_pin, pwm8_en_pin,
                             signal_out_en, iis_rx_en, iis_rx_ovfl,
                             iis_rx_rst):

    i2c = I2C(i2c_bus0)

    led1642_bus = AXI4LiteBus(led1642_bus, 256)
    pwm_gck_led = MIXPWMSG(pwm_gck_led, 1024)
    pwm_output = MIXPWMSG(pwm_output, 1024)

    uart_rs485 = UART(uart_rs485)

    axi4 = AXI4LiteBus(ad5592r_spi, 256)
    ad5592r_spi = MIXQSPISG(axi4)

    axi4 = AXI4LiteBus(ad9833_spi, 256)
    ad9833_spi = MIXQSPISG(axi4)

    analyzer = MIXFftAnalyzerSG(analyzer)

    gpio_state_pin = GPIO(int(gpio_state_pin))
    pwm1_en_pin = GPIO(int(pwm1_en_pin))
    pwm2_en_pin = GPIO(int(pwm2_en_pin))
    pwm3_en_pin = GPIO(int(pwm3_en_pin))
    pwm4_en_pin = GPIO(int(pwm4_en_pin))
    pwm5_en_pin = GPIO(int(pwm5_en_pin))
    pwm6_en_pin = GPIO(int(pwm6_en_pin))
    pwm7_en_pin = GPIO(int(pwm7_en_pin))
    pwm8_en_pin = GPIO(int(pwm8_en_pin))
    signal_out_en = GPIO(int(signal_out_en))
    iis_rx_en = GPIO(int(iis_rx_en))
    iis_rx_ovfl = GPIO(int(iis_rx_ovfl))
    iis_rx_rst = GPIO(int(iis_rx_rst))

    magneto002002 = MAGNETO002002(
        i2c, led1642_bus, pwm_gck_led, pwm_output, uart_rs485, ad5592r_spi,
        ad9833_spi, analyzer, gpio_state_pin, pwm1_en_pin, pwm2_en_pin,
        pwm3_en_pin, pwm4_en_pin, pwm5_en_pin, pwm6_en_pin, pwm7_en_pin,
        pwm8_en_pin, signal_out_en, iis_rx_en, iis_rx_ovfl, iis_rx_rst)

    magneto002002_dbg = MAGNETO002002Debuger()
    magneto002002.module_init()
    magneto002002_dbg.magneto002002 = magneto002002
    return magneto002002_dbg
Exemplo n.º 24
0
def create_bus(dev_name, bus_type):
    if dev_name == '':
        return None

    if bus_type == 'i2c':
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLI2CDef.REG_SIZE)
            bus = MIXI2CSG(axi4_bus)
        else:
            bus = I2C(dev_name)
    elif bus_type == 'spi':
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLSPIDef.REG_SIZE)
            bus = MIXQSPISG(axi4_bus)
        else:
            raise NotImplementedError('PS SPI not implement yet!')
    return bus
Exemplo n.º 25
0
def create_moonstar_dbg(ipcore_name, i2c_bus_name):
    moonstar_dbg = MoonstarDebuger()

    axi4_bus = AXI4LiteBus(ipcore_name, 9548)
    daqt1 = MIXDAQT1SGR(axi4_bus,
                        ad717x_chip='AD7175',
                        use_spi=False,
                        use_gpio=False)

    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)

    moonstar_dbg.moonstar = DMM007001(i2c_bus, daqt1)
    moonstar_dbg.moonstar.post_power_on_init()
    return moonstar_dbg
Exemplo n.º 26
0
def create_warlock_dbg(ipcore_name, i2c_dev, analyzer_dev, adc_rst_pin,
                       adc_ovfl_l_pin, i2s_rx_en_pin, i2s_ch_select_pin,
                       tone_detect_pin):

    warlock_dbg = WarlockDebuger()

    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 ipcore_name != '':
        ipcore = MIXMIK002SGR(ipcore_name)
        warlock_dbg.warlock = Warlock(i2c_bus, ipcore=ipcore)
    else:
        axi4 = AXI4LiteBus(analyzer_dev, 65535)
        analyzer = MIXFftAnalyzerSG(axi4)

        adc_rst_pin = GPIO(int(adc_rst_pin),
                           'output') if adc_rst_pin != "" else None
        adc_ovfl_l_pin = GPIO(int(adc_ovfl_l_pin),
                              'output') if adc_ovfl_l_pin != "" else None
        i2s_rx_en_pin = GPIO(int(i2s_rx_en_pin),
                             'output') if i2s_rx_en_pin != "" else None
        i2s_ch_select_pin = GPIO(int(i2s_ch_select_pin),
                                 'output') if i2s_ch_select_pin != "" else None
        tone_detect_pin = GPIO(int(tone_detect_pin),
                               'output') if tone_detect_pin != "" else None
        warlock_dbg.warlock = Warlock(i2c=i2c_bus,
                                      ipcore=None,
                                      analyzer=analyzer,
                                      adc_rst_pin=adc_rst_pin,
                                      adc_ovfl_l_pin=adc_ovfl_l_pin,
                                      i2s_rx_en_pin=i2s_rx_en_pin,
                                      i2s_ch_select_pin=i2s_ch_select_pin,
                                      tone_detect_pin=tone_detect_pin,
                                      upload_ch_select_pin=None,
                                      sample_rate=48000)

    return warlock_dbg
Exemplo n.º 27
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
Exemplo n.º 28
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
Exemplo n.º 29
0
def create_wolverineii_dbg(ipcore_name, i2c_bus_name):
    wolverineii_dbg = WolverineiiDebuger()
    daqt1 = None
    if ipcore_name != '':
        axi4_bus = AXI4LiteBus(ipcore_name, 9548)
        daqt1 = MIXDAQT1SGR(axi4_bus, 'AD7175', use_spi=True, 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)

    wolverineii_dbg.wolverineii = WolverineII(i2c_bus, daqt1)
    wolverineii_dbg.wolverineii.module_init()
    return wolverineii_dbg
Exemplo n.º 30
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