Also, fix minor consistency issues, cosmetics, typos.
import calendar
# Annotation feed formats
import calendar
# Annotation feed formats
# Return the specified BCD number (max. 8 bits) as integer.
def bcd2int(b):
# Return the specified BCD number (max. 8 bits) as integer.
def bcd2int(b):
]
options = {}
annotations = [
]
options = {}
annotations = [
- # ANN_ASCII
- ['ASCII', 'TODO: description'],
+ # ANN_TEXT
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
license = 'gplv3+'
inputs = ['i2c']
outputs = []
license = 'gplv3+'
inputs = ['i2c']
outputs = []
+ probes = []
+ optional_probes = []
options = {
'address': ['Address to filter out of the I2C stream', 0],
'direction': ['Direction to filter (read/write)', '']
}
options = {
'address': ['Address to filter out of the I2C stream', 0],
'direction': ['Direction to filter (read/write)', '']
}
def __init__(self, **kwargs):
self.state = None
def __init__(self, **kwargs):
self.state = None
probes = [
{'id': 'sck', 'name': 'SCK', 'desc': 'Bit clock line'},
{'id': 'ws', 'name': 'WS', 'desc': 'Word select line'},
probes = [
{'id': 'sck', 'name': 'SCK', 'desc': 'Bit clock line'},
{'id': 'ws', 'name': 'WS', 'desc': 'Word select line'},
- {'id': 'sd', 'name': 'SD', 'desc': 'Serial Data line'},
+ {'id': 'sd', 'name': 'SD', 'desc': 'Serial data line'},
+ optional_probes = []
+ options = {}
- ['ASCII', 'Annotations in ASCII format'],
+ ['Hex', 'Annotations in hex format'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
- # Calculate the sample rate
+ # Calculate the sample rate.
samplerate = '?'
if self.start_sample != None and \
self.first_sample != None and \
self.start_sample > self.first_sample:
samplerate = '?'
if self.start_sample != None and \
self.first_sample != None and \
self.start_sample > self.first_sample:
- samplerate = "%d" % (self.samplesreceived *
+ samplerate = '%d' % (self.samplesreceived *
self.samplerate / (self.start_sample -
self.first_sample))
self.samplerate / (self.start_sample -
self.first_sample))
continue
self.oldsck = sck
continue
self.oldsck = sck
- if sck == 0: # Ignore the falling clock edge
+ if sck == 0: # Ignore the falling clock edge.
continue
self.data = (self.data << 1) | sd
self.bitcount += 1
continue
self.data = (self.data << 1) | sd
self.bitcount += 1
- # This was not the LSB unless WS has flipped
+ # This was not the LSB unless WS has flipped.
if ws == self.oldws:
continue
if ws == self.oldws:
continue
- # Only submit the sample, if we received the beginning of it
+ # Only submit the sample, if we received the beginning of it.
if self.start_sample != None:
self.samplesreceived += 1
self.put(self.start_sample, self.samplenum, self.out_proto,
if self.start_sample != None:
self.samplesreceived += 1
self.put(self.start_sample, self.samplenum, self.out_proto,
self.put(self.start_sample, self.samplenum, self.out_ann,
self.put(self.start_sample, self.samplenum, self.out_ann,
- [ANN_HEX, ['%s: 0x%08x' % ('L' if self.oldws else 'R',
- self.data)]])
+ [ANN_HEX, ['%s: 0x%08x' % ('L' if self.oldws else 'R',
+ self.data)]])
- # Check that the data word was the correct length
+ # Check that the data word was the correct length.
if self.wordlength != -1 and self.wordlength != self.bitcount:
self.put(self.start_sample, self.samplenum, self.out_ann,
[ANN_HEX, ['WARNING: Received a %d-bit word, when a '
if self.wordlength != -1 and self.wordlength != self.bitcount:
self.put(self.start_sample, self.samplenum, self.out_ann,
[ANN_HEX, ['WARNING: Received a %d-bit word, when a '
self.bitcount = 0
self.start_sample = self.samplenum
self.bitcount = 0
self.start_sample = self.samplenum
- # Save the first sample position
+ # Save the first sample position.
if self.first_sample == None:
self.first_sample = self.samplenum
self.oldws = ws
if self.first_sample == None:
self.first_sample = self.samplenum
self.oldws = ws
-
\ No newline at end of file
]
options = {}
annotations = [
]
options = {}
annotations = [
- ['ASCII', 'TODO: description'],
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
import sigrokdecode as srd
import sigrokdecode as srd
-# Annotation feed formats
-ANN_ASCII = 0
-
# ...
fields = {
# START field (indicates start or stop of a transaction)
# ...
fields = {
# START field (indicates start or stop of a transaction)
]
options = {}
annotations = [
]
options = {}
annotations = [
- ['ASCII', 'TODO: description'],
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
]
options = {} # TODO
annotations = [
]
options = {} # TODO
annotations = [
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
pass
def putx(self, data):
pass
def putx(self, data):
- # Simplification, most annotations span extactly one SPI byte/packet.
+ # Simplification, most annotations span exactly one SPI byte/packet.
self.put(self.ss, self.es, self.out_ann, data)
def handle_wren(self, mosi, miso):
self.put(self.ss, self.es, self.out_ann, data)
def handle_wren(self, mosi, miso):
]
options = {}
annotations = [
]
options = {}
annotations = [
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
optional_probes = [] # TODO
options = {}
annotations = [
optional_probes = [] # TODO
options = {}
annotations = [
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
import sigrokdecode as srd
import sigrokdecode as srd
-# Annotation feed formats
-ANN_ASCII = 0
-
optional_probes = []
options = {}
annotations = [
optional_probes = []
options = {}
annotations = [
- ['ASCII', 'TODO: description'],
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
]
options = {}
annotations = [
]
options = {}
annotations = [
+ ['Text', 'Human-readable text'],
]
def __init__(self, **kwargs):
]
def __init__(self, **kwargs):
optional_probes = []
options = {}
annotations = [
optional_probes = []
options = {}
annotations = [
+ ['Text', 'Human-readable text']