##
'''
-AVR ISP protocol decoder.
-
-TODO: Description.
-
-TODO: SPI is MSB-first.
-
-Details:
-TODO
+This decoder stacks on top of the 'spi' PD and decodes the In-System
+Programming (ISP) protocol of some Atmel AVR 8-bit microcontrollers.
'''
from .pd import *
##
'''
-CAN protocol decoder.
-
-TODO: Description.
-
-Details:
-TODO
-
-Protocol output format:
-
-TODO.
+CAN (Controller Area Network) is a field bus protocol for distributed
+real-time control.
+This decoder assumes that a single CAN_RX line is sampled (e.g. on
+the digital output side of a CAN transceiver IC such as the Microchip
+MCP-2515DM-BM).
'''
from .pd import *
##
'''
-TODO.
+This PD decodes the DCF77 protocol (a European long-wave time signal that
+uses a 77.5kHz carrier frequency).
Details:
http://en.wikipedia.org/wiki/DCF77
##
'''
-Dallas DS1307 RTC protocol decoder.
-
-Details:
-TODO
+This decoder stacks on top of the 'i2c' PD and decodes the Dallas DS1307
+real-time clock (RTC) specific registers and commands.
'''
from .pd import *
##
'''
-I²C protocol decoder.
-
-The Inter-Integrated Circuit (I²C) bus is a bidirectional, multi-master
+I²C (Inter-Integrated Circuit) is a bidirectional, multi-master
bus using two signals (SCL = serial clock line, SDA = serial data line).
'''
##
'''
-Generic I²C demultiplexing protocol decoder.
+This is a generic I²C demultiplexing protocol decoder.
-Takes an I²C stream as input and outputs multiple I²C streams, each stream
-containing only I²C packets for one specific I²C slave.
+It takes an I²C stream as input and outputs multiple I²C streams, each
+stream containing only I²C packets for one specific I²C slave.
'''
from .pd import *
##
'''
-Generic I²C filtering protocol decoder.
+This is a generic I²C filtering protocol decoder.
-Takes input from the I²C protocol decoder and removes all traffic
+It takes input from the I²C protocol decoder and removes all traffic
except that from/to the specified slave address and/or direction.
It then outputs the filtered data again as OUTPUT_PROTO of type/format 'i2c'
##
'''
-I²S protocol decoder.
+I²S (Integrated Interchip Sound) is a serial bus for connecting digital
+audio devices (usually on the same device/board).
-Documentation:
+Details:
http://www.nxp.com/acrobat_download/various/I2SBUS.pdf
http://en.wikipedia.org/wiki/I2s
'''
##
'''
-JTAG protocol decoder.
-
JTAG (Joint Test Action Group), a.k.a. "IEEE 1149.1: Standard Test Access Port
and Boundary-Scan Architecture", is a protocol used for testing, debugging,
and flashing various digital ICs.
-TODO: Protocol details.
-
-Protocol output format (WORK IN PROGRESS!):
-
-JTAG packet:
-[<packet-type>, <data>]
-
-<packet-type> is one of:
- - 'NEW STATE': <data> is the new state of the JTAG state machine.
- Valid values: 'TEST-LOGIC-RESET', 'RUN-TEST/IDLE', 'SELECT-DR-SCAN',
- 'CAPTURE-DR', 'SHIFT-DR', 'EXIT1-DR', 'PAUSE-DR', 'EXIT2-DR', 'UPDATE-DR',
- 'SELECT-IR-SCAN', 'CAPTURE-IR', 'SHIFT-IR', 'EXIT1-IR', 'PAUSE-IR',
- 'EXIT2-IR', 'UPDATE-IR'.
- - 'IR TDI': Bitstring that was clocked into the IR register.
- - 'IR TDO': Bitstring that was clocked out of the IR register.
- - 'DR TDI': Bitstring that was clocked into the DR register.
- - 'DR TDO': Bitstring that was clocked out of the DR register.
- - ...
-
-All bitstrings are a sequence of '1' and '0' characters. The right-most
-character in the bitstring is the LSB. Example: '01110001' (1 is LSB).
-
Details:
https://en.wikipedia.org/wiki/Joint_Test_Action_Group
http://focus.ti.com/lit/an/ssya002c/ssya002c.pdf
import sigrokdecode as srd
+'''
+Protocol output format:
+
+JTAG packet:
+[<packet-type>, <data>]
+
+<packet-type> is one of:
+ - 'NEW STATE': <data> is the new state of the JTAG state machine.
+ Valid values: 'TEST-LOGIC-RESET', 'RUN-TEST/IDLE', 'SELECT-DR-SCAN',
+ 'CAPTURE-DR', 'SHIFT-DR', 'EXIT1-DR', 'PAUSE-DR', 'EXIT2-DR', 'UPDATE-DR',
+ 'SELECT-IR-SCAN', 'CAPTURE-IR', 'SHIFT-IR', 'EXIT1-IR', 'PAUSE-IR',
+ 'EXIT2-IR', 'UPDATE-IR'.
+ - 'IR TDI': Bitstring that was clocked into the IR register.
+ - 'IR TDO': Bitstring that was clocked out of the IR register.
+ - 'DR TDI': Bitstring that was clocked into the DR register.
+ - 'DR TDO': Bitstring that was clocked out of the DR register.
+ - ...
+
+All bitstrings are a sequence of '1' and '0' characters. The right-most
+character in the bitstring is the LSB. Example: '01110001' (1 is LSB).
+'''
+
jtag_states = [
# Intro "tree"
'TEST-LOGIC-RESET', 'RUN-TEST/IDLE',
##
'''
-ST STM32 JTAG protocol decoder.
-
-TODO.
+This decoder stacks on top of the 'jtag' PD and decodes JTAG data specific to
+the STM32 microcontroller series.
Details:
https://en.wikipedia.org/wiki/STM32
##
'''
-National LM75 (and compatibles) temperature sensor protocol decoder.
-
-TODO: Description.
-
-Protocol output format:
-TODO.
-
-Details:
-TODO.
+This decoder stacks on top of the 'i2c' PD and decodes the National LM75
+(and compatibles) temperature sensor protocol.
'''
from .pd import *
##
'''
-Low-Pin Count protocol decoder.
+LPC (Low-Pin Count) is a protocol for low-bandwidth devices used on
+some PC mainboards, such as the "BIOS chip" or the so-called "Super I/O".
'''
from .pd import *
##
'''
-Maxim DS28EA00 protocol decoder.
-
-The Maxim DS28EA00 is a 1-Wire digital thermometer with Sequence Detect
-and PIO functionality.
-
-Details:
-TODO
+This decoder stacks on top of the 'onewire_network' PD and decodes the
+Maxim DS28EA00 1-Wire digital thermometer protocol.
'''
from .pd import *
##
'''
-MIDI protocol decoder.
+This decoder stacks on top of the 'uart' PD and decodes the MIDI
+(Musical Instrument Digital Interface) protocol.
-The MIDI protocol is layered on top of the UART (async serial) protocol,
-with a fixed baud rate of 31250 baud (+/- 1%) and 8n1 settings. Bytes are
-sent LSB-first.
+MIDI is layered on top of the UART (async serial) protocol, with a fixed
+baud rate of 31250 baud (+/- 1%) and 8n1 settings. Bytes are sent LSB-first.
'''
from .pd import *
##
'''
-Melexis MLX90614 protocol decoder.
-
-Details:
-TODO
+This decoder stacks on top of the 'i2c' PD and decodes the Melexis MLX90614
+infrared thermometer protocol.
'''
from .pd import *
##
'''
-Macronix MX25Lxx05D SPI (NOR) flash chip protocol decoder.
+This decoder stacks on top of the 'spi' PD and decodes the Macronix
+MX25Lxx05D SPI (NOR) flash chip protocol.
-Works for MX25L1605D/MX25L3205D/MX25L6405D.
-
-TODO: Description.
+It works for the MX25L1605D/MX25L3205D/MX25L6405D.
Details:
http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf
##
'''
-MEMSIC MXC6225XU protocol decoder.
-
-The MEMSIC MXC6225XU is a Digital Thermal Orientation Sensor (DTOS).
+This decoder stacks on top of the 'i2c' PD and decodes the MEMSIC MXC6225XU
+digital thermal orientation sensor (DTOS) protocol.
The chip's I²C interface supports standard mode and fast mode (max. 400kHz).
Its I²C slave address is 0x2a.
-
-Details:
-TODO
'''
from .pd import *
##
'''
-Nintendo Wii Nunchuk protocol decoder.
-
-TODO: Description.
+This decoder stacks on top of the 'i2c' PD and decodes the Nintendo Wii
+Nunchuk controller protocol.
Details:
http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck
##
'''
-1-Wire protocol decoder (link layer).
+This protocol decoder handles the 1-Wire link layer.
The 1-Wire protocol enables bidirectional communication over a single wire
(and ground) between a single master and one or multiple slaves. The protocol
- Network layer (skip/search/match device ROM addresses)
- Transport layer (transport data between 1-Wire master and device)
-This protocol decoder handles the 1-Wire link layer.
-
Sample rate:
A sufficiently high samplerate is required to properly detect all the elements
of the protocol. A lower samplerate can be used if the master does not use
##
'''
-1-Wire protocol decoder (network layer).
+This decoder stacks on top of the 'onewire_link' PD and decodes the
+1-Wire protocol (network layer).
The 1-Wire protocol enables bidirectional communication over a single wire
(and ground) between a single master and one or multiple slaves. The protocol
Network layer:
-Protocol output format:
-TODO.
-
-Annotations:
-
The following link layer annotations are shown:
- RESET/PRESENCE True/False
##
'''
-Panasonic PAN1321 protocol decoder.
-
-Details:
-TODO
+This decoder stacks on top of the 'uart' PD and decodes the Panasonic PAN1321
+Bluetooth module Serial Port Profile (SPP) protocol.
'''
from .pd import *
##
'''
-Epson RTC-8564 JE/NB protocol decoder.
-
-Details:
-TODO
+This decoder stacks on top of the 'i2c' PD and decodes the Epson
+RTC-8564 JE/NB real-time clock (RTC) protocol.
'''
from .pd import *
##
'''
-SD card (SPI mode) low-level protocol decoder.
-
-TODO: Description.
+This decoder stacks on top of the 'spi' PD and decodes the SD card
+(SPI mode) low-level protocol.
Most SD cards can be accessed via two different protocols/modes: SD mode
or SPI mode.
* In SPI mode cards cannot guarantee their speed class (the host should
assume class 0, no matter what the card indicates).
* The RCA register is not accessible in SPI mode.
-
-Details:
-TODO
'''
from .pd import *
##
'''
-Serial Peripheral Interface protocol decoder.
-
-This protocol decoder supports synchronous SPI(-like) protocols with a
-clock line, a MISO and MOSI line for data transfer in two directions,
-and an optional CS# pin.
+The SPI (Serial Peripheral Interface) protocol decoder supports synchronous
+SPI(-like) protocols with a clock line, a MISO and MOSI line for data
+transfer in two directions, and an optional CS# pin.
If CS# is supplied, data is only decoded when CS# is asserted (clock
transitions where CS# is not asserted are ignored). If CS# is not supplied,
##
'''
-Texas Instruments TLC5620 protocol decoder.
+The Texas Instruments TLC5620 is an 8-bit quad DAC.
'''
from .pd import *
##
'''
-UART protocol decoder.
-
-Universal Asynchronous Receiver Transmitter (UART) is a simple serial
+UART (Universal Asynchronous Receiver Transmitter) is a simple serial
communication protocol which allows two devices to talk to each other.
This decoder should work on all "UART-like" async protocols with one
-start bit (0), 7-9 databits, an (optional) parity bit, and one or more
+start bit (0), 5-9 databits, an (optional) parity bit, and one or more
stop bits (1), in this order.
It can be run on one signal line (RX or TX) only, or on two lines (RX + TX).
##
'''
-USB (low-speed and full-speed) packet protocol decoder.
+This decoder stacks on top of the 'usb_signalling' PD and decodes the USB
+(low-speed and full-speed) packet protocol.
Protocol layer (USB spec, chapter 8):
consists of a 4-bit packet type field, and a 4 bit check field.
The check field is the one's complement of the packet type field.
-Protocol output format:
-TODO
-
Details:
https://en.wikipedia.org/wiki/USB
http://www.usb.org/developers/docs/
##
'''
-USB (low-speed and full-speed) signalling protocol decoder.
+This PD decodes the USB (low-speed and full-speed) signalling protocol.
Electrical/signalling layer (USB spec, chapter 7):
The SE0 transmitted to signal an end-of-packet is two bit intervals long
(low-speed: 1.25uS - 1.50uS, full-speed: 160ns - 175ns).
-Protocol output format:
-TODO
-
Details:
https://en.wikipedia.org/wiki/USB
http://www.usb.org/developers/docs/
##
'''
-XFP I²C management interface structure decoder.
+This PD decodes the XFP I²C management interface structures/protocol.
XFP modules include an I²C interface, used to monitor and control various
aspects of the module. The specification defines an I²C slave at address