# and a display device. The stream is output as plain bytes.
#
-import sigrokdecode
+import sigrokdecode as srd
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'ddc'
name = 'DDC'
longname = 'Display Data Channel'
self.state = None
def start(self, metadata):
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'ddc')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'ddc')
def decode(self, start_sample, end_sample, i2c_data):
try:
#
#
-import sigrokdecode
+import sigrokdecode as srd
# annotation feed formats
ANN_SHIFTED = 0
FIND_DATA = 2
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'i2c'
name = 'I2C'
longname = 'Inter-Integrated Circuit (I2C) bus'
self.oldsda = None
def start(self, metadata):
- self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'i2c')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'i2c')
+ self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'i2c')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'i2c')
def report(self):
pass
# http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf
#
-import sigrokdecode
+import sigrokdecode as srd
# States
IDLE = -1
{'type': 'D', 'range': (10, 11), 'data': 0xff, 'ann': ''},
]
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'mx25lxx05d'
name = 'Macronix MX25Lxx05D'
longname = 'Macronix MX25Lxx05D SPI flash chip decoder'
self.out = []
def start(self, metadata):
- # self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'mx25lxx05d')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'mx25lxx05d')
+ # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'mx25lxx05d')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'mx25lxx05d')
def report(self):
pass
# https://www.sparkfun.com/products/9281
#
-import sigrokdecode
+import sigrokdecode as srd
# States
IDLE = 0
{'type': 'P', 'range': (32, 33), 'data': None, 'ann': ''},
]
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'nunchuk'
name = 'Nunchuk'
longname = 'Nintendo Wii Nunchuk decoder'
self.databytecount = 0
def start(self, metadata):
- # self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'nunchuk')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'nunchuk')
+ # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'nunchuk')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'nunchuk')
def report(self):
pass
# TODO
#
-import sigrokdecode
+import sigrokdecode as srd
# Annotation feed formats
ANN_ASCII = 0
# UART 'data' packet type.
T_DATA = 1
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'pan1321'
name = 'Panasonic PAN1321'
longname = 'TODO.'
self.cmd = ''
def start(self, metadata):
- # self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'pan1321')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'pan1321')
+ # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'pan1321')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'pan1321')
def report(self):
pass
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-import sigrokdecode
+import sigrokdecode as srd
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'spi'
name = 'SPI'
desc = '...desc...'
self.out_ann = None
def start(self, metadata):
- # self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'spi')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'spi')
+ # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'spi')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'spi')
def report(self):
return 'SPI: %d bytes received' % self.bytesreceived
# http://www.usb.org/developers/docs/
#
-import sigrokdecode
+import sigrokdecode as srd
# States
SE0, J, K, SE1 = 0, 1, 2, 3
return pid + ' ' + data
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'usb'
name = 'USB'
desc = 'Universal Serial Bus'
def start(self, metadata):
self.rate = metadata['samplerate']
- # self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'usb')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'usb')
+ # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'usb')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'usb')
if self.rate < 48000000:
raise Exception("Sample rate not sufficient for USB decoding")
# Initialise decoder state.
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-import sigrokdecode
+import sigrokdecode as srd
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'transitioncounter'
name = 'Transition counter'
longname = '...'
self.lastsample = None
def start(self, metadata):
- # self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'transitioncounter')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'transitioncounter')
+ # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'transitioncounter')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'transitioncounter')
def report(self):
pass
# [T_PARITY_ERROR, (0, 1)]
#
-import sigrokdecode
+import sigrokdecode as srd
# States
WAIT_FOR_START_BIT = 0
else:
raise Exception('Invalid parity type: %d' % parity_type)
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'uart'
name = 'UART'
longname = 'Universal Asynchronous Receiver/Transmitter (UART)'
def start(self, metadata):
self.samplerate = metadata['samplerate']
- self.out_proto = self.add(sigrokdecode.SRD_OUTPUT_PROTO, 'uart')
- self.out_ann = self.add(sigrokdecode.SRD_OUTPUT_ANN, 'uart')
+ self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'uart')
+ self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'uart')
# TODO
### self.baudrate = metadata['baudrate']