- pins = self.wait([{0: 'r'}, {0: 'l', 1: 'r'}, {1: 'h', 2: 'f'}, {1: 'h', 2: 'r'}])
- if self.matched[0]: # RESET condition (R): RST = rising
+ # Signal conditions tracked by the protocol decoder:
+ # - RESET condition (R): RST = rising
+ # - Incoming data (D): RST = low, CLK = rising.
+ # - Command mode START: CLK = high, I/O = falling.
+ # - Command mode STOP: CLK = high, I/O = rising.
+ (COND_RESET, COND_DATA, COND_CMD_START, COND_CMD_STOP,) = range(4)
+ conditions = [
+ {Pin.RST: 'r'},
+ {Pin.RST: 'l', Pin.CLK: 'r'},
+ {Pin.CLK: 'h', Pin.IO: 'f'},
+ {Pin.CLK: 'h', Pin.IO: 'r'},
+ ]
+ pins = self.wait(conditions)
+ if self.matched[COND_RESET]: