diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2012-05-16 22:48:47 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2012-05-17 00:07:27 +0200 |
commit | 3e3c03309ee21d839f85e981d361ca77b08d5ba0 (patch) | |
tree | 63dbbb3ac20d9e120a9b4dec1c03aa3e9f14bf29 /decoders/spi/__init__.py | |
parent | bdd820e3c0c2681b171fc7cc0198244f40a64b34 (diff) | |
download | libsigrokdecode-3e3c03309ee21d839f85e981d361ca77b08d5ba0.tar.gz libsigrokdecode-3e3c03309ee21d839f85e981d361ca77b08d5ba0.zip |
srd: spi: Document output protocol, send CS# changes.
As per guidelines in HACKING, the protocol "commands"/items should be ALLCAPS,
thus change 'data' to 'DATA'. Also, fix MX25Lxx05D protocol decoder
accordingly, currently the only one we have which stacks on top of SPI.
Add a new 'CS-CHANGE' output protocol item, which is sent upon every
change of the CS# pin value (either 0->1, or vice versa). This is needed
by various higher-level PDs.
Diffstat (limited to 'decoders/spi/__init__.py')
-rw-r--r-- | decoders/spi/__init__.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/decoders/spi/__init__.py b/decoders/spi/__init__.py index c1b5889..8734acf 100644 --- a/decoders/spi/__init__.py +++ b/decoders/spi/__init__.py @@ -23,6 +23,24 @@ Serial Peripheral Interface protocol decoder. Details: TODO + +Protocol output format: + +SPI packet: +[<cmd>, <data1>, <data2>] + +Commands: + - 'DATA': <data1> contains the MISO data, <data2> contains the MOSI data. + The data is _usually_ 8 bits (but can also be fewer or more bits). + Both data items are Python numbers, not strings. + - 'CS CHANGE': <data1> is the old CS# pin value, <data2> is the new value. + Both data items are Python numbers (0/1), not strings. + +Example: + ['CS-CHANGE', 1, 0] + ['DATA', 0xff, 0x3a] + ['DATA', 0x65, 0x00] + ['CS-CHANGE', 0, 1] ''' from .spi import * |