def __init__(self, **kwargs):
self.next()
+ self.requirements_met = True
def start(self):
self.out_ann = self.register(srd.OUTPUT_ANN)
self.warn(pos, 'wrong data for "ACTIVATE" command')
def decode(self, ss, es, data):
+ if not self.requirements_met:
+ return
+
ptype, data1, data2 = data
if ptype == 'CS-CHANGE':
+ if data1 == -1:
+ if data2 == -1:
+ self.requirements_met = False
+ raise ChannelError('CS# pin required.')
+
if data1 == 0 and data2 == 1:
# Rising edge, the complete command is transmitted, process
# the bytes that were send after the command byte.
pos = (ss, es)
if miso is None or mosi is None:
+ self.requirements_met = False
raise ChannelError('Both MISO and MOSI pins required.')
if self.first: