Open Source & Linux Lab

It's better when it's simple

User Tools

Site Tools


etc:users:jcmvbkbc:hardware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
etc:users:jcmvbkbc:hardware [2016/08/08 20:53] – ↷ Page moved from users:jcmvbkbc:hardware to etc:users:jcmvbkbc:hardware keletc:users:jcmvbkbc:hardware [2026/08/29 16:52] (current) – jcmvbkbc
Line 42: Line 42:
 == topology.xml controller line == == topology.xml controller line ==
   <controller id='Controller0' module='ft2232' probe='flyswatter' vid='0x15ba' pid='0x002a' usbser='OLVGHYS?' speed='10MHz'/>   <controller id='Controller0' module='ft2232' probe='flyswatter' vid='0x15ba' pid='0x002a' usbser='OLVGHYS?' speed='10MHz'/>
 +
 +=== SPI master ===
 +== Pin functions ==
 +  * 5: MOSI
 +  * 7: CS0
 +  * 9: SCK
 +  * 13: MISO (pulled up by default)
 +
 +== PyFTDI-based example ==
 +API doc: https://eblot.github.io/pyftdi/api/spi.html
 +<code>
 +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
 +</code>
etc/users/jcmvbkbc/hardware.1470678794.txt.gz · Last modified: 2016/08/08 20:53 by kel