def test1(): with ftdi.open() as mpsse: mpsse.lsbFirst = True mpsse.execute(ftdi.SetClockFrequency(100e3)) def pause(): raw_input() print("mpsse.execute(ShiftOut(4, \"\\x05\")") mpsse.execute(ftdi.ShiftOut(4, "\x05")) pause() print("mpsse.execute(ShiftOut(4, \"\\x0A\")") mpsse.execute(ftdi.ShiftOut(4, "\x0A")) pause() print("jtag = Jtag(mpsse)") jtag = Jtag(mpsse) pause() print("jtag.set_state(\"IDLE\")") jtag.set_state("IDLE") print("jtag.state =", jtag.state) pause() print("jtag.shift_ir(4, \"\\x05\")") jtag.shift_ir(4, "\x05") print("jtag.state =", jtag.state) pause() print("jtag.shift_dr(6, \"\\x2A\")") jtag.shift_dr(6, "\x2A") print("jtag.state =", jtag.state) pause() print("jtag.shift_dr(8, \"\\x2A\")") jtag.shift_dr(8, "\x2A") print("jtag.shift_dr(8, \"\\x2A\")") jtag.shift_dr(8, "\x2A") print("jtag.state =", jtag.state) pause() assert mpsse.checkReadBufferEmpty()
def test2(): commandList = None with open("svf.svf") as file: commandList = svf.parse(file) with ftdi.open() as mpsse: Jtag(mpsse).execute_list(commandList) assert mpsse.checkReadBufferEmpty()
def open(): mpsse = ftdi.open(ftdi.MASK.SPI_S, ftdi.MASK.SPI_O) spi = SPI(mpsse) return spi
def open(address = 0xE8): mpsse = ftdi.open(ftdi.MASK.I2C_O, ftdi.MASK.I2C_O) i2c = I2C(mpsse, address) return i2c
def readIdCode(): with ftdi.open() as mpsse: jtag = Jtag(mpsse)