## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+TODO.
+
+Details:
+http://en.wikipedia.org/wiki/DCF77
+'''
+
from .dcf77 import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# DCF77 protocol decoder
-#
-# More information:
-# http://en.wikipedia.org/wiki/DCF77
-#
-
-#
-# Protocol output format:
-# TODO
-#
import sigrokdecode as srd
import calendar
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+TrekStor EBR30-a I2C demux protocol decoder.
+
+Takes an I2C stream as input and outputs 3 different I2C streams, for the
+3 different I2C devices on the TrekStor EBR30-a eBook reader (which are all
+physically connected to the same SCL/SDA lines).
+
+I2C slave addresses:
+
+ - AXP199 battery management chip: 0x69/0x68 (8bit R/W), 0x34 (7bit)
+ - H8563S RTC chip: 0xa3/0xa2 (8bit R/W), 0x51 (7bit)
+ - Unknown accelerometer chip: 0x2b/0x2a (8bit R/W), 0x15 (7bit)
+'''
+
from .ebr30a_i2c_demux import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# TrekStor EBR30-a I2C demux protocol decoder
-#
-# Takes an I2C stream as input and outputs 3 different I2C streams, for the
-# 3 different I2C devices on the TrekStor EBR30-a eBook reader (which are all
-# physically connected to the same SCL/SDA lines).
-#
-# I2C slave addresses:
-#
-# - AXP199 battery management chip: 0x69/0x68 (8bit R/W), 0x34 (7bit)
-# - H8563S RTC chip: 0xa3/0xa2 (8bit R/W), 0x51 (7bit)
-# - Unknown accelerometer chip: 0x2b/0x2a (8bit R/W), 0x15 (7bit)
-#
import sigrokdecode as srd
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##
+# EDID protocol decoder
+
# TODO:
# - EDID < 1.3
# - add short annotations
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+I2C protocol decoder.
+
+The Inter-Integrated Circuit (I2C) bus is a bidirectional, multi-master
+bus using two signals (SCL = serial clock line, SDA = serial data line).
+
+There can be many devices on the same bus. Each device can potentially be
+master or slave (and that can change during runtime). Both slave and master
+can potentially play the transmitter or receiver role (this can also
+change at runtime).
+
+Possible maximum data rates:
+ - Standard mode: 100 kbit/s
+ - Fast mode: 400 kbit/s
+ - Fast-mode Plus: 1 Mbit/s
+ - High-speed mode: 3.4 Mbit/s
+
+START condition (S): SDA = falling, SCL = high
+Repeated START condition (Sr): same as S
+Data bit sampling: SCL = rising
+STOP condition (P): SDA = rising, SCL = high
+
+All data bytes on SDA are exactly 8 bits long (transmitted MSB-first).
+Each byte has to be followed by a 9th ACK/NACK bit. If that bit is low,
+that indicates an ACK, if it's high that indicates a NACK.
+
+After the first START condition, a master sends the device address of the
+slave it wants to talk to. Slave addresses are 7 bits long (MSB-first).
+After those 7 bits, a data direction bit is sent. If the bit is low that
+indicates a WRITE operation, if it's high that indicates a READ operation.
+
+Later an optional 10bit slave addressing scheme was added.
+
+Documentation:
+http://www.nxp.com/acrobat/literature/9398/39340011.pdf (v2.1 spec)
+http://www.nxp.com/acrobat/usermanuals/UM10204_3.pdf (v3 spec)
+http://en.wikipedia.org/wiki/I2C
+
+Protocol output format:
+
+I2C packet:
+[<i2c_command>, <data>, <ack_bit>]
+
+<i2c_command> is one of:
+ - 'START' (START condition)
+ - 'START REPEAT' (Repeated START)
+ - 'ADDRESS READ' (Address, read)
+ - 'ADDRESS WRITE' (Address, write)
+ - 'DATA READ' (Data, read)
+ - 'DATA WRITE' (Data, write)
+ - 'STOP' (STOP condition)
+
+<data> is the data or address byte associated with the 'ADDRESS*' and 'DATA*'
+command. For 'START', 'START REPEAT' and 'STOP', this is None.
+
+<ack_bit> is either 'ACK' or 'NACK', but may also be None.
+'''
+
from .i2c import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# I2C protocol decoder
-#
-
-#
-# The Inter-Integrated Circuit (I2C) bus is a bidirectional, multi-master
-# bus using two signals (SCL = serial clock line, SDA = serial data line).
-#
-# There can be many devices on the same bus. Each device can potentially be
-# master or slave (and that can change during runtime). Both slave and master
-# can potentially play the transmitter or receiver role (this can also
-# change at runtime).
-#
-# Possible maximum data rates:
-# - Standard mode: 100 kbit/s
-# - Fast mode: 400 kbit/s
-# - Fast-mode Plus: 1 Mbit/s
-# - High-speed mode: 3.4 Mbit/s
-#
-# START condition (S): SDA = falling, SCL = high
-# Repeated START condition (Sr): same as S
-# Data bit sampling: SCL = rising
-# STOP condition (P): SDA = rising, SCL = high
-#
-# All data bytes on SDA are exactly 8 bits long (transmitted MSB-first).
-# Each byte has to be followed by a 9th ACK/NACK bit. If that bit is low,
-# that indicates an ACK, if it's high that indicates a NACK.
-#
-# After the first START condition, a master sends the device address of the
-# slave it wants to talk to. Slave addresses are 7 bits long (MSB-first).
-# After those 7 bits, a data direction bit is sent. If the bit is low that
-# indicates a WRITE operation, if it's high that indicates a READ operation.
-#
-# Later an optional 10bit slave addressing scheme was added.
-#
-# Documentation:
-# http://www.nxp.com/acrobat/literature/9398/39340011.pdf (v2.1 spec)
-# http://www.nxp.com/acrobat/usermanuals/UM10204_3.pdf (v3 spec)
-# http://en.wikipedia.org/wiki/I2C
-#
# TODO: Look into arbitration, collision detection, clock synchronisation, etc.
# TODO: Handle clock stretching.
# TODO: Handle multiple different I2C devices on same bus
# -> we need to decode multiple protocols at the same time.
-'''
-Protocol output format:
-
-I2C packet:
-[<i2c_command>, <data>, <ack_bit>]
-
-<i2c_command> is one of:
- - 'START' (START condition)
- - 'START REPEAT' (Repeated START)
- - 'ADDRESS READ' (Address, read)
- - 'ADDRESS WRITE' (Address, write)
- - 'DATA READ' (Data, read)
- - 'DATA WRITE' (Data, write)
- - 'STOP' (STOP condition)
-
-<data> is the data or address byte associated with the 'ADDRESS*' and 'DATA*'
-command. For 'START', 'START REPEAT' and 'STOP', this is None.
-
-<ack_bit> is either 'ACK' or 'NACK', but may also be None.
-'''
-
import sigrokdecode as srd
# Annotation feed formats
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+Generic I2C demultiplexing protocol decoder.
+
+Takes an I2C stream as input and outputs multiple I2C streams, each stream
+containing only I2C packets for one specific I2C slave.
+'''
+
from .i2cdemux import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# Generic I2C demultiplexing protocol decoder
-#
-# Takes an I2C stream as input and outputs multiple I2C streams, each stream
-# containing only I2C packets for one specific I2C slave.
-#
import sigrokdecode as srd
##
'''
+Generic I2C filtering protocol decoder.
+
Takes input from the I2C protocol decoder and filters out traffic from/to
a single address on the I2C bus.
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##
-import sigrokdecode as srd
+# Generic I2C filtering protocol decoder
+import sigrokdecode as srd
class Decoder(srd.Decoder):
api_version = 1
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# Melexis MLX90614 Infrared Thermometer protocol decoder
-#
import sigrokdecode as srd
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+Macronix MX25Lxx05D SPI (NOR) flash chip decoder.
+
+Works for MX25L1605D/MX25L3205D/MX25L6405D.
+
+TODO: Description.
+
+Details:
+http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf
+'''
+
from .mx25lxx05d import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
-# Macronix MX25Lxx05D SPI (NOR) flash chip decoder.
-# Works for MX25L1605D/MX25L3205D/MX25L6405D.
-#
+# Macronix MX25Lxx05D SPI (NOR) flash chip protocol decoder
-#
-# TODO: Description
-#
-# Details:
-# http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf
-#
+# Note: Works for MX25L1605D/MX25L3205D/MX25L6405D.
import sigrokdecode as srd
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+Nintendo Wii Nunchuk decoder.
+
+TODO: Description.
+
+Details:
+http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck
+http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/
+https://www.sparkfun.com/products/9281
+'''
+
from .nunchuk import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
-# Nintendo Wii Nunchuk decoder
-#
-
-#
-# TODO: Description
-#
-# http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck
-# http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/
-# https://www.sparkfun.com/products/9281
-#
+# Nintendo Wii Nunchuk protocol decoder
import sigrokdecode as srd
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# Panasonic PAN1321 Bluetooth module protocol decoder
-#
-# TODO
-#
import sigrokdecode as srd
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
-# Epson RTC-8564 JE/NB decoder
-#
+# Epson RTC-8564 JE/NB protocol decoder
import sigrokdecode as srd
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+# SPI protocol decoder
+
import sigrokdecode as srd
# Key: (CPOL, CPHA). Value: SPI mode.
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+# Transition counter protocol decoder
+
import sigrokdecode as srd
class Decoder(srd.Decoder):
##
'''
+UART protocol decoder.
+
Universal Asynchronous Receiver Transmitter (UART) is a simple serial
communication protocol which allows two devices to talk to each other.
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
# UART protocol decoder
-#
import sigrokdecode as srd
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+'''
+USB (full-speed) protocol decoder.
+
+Full-speed USB signalling consists of two signal lines, both driven at 3.3V
+logic levels. The signals are DP (D+) and DM (D-), and normally operate in
+differential mode.
+The state where DP=1,DM=0 is J, the state DP=0,DM=1 is K.
+A state SE0 is defined where DP=DM=0. This common mode signal is used to
+signal a reset or end of packet.
+
+Data transmitted on the USB is encoded with NRZI. A transition from J to K
+or vice-versa indicates a logic 0, while no transition indicates a logic 1.
+If 6 ones are transmitted consecutively, a zero is inserted to force a
+transition. This is known as bit stuffing. Data is transferred at a rate
+of 12Mbit/s. The SE0 transmitted to signal an end-of-packet is two bit
+intervals long.
+
+Details:
+https://en.wikipedia.org/wiki/USB
+http://www.usb.org/developers/docs/
+'''
+
from .usb import *
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-#
-# USB Full-speed protocol decoder
-#
-# Full-speed USB signalling consists of two signal lines, both driven at 3.3V
-# logic levels. The signals are DP (D+) and DM (D-), and normally operate in
-# differential mode.
-# The state where DP=1,DM=0 is J, the state DP=0,DM=1 is K.
-# A state SE0 is defined where DP=DM=0. This common mode signal is used to
-# signal a reset or end of packet.
-#
-# Data transmitted on the USB is encoded with NRZI. A transition from J to K
-# or vice-versa indicates a logic 0, while no transition indicates a logic 1.
-# If 6 ones are transmitted consecutively, a zero is inserted to force a
-# transition. This is known as bit stuffing. Data is transferred at a rate
-# of 12Mbit/s. The SE0 transmitted to signal an end-of-packet is two bit
-# intervals long.
-#
-# Details:
-# https://en.wikipedia.org/wiki/USB
-# http://www.usb.org/developers/docs/
-#
+# USB (full-speed) protocol decoder
import sigrokdecode as srd