help="Raiden debug commands") args = parser.parse_args() print(args) raiden = raiden.Raiden(mhz=100, serial_dev=args.port, baud=115200, ticks=True, debug=args.debug) #except: # print("Can't open Raiden!") # exit(True) raiden.reset_glitcher() raiden.arm(0) # reboot target raiden.set_target_power("off") time.sleep(1) raiden.set_target_power("on") time.sleep(1) raiden.set_target_power("auto") raiden.set_param(param="CMD_VSTART", value=1) raiden.set_param(param="CMD_GLITCH_COUNT", value=1) raiden.set_param(param="CMD_GLITCH_MAX", value=1) try: lpc = serial.Serial(args.lpc, baudrate=115200, timeout=0.1) except:
def showflags(): stat = raiden.flag_status() print("Current flags: %d" % stat) print(" Armed: %d" % raiden.is_armed()) print(" Trigger: %d" % raiden.is_triggered()) print(" Glitched: %d" % raiden.is_glitched()) print(" Finished: %d" % raiden.is_finished()) print(" Power: %d" % raiden.glitch_out()) print(raiden.get_buildtime()) print(raiden.get_buildtime()) print("clearing flags") print("") raiden.reset_fpga() raiden.arm(0) raiden.set_target_power("off") showflags() print("") print("arming...") raiden.arm(1) showflags() print("") print("power on...") raiden.set_target_power("on") showflags()