- # Probe names with a set of defaults
- probes = {'sdata':0, 'sck':1}
- options = {}
-
- def __init__(self, unitsize, **kwargs):
- # Metadata comes in here, we don't care for now
- #print kwargs
- self.unitsize = unitsize
-
- self.probes = Decoder.probes
- self.oldsck = True
- self.rxcount = 0
- self.rxdata = 0
+ probes = [
+ {'id': 'mosi', 'name': 'MOSI',
+ 'desc': 'SPI MOSI line (Master out, slave in)'},
+ {'id': 'miso', 'name': 'MISO',
+ 'desc': 'SPI MISO line (Master in, slave out)'},
+ {'id': 'sck', 'name': 'CLK', 'desc': 'SPI clock line'},
+ {'id': 'cs', 'name': 'CS#', 'desc': 'SPI CS (chip select) line'},
+ ]
+ options = {
+ 'cs_active_low': ['CS# active low', ACTIVE_LOW],
+ 'clock_polarity': ['Clock polarity', CPOL_0],
+ 'clock_phase': ['Clock phase', CPHA_0],
+ 'bit_order': ['Bit order within the SPI data', MSB_FIRST],
+ 'word_size': ['Word size of SPI data', 8], # 1-64?
+ }
+ annotations = [
+ ['Hex', 'SPI data bytes in hex format'],
+ ]
+
+ def __init__(self):
+ self.oldsck = 1
+ self.bitcount = 0
+ self.mosidata = 0
+ self.misodata = 0