Hardware notes

ARM-USB-TINY-H

Chip datasheet: http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf

Connector pinout

      9 5 1
 ----^^----
/oooooooooo\
\oooooooooo/
 ----------
        6 2

Low voltage UART mode

Pin functions
Driver

Xtensa JTAG

Pin functions
topology.xml controller line
<controller id='Controller0' module='ft2232' probe='flyswatter' vid='0x15ba' pid='0x002a' usbser='OLVGHYS?' speed='10MHz'/>

SPI master

Pin functions
PyFTDI-based example

API doc: https://eblot.github.io/pyftdi/api/spi.html

from pyftdi import ftdi, spi

ftdi.Ftdi.add_custom_vendor(vid = 0x15ba)
ftdi.Ftdi.add_custom_product(vid = 0x15ba, pid = 0x002a)

ftdi.Ftdi.show_devices()

ctrl = spi.SpiController()
ctrl.configure("ftdi://0x15ba:0x002a:1/1")
port = ctrl.get_port(freq = 1000000, cs = 0)

port.write(b'1234', start = True, stop = False) # address phase, 4 bytes
port.read(1, start = False, stop = False, droptail = 4) # dummy phase, 4 clock cycles
port.read(1, start = False, stop = True) # read phase, 1 byte