def create_sgmoduledriver_dbg(eeprom_addr, eeprom_bus_name, nct_addr, nct_bus_name, range_table): sgmoduledriver_dbg = SGModuleDriverDebuger() if eeprom_bus_name == "": eeprom = None else: if utility.is_pl_device(eeprom_bus_name): axi4_bus = AXI4LiteBus(eeprom_bus_name, PLI2CDef.REG_SIZE) i2c_bus = MIXI2CSG(axi4_bus) else: i2c_bus = I2C(eeprom_bus_name) eeprom = AT24C08(eeprom_addr, i2c_bus) if nct_bus_name == "": nct = None else: if utility.is_pl_device(nct_bus_name): axi4_bus = AXI4LiteBus(nct_bus_name, PLI2CDef.REG_SIZE) i2c_bus = MIXI2CSG(axi4_bus) else: i2c_bus = I2C(nct_bus_name) nct = NCT75(nct_addr, nct_bus_name) sgmoduledriver_dbg._mix = SGModuleDriver(eeprom, nct, range_table) return sgmoduledriver_dbg
def create_mixboard_dbg(eeprom_addr, eeprom_bus_name, nct_addr, nct_bus_name, cal_table, range_table): mixboard_dbg = MIXBoardDebuger() if eeprom_bus_name == "": eeprom = None else: if utility.is_pl_device(eeprom_bus_name): axi4_bus = AXI4LiteBus(eeprom_bus_name, PLI2CDef.REG_SIZE) i2c_bus = MIXI2CSG(axi4_bus) else: i2c_bus = I2C(eeprom_bus_name) eeprom = AT24C08(eeprom_addr, i2c_bus) if nct_bus_name == "": nct = None else: if utility.is_pl_device(nct_bus_name): axi4_bus = AXI4LiteBus(nct_bus_name, PLI2CDef.REG_SIZE) i2c_bus = MIXI2CSG(axi4_bus) else: i2c_bus = I2C(nct_bus_name) nct = NCT75(nct_addr, nct_bus_name) mixboard_dbg._mix = MIXBoard(eeprom, nct, cal_table, range_table) return mixboard_dbg
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
def create_scope_dbg(axi4_bus_name, i2c_bus_name): scope_dbg = CloakDebuger() if axi4_bus_name == '': daqt1 = MIXDAQT1SGREmulator(axi4_bus=None, ad717x_chip='AD7177', ad717x_mvref=2500, use_spi=False, use_gpio=False) ad7177 = None elif 'MIX_Scope' in axi4_bus_name: daqt1_axi4_bus = AXI4LiteBus(axi4_bus_name, 0x8000) daqt1 = MIXDAQT1SGR(axi4_bus=daqt1_axi4_bus, ad717x_chip='AD7177', ad717x_mvref=2500, use_spi=False, use_gpio=False) ad7177 = None else: daqt1 = None ad717x_axi4_bus = AXI4LiteBus(axi4_bus_name, 0x8192) ad7177 = MIXAd7177SG(ad717x_axi4_bus, 2500) if i2c_bus_name == '': i2c_bus = None else: axi4_bus = AXI4LiteBus(i2c_bus_name, 256) i2c_bus = MIXI2CSG(axi4_bus) scope_dbg.cloak = Cloak(i2c=i2c_bus, ad7177=ad7177, ip=daqt1) return scope_dbg
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
def create_omega_dbg(axi4_bus_name, spi_axi4_bus_name, i2c_bus_name): omega = OmegaDebuger() if 'DAQT1' in axi4_bus_name: daqt1_axi4_bus = AXI4LiteBus(axi4_bus_name, 0x8000) daqt1 = MIXDAQT1SGR(axi4_bus=daqt1_axi4_bus, ad717x_chip='AD7175', ad717x_mvref=5000, use_spi=True, use_gpio=False) ad7175 = None spi_bus = None else: daqt1 = None ad717x_axi4_bus = AXI4LiteBus(axi4_bus_name, 0x8192) ad7175 = MIXAd7175SG(ad717x_axi4_bus, 5000) spi_axi4_bus = AXI4LiteBus(spi_axi4_bus_name, 0x8192) spi_bus = PLSPIBus(spi_axi4_bus) axi4_bus = AXI4LiteBus(i2c_bus_name, 256) i2c_bus = MIXI2CSG(axi4_bus) omega.omega = DMM005004(i2c=i2c_bus, spi=spi_bus, ad7175=ad7175, ipcore=daqt1) return omega
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
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
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
def create_scope001002_dbg(signal_meter, daqt2_bus_name, i2c_bus_name): scope001002_dbg = Scope001002Debuger() I2C_bus = AXI4LiteBus(i2c_bus_name, 256) i2c = MIXI2CSG(I2C_bus) axi4_bus = AXI4LiteBus(signal_meter, 256) signal_meter = MIXSignalMeterSG(axi4_bus) scope001002_dbg.scope001002 = Scope001002(i2c, None, None, None, signal_meter) return scope001002_dbg
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
def create_dbg(): dbg = MagikDebuger() signal_meter_0 = MIXSignalMeterSG(AXI4LiteBus('/dev/MIX_SignalMeter_0', 8192)) signal_meter_1 = MIXSignalMeterSG(AXI4LiteBus('/dev/MIX_SignalMeter_0', 8192)) spi = MIXQSPISG(AXI4LiteBus('/dev/MIX_QSPI_1', 8192)) i2c = MIXI2CSG(AXI4LiteBus('/dev/MIX_I2C_1', 8192)) dbg.magik = Magik(None, signal_meter_0, signal_meter_1, spi, i2c) return dbg
def create_beast_dbg(signal_meter, daqt2_bus_name, i2c_bus_name): beast_dbg = BeastDebuger() I2C_bus = AXI4LiteBus(i2c_bus_name, 256) i2c = MIXI2CSG(I2C_bus) axi4_bus = AXI4LiteBus(signal_meter, 256) signal_meter = MIXSignalMeterSG(axi4_bus) beast_dbg.beast = Beast(i2c, None, None, None, signal_meter) return beast_dbg
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
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
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
def create_ads1110_dbg(dev_name, dev_addr): ads1110_dbg = ADS1110Debuger() 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) ads1110_dbg.ads1110 = ADS1110(dev_addr, i2c_bus) return ads1110_dbg
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
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
def create_storm_dbg(i2c_dev_name, ft4222_gpiow_file, ft4222_spimr_file): storm_dbg = StormDebuger() if i2c_dev_name is '': i2c = None else: i2c_bus = AXI4LiteBus(i2c_dev_name, 256) i2c = MIXI2CSG(i2c_bus) storm_dbg.storm = Storm(i2c, ft4222_gpiow_file, ft4222_spimr_file) return storm_dbg
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
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
def create_psu001003_dbg(i2c_bus_name): psu001003_dbg = Psu001003Debugger() 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) psu001003_dbg.psu = PSU001003(i2c_bus) psu001003_dbg.psu.board_init() return psu001003_dbg
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
def create_se2300_dbg(gpio_device, i2c_bus_1, i2c_bus_2, ps_ipcore, trigger_ipcore): se2300_dbg = Se2300ps01pcbDebuger() if gpio_device == '': gpio = None else: axi4_bus = AXI4LiteBus(gpio_device, 256) gpio = MIXGPIOSG(axi4_bus) ads5231_oea = Pin(gpio, 1) data_upload = Pin(gpio, 4) if i2c_bus_1 == '': iic_1 = None else: axi4_bus = AXI4LiteBus(i2c_bus_1, 256) iic_1 = MIXI2CSG(axi4_bus) if i2c_bus_2 == '': iic_2 = None else: axi4_bus = AXI4LiteBus(i2c_bus_2, 256) iic_2 = MIXI2CSG(axi4_bus) if ps_ipcore == '': power_sequency = None else: axi4_bus = AXI4LiteBus(ps_ipcore, 1024) power_sequency = MIXPowerSequenceSG(axi4_bus) if trigger_ipcore == '': trigger_core = None else: axi4_bus = AXI4LiteBus(trigger_ipcore, 1024) trigger_core = MIXPowerSequenceSG(axi4_bus) se2300_dbg.se2300 = SE2300PS01PCB(ads5231_oea, data_upload, iic_1, iic_2, power_sequency, trigger_core) return se2300_dbg
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
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
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
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
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