- self.itemcount, self.items = 0, []
-
- def find_clk_edge(self, clk, datapins):
- # Ignore sample if the clock pin hasn't changed.
- if clk == self.oldclk:
- return
- self.oldclk = clk
-
- # Sample data on rising/falling clock edge (depends on config).
- c = self.options['clock_edge']
- if c == 'rising' and clk == 0: # Sample on rising clock edge.
- return
- elif c == 'falling' and clk == 1: # Sample on falling clock edge.
- return
-
- # Found the correct clock edge, now get the bits.
- self.handle_bits(datapins)
-
- def decode(self, ss, es, data):
- for (self.samplenum, pins) in data:
-
- # Ignore identical samples early on (for performance reasons).
- if self.oldpins == pins:
- continue
- self.oldpins = pins