2023-01-11 16:33:01 +01:00
|
|
|
#!/usr/bin/env python
|
2023-03-06 12:41:21 +01:00
|
|
|
"""Automatically reset a TK-1"""
|
|
|
|
|
2023-03-08 16:20:00 +01:00
|
|
|
from iceflasher import IceFlasher
|
2022-10-24 16:05:00 +01:00
|
|
|
|
2022-10-25 14:18:04 +02:00
|
|
|
|
2023-03-02 23:52:52 +01:00
|
|
|
def reset_tk1() -> None:
|
|
|
|
""" Reset a TK1 contained in a TP1 programmer
|
|
|
|
|
|
|
|
Manipulate the GPIO lines on the TP1 to issue a hardware reset
|
|
|
|
to the TK1. The result is that TK1 again will be in firmware
|
|
|
|
mode, so a new app can be loaded.
|
|
|
|
"""
|
2023-03-06 12:41:21 +01:00
|
|
|
flasher = IceFlasher()
|
|
|
|
flasher.gpio_set_direction(14, True)
|
|
|
|
flasher.gpio_put(14, False)
|
|
|
|
flasher.gpio_set_direction(14, False)
|
2022-10-24 16:05:00 +01:00
|
|
|
|
2023-03-02 23:52:52 +01:00
|
|
|
|
2022-10-25 14:18:04 +02:00
|
|
|
reset_tk1()
|