The output type is now called OUTPUT_PYTHON, adapt all PDs to that.
self.xx, self.yy, self.zz, self.mm = 0, 0, 0, 0
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.reset_variables()
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def metadata(self, key, value):
self.dcf77_bitnumber_is_known = 0
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def metadata(self, key, value):
def start(self, metadata):
self.samplerate = metadata['samplerate']
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def decode(self, ss, es, data):
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
I²C packet:
[<cmd>, <data>]
self.samplerate = value
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
self.out_binary = self.register(srd.OUTPUT_BINARY)
self.out_bitrate = self.register(srd.OUTPUT_META,
self.put(self.startsample, self.samplenum, self.out_ann, data)
def putp(self, data):
- self.put(self.startsample, self.samplenum, self.out_proto, data)
+ self.put(self.startsample, self.samplenum, self.out_python, data)
def putb(self, data):
self.put(self.startsample, self.samplenum, self.out_binary, data)
self.streamcount = 0 # Number of created output streams
def start(self):
- self.out_proto = []
+ self.out_python = []
# Grab I²C packets into a local cache, until an I²C STOP condition
# packet comes along. At some point before that STOP condition, there
# We're never seen this slave, add a new stream.
self.slaves.append(databyte)
- self.out_proto.append(self.register(srd.OUTPUT_PYTHON,
- proto_id='i2c-%s' % hex(databyte)))
+ self.out_python.append(self.register(srd.OUTPUT_PYTHON,
+ proto_id='i2c-%s' % hex(databyte)))
self.stream = self.streamcount
self.streamcount += 1
elif cmd == 'STOP':
# Send the whole chunk of I²C packets to the correct stream.
for p in self.packets:
- self.put(p[0], p[1], self.out_proto[self.stream], p[2])
+ self.put(p[0], p[1], self.out_python[self.stream], p[2])
self.packets = []
self.stream = -1
self.packets = [] # Local cache of I²C packets
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON, proto_id='i2c')
+ self.out_python = self.register(srd.OUTPUT_PYTHON, proto_id='i2c')
if self.options['address'] not in range(0, 127 + 1):
raise Exception('Invalid slave (must be 0..127).')
if self.options['direction'] not in ('both', 'read', 'write'):
# TODO: START->STOP chunks with both read and write (Repeat START)
# Otherwise, send out the whole chunk of I²C packets.
for p in self.packets:
- self.put(p[0], p[1], self.out_proto, p[2])
+ self.put(p[0], p[1], self.out_python, p[2])
self.packets = []
else:
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
Packet:
[<ptype>, <pdata>]
self.wrote_wav_header = False
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_bin = self.register(srd.OUTPUT_BINARY)
self.out_ann = self.register(srd.OUTPUT_ANN)
self.samplerate = value
def putpb(self, data):
- self.put(self.start_sample, self.samplenum, self.out_proto, data)
+ self.put(self.start_sample, self.samplenum, self.out_python, data)
def putbin(self, data):
self.put(self.start_sample, self.samplenum, self.out_bin, data)
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
JTAG packet:
[<packet-type>, <data>]
self.first = True
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.put(self.ss_item, self.es_item, self.out_ann, data)
def putp(self, data):
- self.put(self.ss_item, self.es_item, self.out_proto, data)
+ self.put(self.ss_item, self.es_item, self.out_python, data)
def advance_state_machine(self, tms):
self.oldstate = self.state
# self.state = 'BYPASS'
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def handle_reg_bypass(self, cmd, bits):
self.databytes = []
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.ss_block = self.es_block = None
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putb(self, data):
self.es_block = None
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.data = []
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.data = []
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.state = 'IDLE'
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.init_seq = []
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.put(0, 0, self.out_ann, data)
def putpb(self, data):
- self.put(self.fall, self.samplenum, self.out_proto, data)
+ self.put(self.fall, self.samplenum, self.out_python, data)
def putb(self, data):
self.put(self.fall, self.samplenum, self.out_ann, data)
self.put(self.fall, self.rise, self.out_ann, data)
def putprs(self, data):
- self.put(self.rise, self.samplenum, self.out_proto, data)
+ self.put(self.rise, self.samplenum, self.out_python, data)
def putrs(self, data):
self.put(self.rise, self.samplenum, self.out_ann, data)
self.rise = 0
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def metadata(self, key, value):
self.rom = 0x0000000000000000
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
def puty(self, data):
# Helper function for most protocol packets.
- self.put(self.beg, self.end, self.out_proto, data)
+ self.put(self.beg, self.end, self.out_python, data)
def decode(self, ss, es, data):
code, val = data
self.bit_cnt = 0
self.put(ss, es, self.out_ann,
[0, ['Reset/presence: %s' % ('true' if val else 'false')]])
- self.put(ss, es, self.out_proto, ['RESET/PRESENCE', val])
+ self.put(ss, es, self.out_python, ['RESET/PRESENCE', val])
self.state = 'COMMAND'
return
self.ss_block = None
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
Packet:
[<ptype>, <pdata>]
self.state = 'IDLE'
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putpb(self, data):
- self.put(self.ss_item, self.es_item, self.out_proto, data)
+ self.put(self.ss_item, self.es_item, self.out_python, data)
def putb(self, data):
self.put(self.ss_item, self.es_item, self.out_ann, data)
def putpw(self, data):
- self.put(self.ss_word, self.es_word, self.out_proto, data)
+ self.put(self.ss_word, self.es_word, self.out_python, data)
def putw(self, data):
self.put(self.ss_word, self.es_word, self.out_ann, data)
if self.itemcount < ws:
return
- # Output annotations/proto for a word (a collection of items).
+ # Output annotations/python for a word (a collection of items).
word = 0
for i in range(ws):
if endian == 'little':
self.years = -1
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
self.read_buf = []
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
SPI packet:
[<cmd>, <data1>, <data2>]
self.samplerate = value
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
self.out_bitrate = self.register(srd.OUTPUT_META,
meta=(int, 'Bitrate', 'Bitrate during transfers'))
def putpw(self, data):
- self.put(self.startsample, self.samplenum, self.out_proto, data)
+ self.put(self.startsample, self.samplenum, self.out_python, data)
def putw(self, data):
self.put(self.startsample, self.samplenum, self.out_ann, data)
def find_clk_edge(self, miso, mosi, clk, cs):
if self.have_cs and self.oldcs != cs:
# Send all CS# pin value changes.
- self.put(self.samplenum, self.samplenum, self.out_proto,
+ self.put(self.samplenum, self.samplenum, self.out_python,
['CS-CHANGE', self.oldcs, cs])
self.oldcs = cs
# Reset decoder state when CS# changes (and the CS# pin is used).
self.dac_select = self.gain = self.dac_value = None
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def handle_11bits(self):
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
UART packet:
[<packet-type>, <rxtx>, <packet-data>]
def putp(self, data):
s, halfbit = self.samplenum, int(self.bit_width / 2)
- self.put(s - halfbit, s + halfbit, self.out_proto, data)
+ self.put(s - halfbit, s + halfbit, self.out_python, data)
def putbin(self, rxtx, data):
s, halfbit = self.startsample[rxtx], int(self.bit_width / 2)
self.oldpins = [1, 1]
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_bin = self.register(srd.OUTPUT_BINARY)
self.out_ann = self.register(srd.OUTPUT_ANN)
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
Packet:
[<ptype>, <pdata>]
self.state = 'WAIT FOR SOP'
def putpb(self, data):
- self.put(self.ss, self.es, self.out_proto, data)
+ self.put(self.ss, self.es, self.out_python, data)
def putb(self, data):
self.put(self.ss, self.es, self.out_ann, data)
def putpp(self, data):
- self.put(self.ss_packet, self.es_packet, self.out_proto, data)
+ self.put(self.ss_packet, self.es_packet, self.out_python, data)
def putp(self, data):
self.put(self.ss_packet, self.es_packet, self.out_ann, data)
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def handle_packet(self):
data = data[8:]
self.packet_summary += ' ]'
- # Convenience proto output (no annotation) for all bytes together.
+ # Convenience python output (no annotation) for all bytes together.
self.ss, self.es = self.bits[16][1], self.bits[-16][2]
self.putpb(['DATABYTES', databytes])
self.packet.append(databytes)
import sigrokdecode as srd
'''
-Protocol output format:
+OUTPUT_PYTHON format:
Packet:
[<ptype>, <pdata>]
self.state = 'IDLE'
def start(self):
- self.out_proto = self.register(srd.OUTPUT_PYTHON)
+ self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def metadata(self, key, value):
self.halfbit = int(self.bitwidth / 2)
def putpx(self, data):
- self.put(self.samplenum, self.samplenum, self.out_proto, data)
+ self.put(self.samplenum, self.samplenum, self.out_python, data)
def putx(self, data):
self.put(self.samplenum, self.samplenum, self.out_ann, data)
def putpm(self, data):
s, h = self.samplenum, self.halfbit
- self.put(self.ss_block - h, s + h, self.out_proto, data)
+ self.put(self.ss_block - h, s + h, self.out_python, data)
def putm(self, data):
s, h = self.samplenum, self.halfbit
def putpb(self, data):
s, h = self.samplenum, self.halfbit
- self.put(s - h, s + h, self.out_proto, data)
+ self.put(s - h, s + h, self.out_python, data)
def putb(self, data):
s, h = self.samplenum, self.halfbit