+ o = {'type': state,
+ 'range': (startsample, samplenum - 1),
+ 'data': d, 'ann': None}
+ if state == ADDRESS and wr == 1:
+ o['type'] = 'AW'
+ elif state == ADDRESS and wr == 0:
+ o['type'] = 'AR'
+ elif state == DATA and wr == 1:
+ o['type'] = 'DW'
+ elif state == DATA and wr == 0:
+ o['type'] = 'DR'
+ out.append(o)
+ o = {'type': ack, 'range': (samplenum, samplenum),
+ 'data': None, 'ann': None}
+ out.append(o)
+ bitcount = data = startsample = 0
+ startsample = -1