From 759bf95a765b703325f467c4417af4476fb3ed73 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 29 May 2021 17:43:21 +0800 Subject: [PATCH] add Kasli-SoC POR control program --- kasli_soc_por.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 kasli_soc_por.py diff --git a/kasli_soc_por.py b/kasli_soc_por.py new file mode 100644 index 0000000..8a48328 --- /dev/null +++ b/kasli_soc_por.py @@ -0,0 +1,17 @@ +from time import sleep +from pyftdi.ftdi import Ftdi + +POR = 1 << 7 + +def main(): + dev = Ftdi() + dev.open_bitbang_from_url("ftdi://ftdi:4232h/0") + dev.set_bitmode(POR, Ftdi.BitMode.BITBANG) + dev.write_data(bytes([0])) + sleep(0.1) + dev.write_data(bytes([POR])) + sleep(0.1) + dev.close() + +if __name__ == "__main__": + main()