## 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...'
longname = 'Serial Peripheral Interface (SPI) bus'
+ desc = '...desc...'
longdesc = '...longdesc...'
author = 'Gareth McMullin'
email = 'gareth@blacksphere.co.nz'
{'id': 'sck', 'name': 'CLK', 'desc': 'SPI clock line'},
]
options = {}
+ annotations = []
def __init__(self):
self.oldsck = 1
self.rxcount = 0
self.rxdata = 0
self.bytesreceived = 0
- self.output_protocol = None
- self.output_annotation = None
def start(self, metadata):
- # self.output_protocol = self.output_new(2)
- self.output_annotation = self.output_new(1)
+ # self.out_proto = self.add(srd.OUTPUT_PROTO, 'spi')
+ self.out_ann = self.add(srd.OUTPUT_ANN, 'spi')
def report(self):
return 'SPI: %d bytes received' % self.bytesreceived
'display':('%02X' % self.rxdata),
'type':'spi',
}
- # self.put(0, 0, self.output_protocol, out_proto)
- self.put(0, 0, self.output_annotation, outdata)
+ # self.put(0, 0, self.out_proto, out_proto)
+ self.put(0, 0, self.out_ann, outdata)
# Reset decoder state
self.rxdata = 0
self.rxcount = 0