Exemplo n.º 1
0
def create_bus(dev_name):
    if dev_name == '':
        return None

    if utility.is_pl_device(dev_name):
        axi4_bus = AXI4LiteBus(dev_name, PLSPIDef.REG_SIZE)
        bus = MIXQSPISG(axi4_bus)
        bus.mode = 'MODE2'
    else:
        raise NotImplementedError('PS SPI not implement yet!')
    return bus
Exemplo n.º 2
0
def create_ad9628_dbg(dev_name, pdwn_ctrl, oeb_ctrl, cs_ctrl, use_cs):
    ad9628_dbg = AD9628Debuger()
    if dev_name == '':
        spi_bus = None
    else:
        if utility.is_pl_device(dev_name):
            axi4_bus = AXI4LiteBus(dev_name, PLSPIDef.REG_SIZE)
            spi_bus = MIXQSPISG(axi4_bus)
            spi_bus.mode = 'MODE1'
        else:
            raise NotImplementedError('ps spi bus not support')
    ad9628_dbg.ad9628 = AD9628(spi_bus, pdwn_ctrl, oeb_ctrl, cs_ctrl, use_cs)
    return ad9628_dbg
Exemplo n.º 3
0
def create_ad9832_dbg(dev_name):
    ad9832_dbg = AD9832Debuger()
    if dev_name == '':
        spi_bus = None
    elif 'DAQT1' in dev_name:
        axi4_bus = AXI4LiteBus(dev_name, 0x8000)
        daqt1 = MIXDAQT1SGR(axi4_bus=axi4_bus,
                            ad717x_chip='AD7175',
                            ad717x_mvref=5000,
                            use_spi=True,
                            use_gpio=False)
        spi_bus = daqt1.spi
    else:
        axi4_bus = AXI4LiteBus(dev_name, PLSPIDef.REG_SIZE)
        spi_bus = MIXQSPISG(axi4_bus)

    spi_bus.set_speed(400000)
    spi_bus.mode = 'MODE1'
    ad9832_dbg.ad9832 = AD9832(spi_bus)
    return ad9832_dbg