#!/usr/bin/env python
-#from array import array
-#import struct
-#import time
+from array import array
+import struct
+import time
from myhdl import intbv
-#from pyftdi.pyftdi.ftdi import Ftdi
-#from pyftdi.pyftdi.spi import SpiController
+from pyftdi.pyftdi.ftdi import Ftdi
+from pyftdi.pyftdi.spi import SpiController
self.send(1)
def updateGPO(self, force=False):
- if force or (self.gpo1 != self.lastO1) or
- (self.gpo2 != self.lastO2):
+ if (force or (self.gpo1 != self.lastO1) or
+ (self.gpo2 != self.lastO2)):
self.sendGPO()
def send(self, sel):
-if 0:
+if 1:
sc0 = SpiController()
sc0.configure(0x0403, 0x6011, 0, loopback=True)
return p._controller._ftdi.read_data_bytes(readlen, 4)
- print rw(p0, arr([0,1,2,3]))
- print rw(p1, arr([4,5,6,7]))
+ print 'Loopback SPI interfaces 0, 1'
+ a = [0,1,2,3,4,5,6,7,8,9]
+ print a
+ print rw(p0, arr(a))
+
+ a = [i for i in range(256)]
+ print a
+ print rw(p1, arr(a))