- probes = [] # TODO: HOLD#, WP#/ACC
+ probes = []
+ extra_probes = [
+ {'id': 'hold', 'name': 'HOLD#', 'desc': 'TODO.'},
+ {'id': 'wp_acc', 'name': 'WP#/ACC', 'desc': 'TODO.'},
+ ]
# Simplification, most annotations span extactly one SPI byte/packet.
self.put(self.ss, self.es, self.out_ann, data)
def handle_wren(self, mosi, miso):
# Simplification, most annotations span extactly one SPI byte/packet.
self.put(self.ss, self.es, self.out_ann, data)
def handle_wren(self, mosi, miso):
elif self.cmdstate in (2, 3, 4):
# Bytes 2/3/4: Master sends address of the sector to erase.
# Note: Assumes SPI data is 8 bits wide (it is for MX25Lxx05D).
# TODO: LSB-first of MSB-first?
self.addr <<= 8
self.addr |= mosi
elif self.cmdstate in (2, 3, 4):
# Bytes 2/3/4: Master sends address of the sector to erase.
# Note: Assumes SPI data is 8 bits wide (it is for MX25Lxx05D).
# TODO: LSB-first of MSB-first?
self.addr <<= 8
self.addr |= mosi
elif self.cmdstate in (2, 3):
# Bytes 2/3: Master sends two dummy bytes.
# TODO: Check dummy bytes? Check reply from device?
elif self.cmdstate in (2, 3):
# Bytes 2/3: Master sends two dummy bytes.
# TODO: Check dummy bytes? Check reply from device?
elif self.cmdstate == 4:
# Byte 4: Master sends 0x00 or 0x01.
# 0x00: Master wants manufacturer ID as first reply byte.
# 0x01: Master wants device ID as first reply byte.
self.manufacturer_id_first = True if (mosi == 0x00) else False
d = 'manufacturer' if (mosi == 0x00) else 'device'
elif self.cmdstate == 4:
# Byte 4: Master sends 0x00 or 0x01.
# 0x00: Master wants manufacturer ID as first reply byte.
# 0x01: Master wants device ID as first reply byte.
self.manufacturer_id_first = True if (mosi == 0x00) else False
d = 'manufacturer' if (mosi == 0x00) else 'device'
elif self.cmdstate == 5:
# Byte 5: Slave sends manufacturer ID (or device ID).
self.ids = [miso]
d = 'Manufacturer' if self.manufacturer_id_first else 'Device'
elif self.cmdstate == 5:
# Byte 5: Slave sends manufacturer ID (or device ID).
self.ids = [miso]
d = 'Manufacturer' if self.manufacturer_id_first else 'Device'
elif self.cmdstate == 6:
# Byte 6: Slave sends device ID (or manufacturer ID).
self.ids += [miso]
d = 'Manufacturer' if self.manufacturer_id_first else 'Device'
elif self.cmdstate == 6:
# Byte 6: Slave sends device ID (or manufacturer ID).
self.ids += [miso]
d = 'Manufacturer' if self.manufacturer_id_first else 'Device'
self.state = IDLE
def decode(self, ss, es, data):
self.state = IDLE
def decode(self, ss, es, data):