- def decode(self, ss, es, data):
- if self.samplerate is None:
- raise Exception("Cannot decode without samplerate.")
- for self.samplenum, (sck, ws, sd) in data:
-
- # Ignore sample if the bit clock hasn't changed.
- if sck == self.oldsck:
- continue
-
- self.oldsck = sck
- if sck == 0: # Ignore the falling clock edge.
- continue
+ def decode(self):
+ if not self.samplerate:
+ raise SamplerateError('Cannot decode without samplerate.')
+ while True:
+ # Wait for a rising edge on the SCK pin.
+ sck, ws, sd = self.wait({0: 'r'})