From 48f32949bc0673900c75b0b0181a00c4756ab9db Mon Sep 17 00:00:00 2001 From: Matthew Mets Date: Mon, 24 Oct 2022 16:05:00 +0100 Subject: [PATCH] Add software reset example for the mta1 programmer --- hw/boards/mta1-usb-v1/test/reset.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 hw/boards/mta1-usb-v1/test/reset.py diff --git a/hw/boards/mta1-usb-v1/test/reset.py b/hw/boards/mta1-usb-v1/test/reset.py new file mode 100755 index 0000000..3bc9511 --- /dev/null +++ b/hw/boards/mta1-usb-v1/test/reset.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +import hid_test +import time + +def reset_mta1(): + """ Manipulate the GPIO lines on the MTA1-USB-CH552 Programmer to issue a hardware reset to the MTA1 """ + d = hid_test.ice40_flasher() + d.gpio_set_direction(14, True) + d.gpio_put(14, False) + d.gpio_set_direction(14, False) + d.close() + +reset_mta1()