summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2016-10-24 00:36:45 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2016-11-06 15:44:29 +0100
commite33410d3f96db7bb6a2ed0e2540e0df17bf561b5 (patch)
tree5f4b881190a0b3361888001b2268b5098353619e /decoders
parent37a2cca99bd06c760f201dc5c8c033cd4b8a40a1 (diff)
downloadlibsigrokdecode-e33410d3f96db7bb6a2ed0e2540e0df17bf561b5.tar.gz
libsigrokdecode-e33410d3f96db7bb6a2ed0e2540e0df17bf561b5.zip
spiflash: Implement Release Power-down / Device ID (0xAB) command.
This fixes bug #845.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/spiflash/pd.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/decoders/spiflash/pd.py b/decoders/spiflash/pd.py
index 10c3919..3d40ceb 100644
--- a/decoders/spiflash/pd.py
+++ b/decoders/spiflash/pd.py
@@ -302,7 +302,20 @@ class Decoder(srd.Decoder):
pass # TODO
def handle_rdp_res(self, mosi, miso):
- pass # TODO
+ if self.cmdstate == 1:
+ # Byte 1: Master sends command ID.
+ self.ss_block = self.ss
+ self.putx([16, ['Command: %s' % cmds[self.state][1]]])
+ elif self.cmdstate in (2, 3, 4):
+ # Bytes 2/3/4: Master sends three dummy bytes.
+ self.putx([24, ['Dummy byte: %02x' % mosi]])
+ elif self.cmdstate == 5:
+ # Byte 5: Slave sends device ID.
+ self.ids = [miso]
+ self.putx([24, ['Device: Macronix %s' % device_name[self.ids[0]]]])
+ self.state = None
+
+ self.cmdstate += 1
def handle_rems(self, mosi, miso):
if self.cmdstate == 1: