├── .gitattributes ├── .gitignore ├── AUTHORS ├── COPYING ├── Doxyfile ├── HACKING ├── Makefile.am ├── NEWS ├── README ├── autogen.sh ├── configure.ac ├── contrib └── sigrok-logo-notext.png ├── decoder.c ├── decoders ├── ac97 │ ├── __init__.py │ └── pd.py ├── ad5626 │ ├── __init__.py │ └── pd.py ├── ad79x0 │ ├── __init__.py │ └── pd.py ├── ade77xx │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── adf435x │ ├── __init__.py │ └── pd.py ├── adns5020 │ ├── __init__.py │ └── pd.py ├── adxl345 │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── am230x │ ├── __init__.py │ └── pd.py ├── amulet_ascii │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── arm_etmv3 │ ├── __init__.py │ └── pd.py ├── arm_itm │ ├── __init__.py │ └── pd.py ├── arm_tpiu │ ├── __init__.py │ └── pd.py ├── atsha204a │ ├── __init__.py │ └── pd.py ├── aud │ ├── __init__.py │ └── pd.py ├── avr_isp │ ├── __init__.py │ ├── parts.py │ └── pd.py ├── avr_pdi │ ├── __init__.py │ └── pd.py ├── caliper │ ├── __init__.py │ └── pd.py ├── can │ ├── __init__.py │ └── pd.py ├── cc1101 │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── cec │ ├── __init__.py │ ├── pd.py │ └── protocoldata.py ├── cfp │ ├── __init__.py │ └── pd.py ├── cjtag │ ├── __init__.py │ └── pd.py ├── common │ ├── __init__.py │ ├── plugtrx │ │ ├── __init__.py │ │ └── mod.py │ ├── sdcard │ │ ├── __init__.py │ │ └── mod.py │ └── srdhelper │ │ ├── __init__.py │ │ └── mod.py ├── counter │ ├── __init__.py │ └── pd.py ├── dali │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── dcf77 │ ├── __init__.py │ └── pd.py ├── dmx512 │ ├── __init__.py │ └── pd.py ├── ds1307 │ ├── __init__.py │ └── pd.py ├── ds2408 │ ├── __init__.py │ └── pd.py ├── ds243x │ ├── __init__.py │ └── pd.py ├── ds28ea00 │ ├── __init__.py │ └── pd.py ├── dsi │ ├── __init__.py │ └── pd.py ├── edid │ ├── __init__.py │ ├── config │ ├── pd.py │ └── pnpids.txt ├── eeprom24xx │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── eeprom93xx │ ├── __init__.py │ └── pd.py ├── em4100 │ ├── __init__.py │ └── pd.py ├── em4305 │ ├── __init__.py │ └── pd.py ├── enc28j60 │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── flexray │ ├── __init__.py │ └── pd.py ├── graycode │ ├── __init__.py │ └── pd.py ├── guess_bitrate │ ├── __init__.py │ └── pd.py ├── hdcp │ ├── __init__.py │ └── pd.py ├── i2c │ ├── __init__.py │ └── pd.py ├── i2cdemux │ ├── __init__.py │ └── pd.py ├── i2cfilter │ ├── __init__.py │ └── pd.py ├── i2s │ ├── __init__.py │ └── pd.py ├── ieee488 │ ├── __init__.py │ └── pd.py ├── ir_irmp │ ├── __init__.py │ ├── irmp_library.py │ └── pd.py ├── ir_nec │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── ir_rc5 │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── ir_rc6 │ ├── __init__.py │ └── pd.py ├── ir_sirc │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── jitter │ ├── __init__.py │ └── pd.py ├── jtag │ ├── __init__.py │ └── pd.py ├── jtag_ejtag │ ├── __init__.py │ └── pd.py ├── jtag_stm32 │ ├── __init__.py │ └── pd.py ├── lfast │ ├── __init__.py │ └── pd.py ├── lin │ ├── __init__.py │ └── pd.py ├── lm75 │ ├── __init__.py │ └── pd.py ├── lpc │ ├── __init__.py │ └── pd.py ├── ltc242x │ ├── __init__.py │ └── pd.py ├── ltc26x7 │ ├── __init__.py │ └── pd.py ├── maple_bus │ ├── __init__.py │ └── pd.py ├── max7219 │ ├── __init__.py │ └── pd.py ├── mcs48 │ ├── __init__.py │ └── pd.py ├── mdio │ ├── __init__.py │ └── pd.py ├── microwire │ ├── __init__.py │ └── pd.py ├── midi │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── miller │ ├── __init__.py │ └── pd.py ├── mlx90614 │ ├── __init__.py │ └── pd.py ├── modbus │ ├── __init__.py │ └── pd.py ├── morse │ ├── __init__.py │ └── pd.py ├── mrf24j40 │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── mxc6225xu │ ├── __init__.py │ └── pd.py ├── nes_gamepad │ ├── __init__.py │ └── pd.py ├── nrf24l01 │ ├── __init__.py │ └── pd.py ├── nrf905 │ ├── __init__.py │ └── pd.py ├── numbers_and_state │ ├── __init__.py │ └── pd.py ├── nunchuk │ ├── __init__.py │ └── pd.py ├── onewire_link │ ├── __init__.py │ └── pd.py ├── onewire_network │ ├── __init__.py │ └── pd.py ├── ook │ ├── __init__.py │ └── pd.py ├── ook_oregon │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── ook_vis │ ├── __init__.py │ └── pd.py ├── pan1321 │ ├── __init__.py │ └── pd.py ├── parallel │ ├── __init__.py │ └── pd.py ├── pca9571 │ ├── __init__.py │ └── pd.py ├── pjdl │ ├── __init__.py │ └── pd.py ├── pjon │ ├── __init__.py │ └── pd.py ├── ps2 │ ├── __init__.py │ └── pd.py ├── pwm │ ├── __init__.py │ └── pd.py ├── qi │ ├── __init__.py │ └── pd.py ├── rc_encode │ ├── __init__.py │ └── pd.py ├── rfm12 │ ├── __init__.py │ └── pd.py ├── rgb_led_spi │ ├── __init__.py │ └── pd.py ├── rgb_led_ws281x │ ├── __init__.py │ └── pd.py ├── rtc8564 │ ├── __init__.py │ └── pd.py ├── sae_j1850_vpw │ ├── __init__.py │ └── pd.py ├── sda2506 │ ├── __init__.py │ └── pd.py ├── sdcard_sd │ ├── __init__.py │ └── pd.py ├── sdcard_spi │ ├── __init__.py │ └── pd.py ├── sdq │ ├── __init__.py │ └── pd.py ├── seven_segment │ ├── __init__.py │ └── pd.py ├── signature │ ├── __init__.py │ └── pd.py ├── sipi │ ├── __init__.py │ └── pd.py ├── sle44xx │ ├── __init__.py │ └── pd.py ├── spdif │ ├── __init__.py │ └── pd.py ├── spi │ ├── __init__.py │ └── pd.py ├── spiflash │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── ssi32 │ ├── __init__.py │ └── pd.py ├── st25r39xx_spi │ ├── __init__.py │ ├── lists.py │ └── pd.py ├── st7735 │ ├── __init__.py │ └── pd.py ├── stepper_motor │ ├── __init__.py │ └── pd.py ├── swd │ ├── __init__.py │ └── pd.py ├── swim │ ├── __init__.py │ └── pd.py ├── t55xx │ ├── __init__.py │ └── pd.py ├── tca6408a │ ├── __init__.py │ └── pd.py ├── tdm_audio │ ├── __init__.py │ └── pd.py ├── timing │ ├── __init__.py │ └── pd.py ├── tlc5620 │ ├── __init__.py │ └── pd.py ├── uart │ ├── __init__.py │ └── pd.py ├── usb_packet │ ├── __init__.py │ └── pd.py ├── usb_power_delivery │ ├── __init__.py │ └── pd.py ├── usb_request │ ├── __init__.py │ └── pd.py ├── usb_signalling │ ├── __init__.py │ └── pd.py ├── wiegand │ ├── __init__.py │ └── pd.py ├── x2444m │ ├── __init__.py │ └── pd.py ├── xfp │ ├── __init__.py │ └── pd.py ├── xy2-100 │ ├── __init__.py │ └── pd.py └── z80 │ ├── __init__.py │ ├── pd.py │ └── tables.py ├── error.c ├── exception.c ├── instance.c ├── irmp ├── README-sigrok.txt ├── README.txt ├── irmp-main-sharedlib.c ├── irmp-main-sharedlib.h ├── irmp.c ├── irmp.h ├── irmpconfig.h ├── irmpprotocols.h └── irmpsystem.h ├── libsigrokdecode-internal.h ├── libsigrokdecode.h ├── libsigrokdecode.pc.in ├── log.c ├── m4 └── sigrok.m4 ├── module_sigrokdecode.c ├── session.c ├── srd.c ├── tests ├── core.c ├── decoder.c ├── inst.c ├── lib.h ├── main.c └── session.c ├── tools └── install-decoders ├── type_decoder.c ├── util.c ├── version.c └── version.h.in /.gitattributes: -------------------------------------------------------------------------------- 1 | *.py diff=python 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # autotools cruft 2 | /INSTALL 3 | /Makefile.in 4 | /aclocal.m4 5 | /autom4te.cache/ 6 | /autostuff/ 7 | /configure 8 | /configure.lineno 9 | /m4/libtool.m4 10 | /m4/lt*.m4 11 | 12 | # Editor/IDE cruft 13 | *.kate-swp 14 | *~ 15 | /*.kdev4 16 | /Makefile.am.user 17 | 18 | # Configure/build cruft 19 | *.[ao] 20 | *.l[ao] 21 | .deps/ 22 | .dirstamp 23 | .libs/ 24 | /ChangeLog 25 | /Makefile 26 | /config.* 27 | /libsigrokdecode-*.tar.* 28 | /libsigrokdecode.pc 29 | /libtool 30 | /version.h 31 | __pycache__/ 32 | *.pyc 33 | stamp-h? 34 | 35 | # Files generated by the testsuite 36 | /test-suite.log 37 | /tests/*.log 38 | /tests/*.trs 39 | /tests/main 40 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | AUTHORS 3 | ------------------------------------------------------------------------------- 4 | 5 | Please check the source code files and/or git history and/or ChangeLog for 6 | a list of all authors and contributors. 7 | 8 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | ## 3 | ## This file is part of the libsigrokdecode project. 4 | ## 5 | ## Copyright (C) 2010-2012 Bert Vermeulen 6 | ## 7 | ## This program is free software: you can redistribute it and/or modify 8 | ## it under the terms of the GNU General Public License as published by 9 | ## the Free Software Foundation, either version 3 of the License, or 10 | ## (at your option) any later version. 11 | ## 12 | ## This program is distributed in the hope that it will be useful, 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ## GNU General Public License for more details. 16 | ## 17 | ## You should have received a copy of the GNU General Public License 18 | ## along with this program. If not, see . 19 | ## 20 | 21 | test -n "$srcdir" || srcdir=`dirname "$0"` 22 | test -n "$srcdir" || srcdir=. 23 | 24 | autoreconf --force --install --verbose "$srcdir" 25 | -------------------------------------------------------------------------------- /contrib/sigrok-logo-notext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossasia/libsigrokdecode/3f77dc2aae971c4ba97ad81c851c63b681074410/contrib/sigrok-logo-notext.png -------------------------------------------------------------------------------- /decoders/ac97/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Gerhard Sittig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | AC'97 (Audio Codec '97) is a protocol for audio and modem I/O functionality 22 | in mainstream PC systems. 23 | 24 | AC'97 communicates full duplex data (SDATA_IN, SDATA_OUT), where bits 25 | are clocked by the BIT_CLK and frames are signalled by the SYNC signals. 26 | A low active RESET# line completes the set of signals. 27 | 28 | Frames repeat at a nominal frequency of 48kHz, and consist of 256 bits 29 | each. One 16bit slot contains management information, twelve 20bit slots 30 | follow which carry data for three management and nine audio/modem channels. 31 | Optionally two slots of one frame can get combined for higher resolution 32 | on fewer channels, or double data rate. 33 | 34 | Details: 35 | http://download.intel.com/support/motherboards/desktop/sb/ac97_r23.pdf 36 | ''' 37 | 38 | from .pd import Decoder 39 | -------------------------------------------------------------------------------- /decoders/ad5626/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the 22 | Analog Devices AD5626 protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ad5626/pd.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | import sigrokdecode as srd 21 | 22 | class Decoder(srd.Decoder): 23 | api_version = 3 24 | id = 'ad5626' 25 | name = 'AD5626' 26 | longname = 'Analog Devices AD5626' 27 | desc = 'Analog Devices AD5626 12-bit nanoDAC.' 28 | license = 'gplv2+' 29 | inputs = ['spi'] 30 | outputs = [] 31 | tags = ['IC', 'Analog/digital'] 32 | annotations = ( 33 | ('voltage', 'Voltage'), 34 | ) 35 | 36 | def __init__(self,): 37 | self.reset() 38 | 39 | def reset(self): 40 | self.data = 0 41 | self.ss = 0 42 | 43 | def start(self): 44 | self.out_ann = self.register(srd.OUTPUT_ANN) 45 | 46 | def decode(self, ss, es, data): 47 | ptype = data[0] 48 | 49 | if ptype == 'CS-CHANGE': 50 | cs_old, cs_new = data[1:] 51 | if cs_old is not None and cs_old == 0 and cs_new == 1: 52 | self.data >>= 1 53 | self.data /= 1000 54 | self.put(self.ss, es, self.out_ann, [0, ['%.3fV' % self.data]]) 55 | self.data = 0 56 | elif cs_old is not None and cs_old == 1 and cs_new == 0: 57 | self.ss = ss 58 | elif ptype == 'BITS': 59 | mosi = data[1] 60 | for bit in reversed(mosi): 61 | self.data = self.data | bit[0] 62 | self.data <<= 1 63 | -------------------------------------------------------------------------------- /decoders/ad79x0/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the 22 | Analog Devices AD7910/AD7920 protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ade77xx/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Karl Palsson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes Analog Devices 22 | ADE77xx command/responses. 23 | 24 | The ADE77xx is a "Poly Phase Multifunction Energy Metering IC with Per Phase 25 | Information". 26 | 27 | This PD has been tested with an ADE7758 so far, support for other devices 28 | from the ADE77xx series can be added in the future. 29 | ''' 30 | 31 | from .pd import Decoder 32 | -------------------------------------------------------------------------------- /decoders/adf435x/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Joel Holdsworth 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the protocol spoken 22 | by the Analog Devices ADF4350 and ADF4351 RF synthesizer chips. 23 | 24 | Details: 25 | http://www.analog.com/media/en/technical-documentation/data-sheets/ADF4350.pdf 26 | http://www.analog.com/media/en/technical-documentation/data-sheets/ADF4351.pdf 27 | ''' 28 | 29 | from .pd import Decoder 30 | -------------------------------------------------------------------------------- /decoders/adns5020/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Karl Palsson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes ADNS-5020 optical mouse 22 | sensor commands and data. 23 | 24 | Use MOSI for the SDIO shared line. 25 | ''' 26 | 27 | from .pd import Decoder 28 | -------------------------------------------------------------------------------- /decoders/adxl345/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, write to the Free Software 18 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | ## 20 | 21 | ''' 22 | This decoder stacks on top of the 'spi' PD and decodes the 23 | Analog Devices ADXL345 protocol. 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/adxl345/lists.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, write to the Free Software 18 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | ## 20 | 21 | error_messages = { 22 | 'interrupt': ['Interrupt'], 23 | 'undesirable': ['Undesirable behavior'], 24 | 'dis_single': ['Disable single tap'], 25 | 'dis_double': ['Disable double tap'], 26 | 'dis_single_double': ['Disable single/double tap'], 27 | } 28 | 29 | rate_code = { 30 | 0x00: 0.1, 31 | 0x01: 0.2, 32 | 0x02: 0.39, 33 | 0x03: 0.78, 34 | 0x04: 1.56, 35 | 0x05: 3.13, 36 | 0x06: 6.25, 37 | 0x07: 12.5, 38 | 0x08: 25, 39 | 0x09: 50, 40 | 0x0A: 100, 41 | 0x0B: 200, 42 | 0x0C: 400, 43 | 0x0D: 800, 44 | 0x0E: 1600, 45 | 0x0F: 3200, 46 | } 47 | 48 | fifo_modes = { 49 | 0x00: 'Bypass', 50 | 0x01: 'FIFO', 51 | 0x02: 'Stream', 52 | 0x03: 'Trigger', 53 | } 54 | 55 | operations = { 56 | 0x00: ['WRITE REG', 'WRITE', 'W'], 57 | 0x01: ['READ REG', 'READ', 'R'], 58 | } 59 | 60 | number_bytes = { 61 | 0x00: ['SINGLE BYTE', 'SING BYTE', '1 BYTE', '1B'], 62 | 0x01: ['MULTIPLE BYTES', 'MULTI BYTES', 'n*BYTES', 'n*B'], 63 | } 64 | 65 | registers = { 66 | 0x00: ['DEVID', 'DID', 'ID'], 67 | 0x1D: ['THRESH_TAP', 'TH_TAP', 'TH_T'], 68 | 0x1E: ['OFSX', 'OFX'], 69 | 0x1F: ['OFSY', 'OFY'], 70 | 0x20: ['OFSZ', 'OFZ'], 71 | 0x21: ['DUR'], 72 | 0x22: ['Latent', 'Lat'], 73 | 0x23: ['Window', 'Win'], 74 | 0x24: ['THRESH_ACT', 'TH_ACT', 'TH_A'], 75 | 0x25: ['THRESH_INACT', 'TH_INACT', 'TH_I'], 76 | 0x26: ['TIME_INACT', 'TI_INACT', 'TI_I'], 77 | 0x27: ['ACT_INACT_CTL', 'ACT_I_CTL', 'A_I_C'], 78 | 0x28: ['THRESH_FF', 'TH_FF'], 79 | 0x29: ['TIME_FF', 'TI_FF'], 80 | 0x2A: ['TAP_AXES', 'TAP_AX', 'TP_AX'], 81 | 0x2B: ['ACT_TAP_STATUS', 'ACT_TAP_STAT', 'ACT_TP_ST', 'A_T_S'], 82 | 0x2C: ['BW_RATE', 'BW_R'], 83 | 0x2D: ['POWER_CTL', 'PW_CTL', 'PW_C'], 84 | 0x2E: ['INT_ENABLE', 'INT_EN', 'I_EN'], 85 | 0x2F: ['INT_MAP', 'I_M'], 86 | 0x30: ['INT_SOURCE', 'INT_SRC', 'I_SRC', 'I_S'], 87 | 0x31: ['DATA_FORMAT', 'DATA_FRM', 'D_FRM', 'D_F'], 88 | 0x32: ['DATAX0', 'DX0', 'X0'], 89 | 0x33: ['DATAX1', 'DX1', 'X1'], 90 | 0x34: ['DATAY0', 'DY0', 'Y0'], 91 | 0x35: ['DATAY1', 'DY1', 'Y1'], 92 | 0x36: ['DATAZ0', 'DZ0', 'Z0'], 93 | 0x37: ['DATAZ1', 'DZ1', 'Z1'], 94 | 0x38: ['FIFO_CTL', 'FIF_CT', 'F_C'], 95 | 0x39: ['FIFO_STATUS', 'FIFO_STAT', 'FIF_ST', 'F_S'], 96 | } 97 | -------------------------------------------------------------------------------- /decoders/am230x/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Johannes Roemer 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder handles the proprietary single wire communication protocol used 22 | by the Aosong AM230x/DHTxx/RHTxx series of digital humidity and temperature 23 | sensors. 24 | 25 | Sample rate: 26 | A sample rate of at least 200kHz is recommended to properly detect all the 27 | elements of the protocol. 28 | 29 | Options: 30 | The AM230x and DHTxx/RHTxx digital humidity and temperature sensors use the 31 | same single-wire protocol with different encoding of the measured values. 32 | Therefore the option 'device' must be used to properly decode the 33 | communication of the respective sensor. 34 | ''' 35 | 36 | from .pd import Decoder 37 | -------------------------------------------------------------------------------- /decoders/amulet_ascii/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Vesa-Pekka Palmu 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes the ASCII protocol 22 | for Amulet LCD display controllers. 23 | 24 | Currently the decoder treats both RX and TX the same way, decoding all 25 | message types. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/amulet_ascii/lists.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Vesa-Pekka Palmu 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | from collections import OrderedDict 21 | 22 | # OrderedDict which maps command IDs to their names and descriptions. 23 | cmds = OrderedDict([ 24 | (0xA0, ('PAGE', 'Jump to page')), 25 | (0xD0, ('GBV', 'Get byte variable')), 26 | (0xD1, ('GWV', 'Get word variable')), 27 | (0xD2, ('GSV', 'Get string variable')), 28 | (0xD3, ('GLV', 'Get label variable')), 29 | (0xD4, ('GRPC', 'Get RPC buffer')), 30 | (0xD5, ('SBV', 'Set byte variable')), 31 | (0xD6, ('SWV', 'Set word variable')), 32 | (0xD7, ('SSV', 'Set string variable')), 33 | (0xD8, ('RPC', 'Invoke RPC')), 34 | (0xD9, ('LINE', 'Draw line')), 35 | (0xDA, ('RECT', 'Draw rectangle')), 36 | (0xDB, ('FRECT', 'Draw filled rectangle')), 37 | (0xDC, ('PIXEL', 'Draw pixel')), 38 | (0xDD, ('GBVA', 'Get byte variable array')), 39 | (0xDE, ('GWVA', 'Get word variable array')), 40 | (0xDF, ('SBVA', 'Set byte variable array')), 41 | (0xE0, ('GBVR', 'Get byte variable reply')), 42 | (0xE1, ('GWVR', 'Get word variable reply')), 43 | (0xE2, ('GSVR', 'Get string variable reply')), 44 | (0xE3, ('GLVR', 'Get label variable reply')), 45 | (0xE4, ('GRPCR', 'Get RPC buffer reply')), 46 | (0xE5, ('SBVR', 'Set byte variable reply')), 47 | (0xE6, ('SWVR', 'Set word variable reply')), 48 | (0xE7, ('SSVR', 'Set string variable reply')), 49 | (0xE8, ('RPCR', 'Invoke RPC reply')), 50 | (0xE9, ('LINER', 'Draw line reply')), 51 | (0xEA, ('RECTR', 'Draw rectangle')), 52 | (0xEB, ('FRECTR', 'Draw filled rectangle reply')), 53 | (0xEC, ('PIXELR', 'Draw pixel reply')), 54 | (0xED, ('GBVAR', 'Get byte variable array reply')), 55 | (0xEE, ('GWVAR', 'Get word variable array reply')), 56 | (0xEF, ('SBVAR', 'Set byte variable array reply')), 57 | (0xF0, ('ACK', 'Acknowledgment')), 58 | (0xF1, ('NACK', 'Negative acknowledgment')), 59 | (0xF2, ('SWVA', 'Set word variable array')), 60 | (0xF3, ('SWVAR', 'Set word variable array reply')), 61 | (0xF4, ('GCV', 'Get color variable')), 62 | (0xF5, ('GCVR', 'Get color variable reply')), 63 | (0xF6, ('SCV', 'Set color variable')), 64 | (0xF7, ('SCVR', 'Set color variable reply')), 65 | ]) 66 | 67 | cmds_with_high_bytes = [ 68 | 0xA0, # PAGE - Page change 69 | 0xD7, # SVV - Set string variable 70 | 0xE7, # SVVR - Set string variable reply 71 | 0xE2, # GSVR - Get string variable reply 72 | 0xE3, # GLVR - Get label variable reply 73 | ] 74 | -------------------------------------------------------------------------------- /decoders/arm_etmv3/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Petteri Aimonen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes packets of 22 | the ARMv7m Embedded Trace Macroblock v3.x. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/arm_itm/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Petteri Aimonen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' or 'arm_tpiu' PD and decodes the 22 | ARM Cortex-M processor trace data from Instrumentation Trace Macroblock. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/arm_tpiu/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Petteri Aimonen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes the frame format 22 | of ARMv7m Trace Port Interface Unit. 23 | 24 | It filters the data coming from various trace sources (such as ARMv7m ITM 25 | and ETM blocks) into separate streams that can be further decoded by other PDs. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/atsha204a/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Michalis Pappas 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the 22 | Microchip ATSHA204A and ATECC508A crypto authentication protocol. 23 | 24 | The decoder might also support the following devices (untested): 25 | * ATSHA204 26 | * ATECC108 27 | * ATECC108A 28 | ''' 29 | 30 | from .pd import Decoder 31 | -------------------------------------------------------------------------------- /decoders/aud/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 fenugrec 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder decodes the AUD (Advanced User Debugger) interface 22 | of certain Renesas / Hitachi microcontrollers, when set in Branch Trace mode. 23 | 24 | AUD has two modes, this PD currently only supports "Branch Trace" mode. 25 | 26 | Details: 27 | http://www.renesas.eu/products/mpumcu/superh/sh7050/sh7058/Documentation.jsp 28 | ("rej09b0046 - SH7058 Hardware manual") 29 | ''' 30 | 31 | from .pd import Decoder 32 | -------------------------------------------------------------------------------- /decoders/avr_isp/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the In-System 22 | Programming (ISP) protocol of some Atmel AVR 8-bit microcontrollers. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/avr_isp/parts.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | # Device code addresses: 21 | # 0x00: vendor code, 0x01: part family + flash size, 0x02: part number 22 | 23 | # Vendor code 24 | vendor_code = { 25 | 0x1e: 'Atmel', 26 | 0x00: 'Device locked', 27 | } 28 | 29 | # (Part family + flash size, part number) 30 | part = { 31 | (0x90, 0x01): 'AT90S1200', 32 | (0x91, 0x01): 'AT90S2313', 33 | (0x92, 0x01): 'AT90S4414', 34 | (0x92, 0x05): 'ATmega48', # 4kB flash 35 | (0x93, 0x01): 'AT90S8515', 36 | (0x93, 0x0a): 'ATmega88', # 8kB flash 37 | (0x94, 0x06): 'ATmega168', # 16kB flash 38 | (0xff, 0xff): 'Device code erased, or target missing', 39 | (0x01, 0x02): 'Device locked', 40 | # TODO: Lots more entries. 41 | } 42 | -------------------------------------------------------------------------------- /decoders/avr_pdi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Gerhard Sittig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | PDI (Program and Debug Interface) is an Atmel proprietary interface for 22 | external programming and on-chip debugging of the device. 23 | 24 | See the Atmel Application Note AVR1612 "PDI programming driver" and the 25 | "Program and Debug Interface" section in the Xmega A manual for details. 26 | 27 | The protocol uses two pins: the RESET pin and one dedicated DATA pin. 28 | The RESET pin provides a clock, the DATA pin communicates serial frames 29 | with a start bit, eight data bits, an even parity bit, and two stop bits. 30 | Data communication is bidirectional and half duplex, the device will 31 | provide response data after reception of a respective request. 32 | 33 | Protocol frames communicate opcodes and their arguments, which provides 34 | random and sequential access to the device's address space. By accessing 35 | the registers of internal peripherals, especially the NVM controller, 36 | it's possible to identify the device, read from and write to several 37 | kinds of memory (signature rows, fuses and lock bits, internal flash and 38 | EEPROM, memory mapped peripherals), and to control execution of software 39 | on the device. 40 | ''' 41 | 42 | from .pd import Decoder 43 | -------------------------------------------------------------------------------- /decoders/caliper/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Tomas Mudrunka 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder interprets the digital output of cheap generic calipers 22 | (usually made in China), and shows the measured value in millimeters 23 | or inches. 24 | 25 | Notice that these devices often communicate on voltage levels below 26 | 3.3V and may require additional circuitry to capture the signal. 27 | 28 | This decoder does not work for calipers using the Digimatic protocol 29 | (eg. Mitutoyo and similar brands). 30 | 31 | For more information see: 32 | http://www.shumatech.com/support/chinese_scales.htm 33 | https://www.instructables.com/id/Reading-Digital-Callipers-with-an-Arduino-USB/ 34 | ''' 35 | 36 | from .pd import Decoder 37 | -------------------------------------------------------------------------------- /decoders/can/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | CAN (Controller Area Network) is a field bus protocol for distributed 22 | real-time control. 23 | 24 | This decoder assumes that a single CAN_RX line is sampled (e.g. on 25 | the digital output side of a CAN transceiver IC such as the Microchip 26 | MCP-2515DM-BM). 27 | 28 | It also has support for CAN-FD. 29 | ''' 30 | 31 | from .pd import Decoder 32 | -------------------------------------------------------------------------------- /decoders/cc1101/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Marco Geisler 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the protocol spoken 22 | by the Texas Instruments low-power sub-1GHz RF transceiver chips. 23 | 24 | Details: 25 | http://www.ti.com/lit/ds/symlink/cc1101.pdf 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/cc1101/lists.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Marco Geisler 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | regs = { 21 | # addr: 'name' 22 | 0x00: 'IOCFG2', 23 | 0x01: 'IOCFG1', 24 | 0x02: 'IOCFG0', 25 | 0x03: 'FIFOTHR', 26 | 0x04: 'SYNC1', 27 | 0x05: 'SYNC0', 28 | 0x06: 'PKTLEN', 29 | 0x07: 'PKTCTRL1', 30 | 0x08: 'PKTCTRL0', 31 | 0x09: 'ADDR', 32 | 0x0A: 'CHANNR', 33 | 0x0B: 'FSCTRL1', 34 | 0x0C: 'FSCTRL0', 35 | 0x0D: 'FREQ2', 36 | 0x0E: 'FREQ1', 37 | 0x0F: 'FREQ0', 38 | 0x10: 'MDMCFG4', 39 | 0x11: 'MDMCFG3', 40 | 0x12: 'MDMCFG2', 41 | 0x13: 'MDMCFG1', 42 | 0x14: 'MDMCFG0', 43 | 0x15: 'DEVIATN', 44 | 0x16: 'MCSM2', 45 | 0x17: 'MCSM1', 46 | 0x18: 'MCSM0', 47 | 0x19: 'FOCCFG', 48 | 0x1A: 'BSCFG', 49 | 0x1B: 'AGCTRL2', 50 | 0x1C: 'AGCTRL1', 51 | 0x1D: 'AGCTRL0', 52 | 0x1E: 'WOREVT1', 53 | 0x1F: 'WOREVT0', 54 | 0x20: 'WORCTRL', 55 | 0x21: 'FREND1', 56 | 0x22: 'FREND0', 57 | 0x23: 'FSCAL3', 58 | 0x24: 'FSCAL2', 59 | 0x25: 'FSCAL1', 60 | 0x26: 'FSCAL0', 61 | 0x27: 'RCCTRL1', 62 | 0x28: 'RCCTRL0', 63 | 0x29: 'FSTEST', 64 | 0x2A: 'PTEST', 65 | 0x2B: 'AGCTEST', 66 | 0x2C: 'TEST2', 67 | 0x2D: 'TEST1', 68 | 0x2E: 'TEST0', 69 | 0x30: 'PARTNUM', 70 | 0x31: 'VERSION', 71 | 0x32: 'FREQEST', 72 | 0x33: 'LQI', 73 | 0x34: 'RSSI', 74 | 0x35: 'MARCSTATE', 75 | 0x36: 'WORTIME1', 76 | 0x37: 'WORTIME0', 77 | 0x38: 'PKTSTATUS', 78 | 0x39: 'VCO_VC_DAC', 79 | 0x3A: 'TXBYTES', 80 | 0x3B: 'RXBYTES', 81 | 0x3C: 'RCCTRL1_STATUS', 82 | 0x3D: 'RCCTRL0_STATUS', 83 | 0x3E: 'PATABLE', 84 | 0x3F: 'FIFO' 85 | } 86 | 87 | strobes = { 88 | # addr: 'name' 89 | 0x30: 'SRES', 90 | 0x31: 'SFSTXON', 91 | 0x32: 'SXOFF', 92 | 0x33: 'SCAL', 93 | 0x34: 'SRX', 94 | 0x35: 'STX', 95 | 0x36: 'SIDLE', 96 | 0x37: '', 97 | 0x38: 'SWOR', 98 | 0x39: 'SPWD', 99 | 0x3A: 'SFRX', 100 | 0x3B: 'SFTX', 101 | 0x3C: 'SWORRST', 102 | 0x3D: 'SNOP' 103 | } 104 | 105 | status_reg_states = { 106 | # value: 'state name' 107 | 0b000: 'IDLE', 108 | 0b001: 'RX', 109 | 0b010: 'TX', 110 | 0b011: 'FSTXON', 111 | 0b100: 'CALIBRATE', 112 | 0b101: 'SETTLING', 113 | 0b110: 'RXFIFO_OVERFLOW', 114 | 0b111: 'TXFIFO_OVERFLOW' 115 | } 116 | -------------------------------------------------------------------------------- /decoders/cec/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Jorge Solla Rubiales 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The Consumer Electronics Control (CEC) protocol allows users to command and 22 | control devices connected through HDMI. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/cfp/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Elias Oenal 5 | ## All rights reserved. 6 | ## 7 | ## Redistribution and use in source and binary forms, with or without 8 | ## modification, are permitted provided that the following conditions are met: 9 | ## 10 | ## 1. Redistributions of source code must retain the above copyright notice, 11 | ## this list of conditions and the following disclaimer. 12 | ## 2. Redistributions in binary form must reproduce the above copyright notice, 13 | ## this list of conditions and the following disclaimer in the documentation 14 | ## and/or other materials provided with the distribution. 15 | ## 16 | ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | ## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | ## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | ## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | ## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | ## POSSIBILITY OF SUCH DAMAGE. 27 | ## 28 | 29 | ''' 30 | This decoder stacks on top of the 'mdio' PD and decodes the CFP 100G 31 | pluggable transceiver protocol. 32 | ''' 33 | 34 | from .pd import Decoder 35 | -------------------------------------------------------------------------------- /decoders/cjtag/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | JTAG (Joint Test Action Group), a.k.a. "IEEE 1149.1: Standard Test Access Port 22 | and Boundary-Scan Architecture", is a protocol used for testing, debugging, 23 | and flashing various digital ICs. 24 | 25 | Details: 26 | https://en.wikipedia.org/wiki/Joint_Test_Action_Group 27 | http://focus.ti.com/lit/an/ssya002c/ssya002c.pdf 28 | 29 | This decoder handles a tiny part of IEEE 1149.7, the CJTAG OSCAN1 format. 30 | ZBS is currently not supported. 31 | 32 | Details: 33 | http://developers-club.com/posts/237885/ 34 | ''' 35 | 36 | from .pd import Decoder 37 | -------------------------------------------------------------------------------- /decoders/common/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | -------------------------------------------------------------------------------- /decoders/common/plugtrx/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Bert Vermeulen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | from .mod import * 21 | -------------------------------------------------------------------------------- /decoders/common/sdcard/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012-2014 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | from .mod import * 21 | -------------------------------------------------------------------------------- /decoders/common/srdhelper/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012-2014 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | from .mod import * 21 | -------------------------------------------------------------------------------- /decoders/common/srdhelper/mod.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012-2020 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | from enum import Enum, IntEnum, unique 21 | from itertools import chain 22 | import re 23 | 24 | # Return the specified BCD number (max. 8 bits) as integer. 25 | def bcd2int(b): 26 | return (b & 0x0f) + ((b >> 4) * 10) 27 | 28 | def bin2int(s: str): 29 | return int('0b' + s, 2) 30 | 31 | def bitpack(bits): 32 | return sum([b << i for i, b in enumerate(bits)]) 33 | 34 | def bitpack_lsb(bits, idx=None): 35 | '''Conversion from LSB first bit sequence to integer.''' 36 | if idx is not None: 37 | bits = [b[idx] for b in bits] 38 | return bitpack(bits) 39 | 40 | def bitpack_msb(bits, idx=None): 41 | '''Conversion from MSB first bit sequence to integer.''' 42 | bits = bits[:] 43 | if idx is not None: 44 | bits = [b[idx] for b in bits] 45 | bits.reverse() 46 | return bitpack(bits) 47 | 48 | def bitunpack(num, minbits=0): 49 | res = [] 50 | while num or minbits > 0: 51 | res.append(num & 1) 52 | num >>= 1 53 | minbits -= 1 54 | return tuple(res) 55 | 56 | @unique 57 | class SrdStrEnum(Enum): 58 | @classmethod 59 | def from_list(cls, name, l): 60 | # Keys are limited/converted to [A-Z0-9_], values can be any string. 61 | items = [(re.sub('[^A-Z0-9_]', '_', l[i]), l[i]) for i in range(len(l))] 62 | return cls(name, items) 63 | 64 | @classmethod 65 | def from_str(cls, name, s): 66 | return cls.from_list(name, s.split()) 67 | 68 | @unique 69 | class SrdIntEnum(IntEnum): 70 | @classmethod 71 | def _prefix(cls, p): 72 | return tuple([a.value for a in cls if a.name.startswith(p)]) 73 | 74 | @classmethod 75 | def prefixes(cls, prefix_list): 76 | if isinstance(prefix_list, str): 77 | prefix_list = prefix_list.split() 78 | return tuple(chain(*[cls._prefix(p) for p in prefix_list])) 79 | 80 | @classmethod 81 | def _suffix(cls, s): 82 | return tuple([a.value for a in cls if a.name.endswith(s)]) 83 | 84 | @classmethod 85 | def suffixes(cls, suffix_list): 86 | if isinstance(suffix_list, str): 87 | suffix_list = suffix_list.split() 88 | return tuple(chain(*[cls._suffix(s) for s in suffix_list])) 89 | 90 | @classmethod 91 | def from_list(cls, name, l): 92 | # Manually construct (Python 3.4 is missing the 'start' argument). 93 | # Python defaults to start=1, but we want start=0. 94 | return cls(name, [(l[i], i) for i in range(len(l))]) 95 | 96 | @classmethod 97 | def from_str(cls, name, s): 98 | return cls.from_list(name, s.split()) 99 | -------------------------------------------------------------------------------- /decoders/counter/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Stefan Brüns 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder is a simple edge counter. 22 | 23 | It can count rising and/or falling edges, provides an optional reset 24 | signal. It can also divide the count to e.g. count the number of 25 | fixed-length words (where a word corresponds to e.g. 9 clock edges). 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/dali/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Jeremy Swanson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program. If not, see . 18 | ## 19 | 20 | ''' 21 | DALI is a biphase/manchester based lighting control protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/dcf77/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This PD decodes the DCF77 protocol (a European long-wave time signal that 22 | uses a 77.5kHz carrier frequency). 23 | 24 | Details: 25 | http://en.wikipedia.org/wiki/DCF77 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/dmx512/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Gerhard Sittig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | DMX512 (Digital MultipleX 512) is a protocol based on RS485, used to control 22 | professional lighting fixtures. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ds1307/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2013 Matt Ranostay 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the Dallas DS1307 22 | real-time clock (RTC) specific registers and commands. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ds2408/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'onewire_network' PD and decodes the 22 | Maxim DS2408 1-Wire 8-channel addressable switch protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ds243x/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Kevin Redon 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'onewire_network' PD and decodes the 22 | Maxim DS243x (1-Wire EEPROM) protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ds28ea00/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'onewire_network' PD and decodes the 22 | Maxim DS28EA00 1-Wire digital thermometer protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/dsi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Jeremy Swanson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program. If not, see . 18 | ## 19 | 20 | ''' 21 | DSI is a biphase/manchester based lighting control protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/edid/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Bert Vermeulen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Extended Display Identification Data (EDID) 1.3 structure decoder. 22 | 23 | The three-character vendor ID as specified in the EDID standard refers to 24 | a Plug and Play ID (PNPID). The list of PNPID assignments is done by Microsoft. 25 | 26 | The 'pnpids.txt' file included with this protocol decoder is derived from 27 | the list of assignments downloadable from that page. It was retrieved in 28 | January 2012. 29 | 30 | Details: 31 | https://en.wikipedia.org/wiki/Extended_display_identification_data 32 | http://msdn.microsoft.com/en-us/windows/hardware/gg463195 33 | ''' 34 | 35 | from .pd import Decoder 36 | -------------------------------------------------------------------------------- /decoders/edid/config: -------------------------------------------------------------------------------- 1 | extra-install pnpids.txt 2 | -------------------------------------------------------------------------------- /decoders/eeprom24xx/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the 22 | industry standard 24xx series serial EEPROM protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/eeprom93xx/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Kevin Redon 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'microwire' PD and decodes the 93xx EEPROM 22 | specific instructions. 23 | 24 | The implemented instructions come from the STMicroelectronics M93Cx6 EEPROM 25 | datasheet. They are compatible with the Atmel AT93Cxx EEPROM with slightly 26 | different names. 27 | 28 | Warning: Other EEPROMs using Microwire might have different operation codes 29 | and instructions. 30 | ''' 31 | 32 | from .pd import Decoder 33 | -------------------------------------------------------------------------------- /decoders/em4100/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Benjamin Larsson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | EM4100 is a biphase/manchester/PSK based 100-150kHz RFID protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/em4305/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Benjamin Larsson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | EM4305 is a 100-150kHz RFID protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/enc28j60/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Jiahao Li 5 | ## 6 | ## Permission is hereby granted, free of charge, to any person obtaining a copy 7 | ## of this software and associated documentation files (the "Software"), to deal 8 | ## in the Software without restriction, including without limitation the rights 9 | ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | ## copies of the Software, and to permit persons to whom the Software is 11 | ## furnished to do so, subject to the following conditions: 12 | ## 13 | ## The above copyright notice and this permission notice shall be included in all 14 | ## copies or substantial portions of the Software. 15 | ## 16 | ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | ## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | ## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | ## SOFTWARE. 23 | 24 | ''' 25 | This decoder stacks on top of the 'spi' PD and decodes the protocol spoken 26 | by the Microchip ENC28J60 Ethernet chip. 27 | 28 | Details: 29 | http://ww1.microchip.com/downloads/en/DeviceDoc/39662e.pdf 30 | ''' 31 | 32 | from .pd import Decoder 33 | -------------------------------------------------------------------------------- /decoders/flexray/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Stephan Thiele 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | FlexRay is a fast, deterministic and fault-tolerant fieldbus system 22 | which is used in cars in high security related areas like X-by-Wire. 23 | 24 | It is the result of the FlexRay consortium which consisted of BMW, 25 | Daimler, Motorola (today Freescale) and Philips, with the goal of 26 | working out a common standard automotive bus system. 27 | 28 | This decoder assumes that at least one channel of a logic level RX line 29 | of a transceiver is sampled (e.g. NXP TJA1080). 30 | ''' 31 | 32 | from .pd import Decoder 33 | -------------------------------------------------------------------------------- /decoders/graycode/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Christoph Rackwitz 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Gray code and rotary encoder protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/guess_bitrate/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2013 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder tries to guess the bitrate / baudrate of the 22 | communication on the specified channel. 23 | 24 | Typically this will be used to guess / detect the baudrate used in a UART 25 | communication snippet, but it could also be used to guess bitrates of certain 26 | other protocols or buses. 27 | 28 | It should be noted that this is nothing more than a simple guess / heuristic, 29 | and that there are various cases in practice where the detection of the 30 | bitrate or baudrate will not necessarily have the expected result. 31 | 32 | The precision of the estimated bitrate / baudrate will also depend on the 33 | samplerate used to sample the respective channel. For good results it is 34 | recommended to use a logic analyzer samplerate that is much higher than 35 | the expected bitrate/baudrate that might be used on the channel. 36 | 37 | The last annotation emitted by the decoder will be the best bitrate guess. 38 | ''' 39 | 40 | from .pd import Decoder 41 | -------------------------------------------------------------------------------- /decoders/guess_bitrate/pd.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2013-2016 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | import sigrokdecode as srd 21 | 22 | class SamplerateError(Exception): 23 | pass 24 | 25 | class Decoder(srd.Decoder): 26 | api_version = 3 27 | id = 'guess_bitrate' 28 | name = 'Guess bitrate' 29 | longname = 'Guess bitrate/baudrate' 30 | desc = 'Guess the bitrate/baudrate of a UART (or other) protocol.' 31 | license = 'gplv2+' 32 | inputs = ['logic'] 33 | outputs = [] 34 | tags = ['Clock/timing', 'Util'] 35 | channels = ( 36 | {'id': 'data', 'name': 'Data', 'desc': 'Data line'}, 37 | ) 38 | annotations = ( 39 | ('bitrate', 'Bitrate / baudrate'), 40 | ) 41 | 42 | def putx(self, data): 43 | self.put(self.ss_edge, self.samplenum, self.out_ann, data) 44 | 45 | def __init__(self): 46 | self.reset() 47 | 48 | def reset(self): 49 | self.ss_edge = None 50 | 51 | def start(self): 52 | self.out_ann = self.register(srd.OUTPUT_ANN) 53 | 54 | def metadata(self, key, value): 55 | if key == srd.SRD_CONF_SAMPLERATE: 56 | self.samplerate = value 57 | 58 | def decode(self): 59 | if not self.samplerate: 60 | raise SamplerateError('Cannot decode without samplerate.') 61 | 62 | # Get the first edge on the data line. 63 | self.wait({0: 'e'}) 64 | self.ss_edge = self.samplenum 65 | 66 | # Get any subsequent edge on the data line. Get the smallest 67 | # distance between any two transitions, assuming it corresponds 68 | # to one bit time of the respective bitrate of the input stream. 69 | # This heuristics keeps getting better for longer captures. 70 | bitwidth = None 71 | while True: 72 | self.wait({0: 'e'}) 73 | 74 | b = self.samplenum - self.ss_edge 75 | if bitwidth is None or b < bitwidth: 76 | bitwidth = b 77 | bitrate = int(float(self.samplerate) / float(b)) 78 | self.putx([0, ['%d' % bitrate]]) 79 | self.ss_edge = self.samplenum 80 | -------------------------------------------------------------------------------- /decoders/hdcp/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Dave Craig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes HDCP messages. 22 | 23 | Details: 24 | https://www.digital-cp.com/sites/default/files/specifications/HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf 25 | ''' 26 | 27 | from .pd import Decoder 28 | -------------------------------------------------------------------------------- /decoders/i2c/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | I²C (Inter-Integrated Circuit) is a bidirectional, multi-master 22 | bus using two signals (SCL = serial clock line, SDA = serial data line). 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/i2cdemux/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This is a generic I²C demultiplexing protocol decoder. 22 | 23 | It takes an I²C stream as input and outputs multiple I²C streams, each 24 | stream containing only I²C packets for one specific I²C slave. 25 | ''' 26 | 27 | from .pd import Decoder 28 | -------------------------------------------------------------------------------- /decoders/i2cdemux/pd.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | import sigrokdecode as srd 21 | 22 | class Decoder(srd.Decoder): 23 | api_version = 3 24 | id = 'i2cdemux' 25 | name = 'I²C demux' 26 | longname = 'I²C demultiplexer' 27 | desc = 'Demux I²C packets into per-slave-address streams.' 28 | license = 'gplv2+' 29 | inputs = ['i2c'] 30 | outputs = [] # TODO: Only known at run-time. 31 | tags = ['Util'] 32 | 33 | def __init__(self): 34 | self.reset() 35 | 36 | def reset(self): 37 | self.packets = [] # Local cache of I²C packets 38 | self.slaves = [] # List of known slave addresses 39 | self.stream = -1 # Current output stream 40 | self.streamcount = 0 # Number of created output streams 41 | 42 | def start(self): 43 | self.out_python = [] 44 | 45 | # Grab I²C packets into a local cache, until an I²C STOP condition 46 | # packet comes along. At some point before that STOP condition, there 47 | # will have been an ADDRESS READ or ADDRESS WRITE which contains the 48 | # I²C address of the slave that the master wants to talk to. 49 | # We use this slave address to figure out which output stream should 50 | # get the whole chunk of packets (from START to STOP). 51 | def decode(self, ss, es, data): 52 | 53 | cmd, databyte = data 54 | 55 | # Add the I²C packet to our local cache. 56 | self.packets.append([ss, es, data]) 57 | 58 | if cmd in ('ADDRESS READ', 'ADDRESS WRITE'): 59 | if databyte in self.slaves: 60 | self.stream = self.slaves.index(databyte) 61 | return 62 | 63 | # We're never seen this slave, add a new stream. 64 | self.slaves.append(databyte) 65 | self.out_python.append(self.register(srd.OUTPUT_PYTHON, 66 | proto_id='i2c-%s' % hex(databyte))) 67 | self.stream = self.streamcount 68 | self.streamcount += 1 69 | elif cmd == 'STOP': 70 | if self.stream == -1: 71 | raise Exception('Invalid stream!') # FIXME? 72 | 73 | # Send the whole chunk of I²C packets to the correct stream. 74 | for p in self.packets: 75 | self.put(p[0], p[1], self.out_python[self.stream], p[2]) 76 | 77 | self.packets = [] 78 | self.stream = -1 79 | else: 80 | pass # Do nothing, only add the I²C packet to our cache. 81 | -------------------------------------------------------------------------------- /decoders/i2cfilter/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Bert Vermeulen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This is a generic I²C filtering protocol decoder. 22 | 23 | It takes input from the I²C protocol decoder and removes all traffic 24 | except that from/to the specified slave address and/or direction. 25 | 26 | It then outputs the filtered data again as OUTPUT_PROTO of type/format 'i2c' 27 | (up the protocol decoder stack). No annotations are output. 28 | 29 | The I²C slave address to filter out should be passed in as an option 30 | 'address', as an integer. A specific read or write operation can be selected 31 | with the 'direction' option, which should be 'read', 'write', or 'both'. 32 | 33 | Both of these are optional; if no options are specified the entire payload 34 | of the I²C session will be output. 35 | ''' 36 | 37 | from .pd import Decoder 38 | -------------------------------------------------------------------------------- /decoders/i2s/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Joel Holdsworth 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | I²S (Integrated Interchip Sound) is a serial bus for connecting digital 22 | audio devices (usually on the same device/board). 23 | 24 | Details: 25 | http://www.nxp.com/acrobat_download/various/I2SBUS.pdf 26 | http://en.wikipedia.org/wiki/I2s 27 | ''' 28 | 29 | from .pd import Decoder 30 | -------------------------------------------------------------------------------- /decoders/ieee488/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Gerhard Sittig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder can decode the GPIB (IEEE-488) protocol. Both variants 22 | of (up to) 16 parallel lines as well as serial communication (IEC bus) are 23 | supported in this implementation. 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/ir_irmp/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Rene Staffen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | IRMP is a multi protocol infrared remote protocol decoder. See 22 | https://www.mikrocontroller.net/articles/IRMP for details. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ir_nec/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Gump Yang 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | NEC is a pulse-distance based infrared remote control protocol. 22 | See https://www.sbprojects.net/knowledge/ir/nec.php for a description. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ir_nec/lists.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | # Addresses/devices. Items that are not listed are reserved/unknown. 21 | address = { 22 | 0x00: 'Joy-it SBC-IRC01', 23 | 0x40: 'Matsui TV', 24 | 0xEA41: 'Unknown LED Panel', 25 | } 26 | 27 | digits = { 28 | 0: ['0', '0'], 29 | 1: ['1', '1'], 30 | 2: ['2', '2'], 31 | 3: ['3', '3'], 32 | 4: ['4', '4'], 33 | 5: ['5', '5'], 34 | 6: ['6', '6'], 35 | 7: ['7', '7'], 36 | 8: ['8', '8'], 37 | 9: ['9', '9'], 38 | } 39 | 40 | # Commands. Items that are not listed are reserved/unknown. 41 | command = { 42 | 0x40: dict(list(digits.items()) + list({ 43 | 11: ['-/--', '-/--'], 44 | 16: ['Mute', 'M'], 45 | 18: ['Standby', 'StBy'], 46 | 26: ['Volume up', 'Vol+'], 47 | 27: ['Program up', 'P+'], 48 | 30: ['Volume down', 'Vol-'], 49 | 31: ['Program down', 'P-'], 50 | 68: ['AV', 'AV'], 51 | }.items())), 52 | 53 | # This is most likely a generic remote control. The PCB 54 | # has space for 16 buttons total, of which not all are 55 | # connected. The PCB is marked "JSY", "XSK-5462", and 56 | # "2014-6-12 JW". It consists of only a single IC, marked 57 | # "BJEC107BNE" or similar. The following buttons are 58 | # marked for the remote control of a LED panel this was 59 | # found in. 60 | 0xEA41: { 61 | 0x10: ['Warmer', 'T+'], 62 | 0x11: ['Colder', 'T-'], 63 | 0x12: ['Brighter', '+'], 64 | 0x13: ['Darker', '-'], 65 | 0x14: ['Off', 'O'], 66 | 0x15: ['On', 'I'], 67 | 0x41: ['Min Brightness', 'Min'], 68 | 0x48: ['Max Brightness', 'Max'], 69 | }, 70 | 0x00: { 71 | 0x45: ['Volume down', 'Vol-'], 72 | 0x46: ['Play/Pause', 'P/P'], 73 | 0x47: ['Volume up', 'Vol+'], 74 | 0x44: ['Setup', 'Set'], 75 | 0x40: ['Up', 'U'], 76 | 0x43: ['Stop / Mode', 'S/M'], 77 | 0x07: ['Left', 'L'], 78 | 0x15: ['Enter', 'E'], 79 | 0x09: ['Right', 'R'], 80 | 0x16: ['0 / 10+', '0'], 81 | 0x19: ['Down', 'D'], 82 | 0x0D: ['Back', 'B'], 83 | 0x0C: ['1', '1'], 84 | 0x18: ['2', '2'], 85 | 0x5E: ['3', '3'], 86 | 0x08: ['4', '4'], 87 | 0x1C: ['5', '5'], 88 | 0x5A: ['6', '6'], 89 | 0x42: ['7', '7'], 90 | 0x52: ['8', '8'], 91 | 0x4A: ['9', '9'], 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /decoders/ir_rc5/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | RC-5 is a biphase/manchester based infrared remote control protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/ir_rc6/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Benedikt Otto 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | RC-6 is a biphase/manchester based infrared remote control protocol. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/ir_sirc/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Tom Flanagan 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Decoder for the Sony IR remote control protocol (SIRC). 22 | 23 | https://www.sbprojects.net/knowledge/ir/sirc.php 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/jitter/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Sebastien Bourdelin 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder retrieves the timing jitter between two digital signals. 22 | 23 | It allows to define a clock source channel and a resulting signal channel. 24 | 25 | Each time a significant edge is detected in the clock source, we calculate the 26 | elapsed time before the resulting signal answers and report the timing jitter. 27 | ''' 28 | 29 | from .pd import Decoder 30 | -------------------------------------------------------------------------------- /decoders/jtag/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | JTAG (Joint Test Action Group), a.k.a. "IEEE 1149.1: Standard Test Access Port 22 | and Boundary-Scan Architecture", is a protocol used for testing, debugging, 23 | and flashing various digital ICs. 24 | 25 | Details: 26 | https://en.wikipedia.org/wiki/Joint_Test_Action_Group 27 | http://focus.ti.com/lit/an/ssya002c/ssya002c.pdf 28 | ''' 29 | 30 | from .pd import Decoder 31 | -------------------------------------------------------------------------------- /decoders/jtag_ejtag/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Vladislav Ivanov 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'jtag' PD and decodes JTAG data specific 22 | to the MIPS EJTAG protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/jtag_stm32/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'jtag' PD and decodes JTAG data specific to 22 | the STM32 microcontroller series. 23 | 24 | Details: 25 | https://en.wikipedia.org/wiki/STM32 26 | http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf (e.g. chapter 31.7: "JTAG debug port") 27 | ''' 28 | 29 | from .pd import Decoder 30 | -------------------------------------------------------------------------------- /decoders/lfast/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Soeren Apel 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | LFAST is a physical communication interface used mainly by the NXP Zipwire 22 | interface. It's a framed asynchronous serial interface using differential 23 | TX/RX pairs, capable of data rates of up to 320 MBit/s. 24 | 25 | This interface is also provided by Infineon as HSCT. 26 | 27 | As with most differential signals, it's sufficient to measure TXP or RXP, no 28 | need for a differential probe. The REFCLK used by the hardware isn't needed by 29 | this protocol decoder either. 30 | 31 | For details see https://www.nxp.com/docs/en/application-note/AN5134.pdf and 32 | https://hitex.co.uk/fileadmin/uk-files/downloads/ShieldBuddy/tc27xD_um_v2.2.pdf 33 | ''' 34 | 35 | from .pd import Decoder 36 | -------------------------------------------------------------------------------- /decoders/lin/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Stephan Thiele 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes the LIN 22 | (Local Interconnect Network) protocol. 23 | 24 | LIN is layered on top of the UART (async serial) protocol, with 8n1 settings. 25 | Bytes are sent LSB-first. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/lm75/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the National LM75 22 | (and compatibles) temperature sensor protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/lpc/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | LPC (Low Pin Count) is a protocol for low-bandwidth devices used on 22 | some PC mainboards, such as the "BIOS chip" or the so-called "Super I/O". 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ltc242x/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the 22 | Linear Technology LTC2421/LTC2422 protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ltc242x/pd.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | import sigrokdecode as srd 21 | 22 | input_voltage_format = ['%.6fV', '%.2fV'] 23 | 24 | class Decoder(srd.Decoder): 25 | api_version = 3 26 | id = 'ltc242x' 27 | name = 'LTC242x' 28 | longname = 'Linear Technology LTC242x' 29 | desc = 'Linear Technology LTC2421/LTC2422 1-/2-channel 20-bit ADC.' 30 | license = 'gplv2+' 31 | inputs = ['spi'] 32 | outputs = [] 33 | tags = ['IC', 'Analog/digital'] 34 | annotations = ( 35 | ('ch0_voltage', 'CH0 voltage'), 36 | ('ch1_voltage', 'CH1 voltage'), 37 | ) 38 | annotation_rows = ( 39 | ('ch0_voltages', 'CH0 voltages', (0,)), 40 | ('ch1_voltages', 'CH1 voltages', (1,)), 41 | ) 42 | options = ( 43 | {'id': 'vref', 'desc': 'Reference voltage (V)', 'default': 1.5}, 44 | ) 45 | 46 | def __init__(self): 47 | self.reset() 48 | 49 | def reset(self): 50 | self.data = 0 51 | self.ss, self.es = 0, 0 52 | 53 | def start(self): 54 | self.out_ann = self.register(srd.OUTPUT_ANN) 55 | 56 | def handle_input_voltage(self, data): 57 | input_voltage = data & 0x3FFFFF 58 | input_voltage = -(2**21 - input_voltage) 59 | input_voltage = (input_voltage / 0xfffff) * self.options['vref'] 60 | ann = [] 61 | for format in input_voltage_format: 62 | ann.append(format % input_voltage) 63 | 64 | channel = (data & (1 << 22)) >> 22 65 | self.put(self.ss, self.es, self.out_ann, [channel, ann]) 66 | 67 | def decode(self, ss, es, data): 68 | ptype = data[0] 69 | 70 | if ptype == 'CS-CHANGE': 71 | cs_old, cs_new = data[1:] 72 | if cs_old is not None and cs_old == 0 and cs_new == 1: 73 | self.es = es 74 | self.data >>= 1 75 | self.handle_input_voltage(self.data) 76 | 77 | self.data = 0 78 | elif cs_old is not None and cs_old == 1 and cs_new == 0: 79 | self.ss = ss 80 | 81 | elif ptype == 'BITS': 82 | miso = data[2] 83 | for bit in reversed(miso): 84 | self.data = self.data | bit[0] 85 | 86 | self.data <<= 1 87 | -------------------------------------------------------------------------------- /decoders/ltc26x7/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Analog Devices Inc. 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the 22 | Linear Technology LTC2607/LTC2617/LTC2627 protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/maple_bus/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Marcus Comstedt 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Maple bus is serial communication protocol used by peripherals for the 22 | SEGA Dreamcast game console. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/max7219/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Paul Evans 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the Maxim MAX7219 and 22 | MAX7221 LED matrix driver protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/mcs48/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 fenugrec 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder de-multiplexes Intel MCS-48 (8039, 8048, etc.) external 22 | program memory accesses. 23 | 24 | This requires 14 channels: 8 for D0-D7 (data and lower 8 bits of address), 25 | 4 for A8-A11 (output on port P2), ALE and PSEN. 26 | 27 | An optional A12 is supported, which may be an arbitrary I/O pin driven by 28 | software (use case is dumping ROM of an HP 3478A). 29 | ''' 30 | 31 | from .pd import Decoder 32 | -------------------------------------------------------------------------------- /decoders/mdio/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Elias Oenal 5 | ## All rights reserved. 6 | ## 7 | ## Redistribution and use in source and binary forms, with or without 8 | ## modification, are permitted provided that the following conditions are met: 9 | ## 10 | ## 1. Redistributions of source code must retain the above copyright notice, 11 | ## this list of conditions and the following disclaimer. 12 | ## 2. Redistributions in binary form must reproduce the above copyright notice, 13 | ## this list of conditions and the following disclaimer in the documentation 14 | ## and/or other materials provided with the distribution. 15 | ## 16 | ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | ## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | ## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | ## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | ## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | ## POSSIBILITY OF SUCH DAMAGE. 27 | ## 28 | 29 | ''' 30 | The MDIO (Management Data Input/Output) protocol decoder supports the 31 | MII Management serial bus (a bidirectional bus between the PHY and the STA), 32 | with a clock line (MDC) and a bi-directional data line (MDIO). 33 | 34 | MDIO is also known as SMI (Serial Management Interface). 35 | 36 | It's part of the Ethernet standard. 37 | ''' 38 | 39 | from .pd import Decoder 40 | -------------------------------------------------------------------------------- /decoders/microwire/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Kevin Redon 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Microwire is a 3-wire half-duplex synchronous serial communication protocol. 22 | 23 | Originally from National Semiconductor, it is often used in EEPROM chips with 24 | device specific commands on top of the bit stream. 25 | 26 | Channels: 27 | 28 | - CS: chip select, active high 29 | - SK: clock line, for the synchronous communication (idle low) 30 | - SI: slave data input, output by the master and parsed by the selected slave 31 | on rising edge of clock line (idle low) 32 | - SO: slave data output, output by the selected slave and changed on rising 33 | edge of clock line, or goes from low to high when ready during status 34 | check (idle high impedance) 35 | 36 | The channel names might vary from chip to chip but the underlying function is 37 | the same. 38 | ''' 39 | 40 | from .pd import Decoder 41 | -------------------------------------------------------------------------------- /decoders/midi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2013 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes the MIDI 22 | (Musical Instrument Digital Interface) protocol. 23 | 24 | MIDI is layered on top of the UART (async serial) protocol, with a fixed 25 | baud rate of 31250 baud (+/- 1%) and 8n1 settings. Bytes are sent LSB-first. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/miller/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Christoph Rackwitz 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The Miller protocol decoder supports (modified) Miller encoded data. 22 | 23 | E.g. used in NFC communication at 106 kbaud. 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/mlx90614/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the Melexis MLX90614 22 | infrared thermometer protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/mlx90614/pd.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | import sigrokdecode as srd 21 | 22 | class Decoder(srd.Decoder): 23 | api_version = 3 24 | id = 'mlx90614' 25 | name = 'MLX90614' 26 | longname = 'Melexis MLX90614' 27 | desc = 'Melexis MLX90614 infrared thermometer protocol.' 28 | license = 'gplv2+' 29 | inputs = ['i2c'] 30 | outputs = [] 31 | tags = ['IC', 'Sensor'] 32 | annotations = ( 33 | ('celsius', 'Temperature / °C'), 34 | ('kelvin', 'Temperature / K'), 35 | ) 36 | annotation_rows = ( 37 | ('temps-celsius', 'Temperature / °C', (0,)), 38 | ('temps-kelvin', 'Temperature / K', (1,)), 39 | ) 40 | 41 | def __init__(self): 42 | self.reset() 43 | 44 | def reset(self): 45 | self.state = 'IGNORE START REPEAT' 46 | self.data = [] 47 | 48 | def start(self): 49 | self.out_ann = self.register(srd.OUTPUT_ANN) 50 | 51 | def putx(self, data): 52 | self.put(self.ss, self.es, self.out_ann, data) 53 | 54 | # Quick hack implementation! This needs to be improved a lot! 55 | def decode(self, ss, es, data): 56 | cmd, databyte = data 57 | 58 | # State machine. 59 | if self.state == 'IGNORE START REPEAT': 60 | if cmd != 'START REPEAT': 61 | return 62 | self.state = 'IGNORE ADDRESS WRITE' 63 | elif self.state == 'IGNORE ADDRESS WRITE': 64 | if cmd != 'ADDRESS WRITE': 65 | return 66 | self.state = 'GET TEMPERATURE' 67 | elif self.state == 'GET TEMPERATURE': 68 | if cmd != 'DATA WRITE': 69 | return 70 | if len(self.data) == 0: 71 | self.data.append(databyte) 72 | self.ss = ss 73 | elif len(self.data) == 1: 74 | self.data.append(databyte) 75 | self.es = es 76 | else: 77 | kelvin = (self.data[0] | (self.data[1] << 8)) * 0.02 78 | celsius = kelvin - 273.15 79 | self.putx([0, ['Temperature: %3.2f °C' % celsius]]) 80 | self.putx([1, ['Temperature: %3.2f K' % kelvin]]) 81 | self.state = 'IGNORE START REPEAT' 82 | self.data = [] 83 | -------------------------------------------------------------------------------- /decoders/modbus/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Bart de Waal 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes Modbus RTU, 22 | a protocol with a single a client and one or more servers. 23 | 24 | The RX channel will be checked for both client->server and server->client 25 | communication, the TX channel only for client->server. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/morse/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2017 Christoph Rackwitz 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Morse code is a method of transmitting text information as a series of 22 | on-off tones. 23 | 24 | Details: 25 | https://en.wikipedia.org/wiki/Morse_code 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/mrf24j40/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Karl Palsson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes Microchip MRF24J40 22 | IEEE 802.15.4 2.4 GHz RF tranceiver commands and data. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/mxc6225xu/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the MEMSIC MXC6225XU 22 | digital thermal orientation sensor (DTOS) protocol. 23 | 24 | The chip's I²C interface supports standard mode and fast mode (max. 400kHz). 25 | Its I²C slave address is 0x2a. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/nes_gamepad/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Stephan Thiele 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the button states 22 | of an NES gamepad. 23 | 24 | The SPI decoder needs to be configured as follows: 25 | 26 | Clock polarity = 1 27 | Clock phase = 0 28 | Bit order = msb-first 29 | Word size = 8 30 | 31 | Chip-select is not used and must not be assigned to any channel. 32 | 33 | Hardware setup is as follows: 34 | ___ 35 | GND |o \ 36 | CUP |o o| VCC 37 | OUT 0 |o o| D3 38 | D1 |o o| D4 39 | ----- 40 | NES Gamepad Connector 41 | 42 | VCC - Power 5V 43 | GND - Ground 44 | CUP - Shift register clock (CLK) 45 | OUT 0 - Shift register latch (optional) 46 | D1 - Gamepad data (MOSI) 47 | D3 - Data (unused) 48 | D4 - Data (unused) 49 | 50 | Data pins D3 and D4 are not used by the standard gamepad but 51 | by special controllers like the Nintento Zapper light gun. 52 | ''' 53 | 54 | from .pd import Decoder 55 | -------------------------------------------------------------------------------- /decoders/nrf24l01/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Jens Steinhauser 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the protocol spoken 22 | by the Nordic Semiconductor nRF24L01 and nRF24L01+ 2.4GHz transceiver chips. 23 | 24 | Details: 25 | http://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01 26 | http://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01P 27 | ''' 28 | 29 | from .pd import Decoder 30 | -------------------------------------------------------------------------------- /decoders/nrf905/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Jorge Solla Rubiales 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, write to the Free Software 18 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | ## 20 | 21 | ''' 22 | This decoder stacks on top of the 'spi' PD and decodes the Nordic Semiconductor 23 | NRF905 (433/868/915MHz transceiver) command/responses. 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/numbers_and_state/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Comlab AG 5 | ## Copyright (C) 2020 Gerhard Sittig 6 | ## 7 | ## This program is free software; you can redistribute it and/or modify 8 | ## it under the terms of the GNU General Public License as published by 9 | ## the Free Software Foundation; either version 2 of the License, or 10 | ## (at your option) any later version. 11 | ## 12 | ## This program is distributed in the hope that it will be useful, 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ## GNU General Public License for more details. 16 | ## 17 | ## You should have received a copy of the GNU General Public License 18 | ## along with this program; if not, see . 19 | ## 20 | 21 | ''' 22 | This protocol decoder takes a set of logic input signals, and interprets 23 | their bit pattern according to user specifications as different kinds of 24 | numbers, or an enumeration of e.g. machine states. 25 | 26 | Supported formats are: signed and unsigned integers, fixed point numbers, 27 | IEEE754 floating point numbers, and number to text mapping controlled by 28 | external data files. (Support for half precision floats depends on the 29 | Python runtime, and may not universally be available.) 30 | 31 | User provided text mapping files can either use the JSON format: 32 | {"one": 1, "two": 2, "four": 4} 33 | or the Python programming language: 34 | enumtext = { 1: "one", 2: "two", 3: "three", } 35 | 36 | In addition to all enum values on one row (sequential presentation of 37 | the data), a limited number of enum values also are shown in tabular 38 | presentation, which can help visualize state machines or task switches. 39 | ''' 40 | 41 | from .pd import Decoder 42 | -------------------------------------------------------------------------------- /decoders/nunchuk/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the Nintendo Wii 22 | Nunchuk controller protocol. 23 | 24 | Details: 25 | http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck 26 | http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/ 27 | https://www.sparkfun.com/products/9281 28 | ''' 29 | 30 | from .pd import Decoder 31 | -------------------------------------------------------------------------------- /decoders/onewire_link/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## Copyright (C) 2017 Kevin Redon 6 | ## 7 | ## This program is free software; you can redistribute it and/or modify 8 | ## it under the terms of the GNU General Public License as published by 9 | ## the Free Software Foundation; either version 2 of the License, or 10 | ## (at your option) any later version. 11 | ## 12 | ## This program is distributed in the hope that it will be useful, 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ## GNU General Public License for more details. 16 | ## 17 | ## You should have received a copy of the GNU General Public License 18 | ## along with this program; if not, see . 19 | ## 20 | 21 | ''' 22 | This protocol decoder handles the 1-Wire link layer. 23 | 24 | The 1-Wire protocol enables bidirectional communication over a single wire 25 | (and ground) between a single master and one or multiple slaves. The protocol 26 | is layered: 27 | 28 | - Link layer (reset, presence detection, reading/writing bits) 29 | - Network layer (skip/search/match device ROM addresses) 30 | - Transport layer (transport data between 1-Wire master and device) 31 | 32 | Sample rate: 33 | A sufficiently high samplerate is required to properly detect all the elements 34 | of the protocol. A lower samplerate can be used if the master does not use 35 | overdrive communication speed. The following minimal values should be used: 36 | 37 | - overdrive available: 2MHz minimum, 5MHz suggested 38 | - overdrive not available: 400kHz minimum, 1MHz suggested 39 | 40 | Channels: 41 | 1-Wire requires a single signal, but some master implementations might have a 42 | separate signal used to deliver power to the bus during temperature conversion 43 | as an example. 44 | 45 | - owr (1-Wire signal line) 46 | 47 | Options: 48 | 1-Wire is an asynchronous protocol with fixed timing values, so the decoder 49 | must know the samplerate. 50 | Two speeds are available: normal and overdrive. The decoder detects when 51 | switching speed, but the user can set which to start decoding with: 52 | 53 | - overdrive (to decode starting with overdrive speed) 54 | ''' 55 | 56 | from .pd import Decoder 57 | -------------------------------------------------------------------------------- /decoders/onewire_network/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'onewire_link' PD and decodes the 22 | 1-Wire protocol (network layer). 23 | 24 | The 1-Wire protocol enables bidirectional communication over a single wire 25 | (and ground) between a single master and one or multiple slaves. The protocol 26 | is layered: 27 | 28 | - Link layer (reset, presence detection, reading/writing bits) 29 | - Network layer (skip/search/match device ROM addresses) 30 | - Transport layer (transport data between 1-Wire master and device) 31 | 32 | Network layer: 33 | 34 | The following link layer annotations are shown: 35 | 36 | - RESET/PRESENCE True/False 37 | The event is marked from the signal negative edge to the end of the reset 38 | high period. It is also reported if there are any devices attached to the 39 | bus. 40 | 41 | The following network layer annotations are shown: 42 | 43 | - ROM command 44 | The requested ROM command is displayed as an 8bit hex value and by name. 45 | - ROM 46 | The 64bit value of the addressed device is displayed: 47 | Family code (1 byte) + serial number (6 bytes) + CRC (1 byte) 48 | - Data 49 | Data intended for the transport layer is displayed as an 8bit hex value. 50 | 51 | TODO: 52 | - Add CRC checks, to see if there were communication errors on the wire. 53 | - Add reporting original/complement address values from the search algorithm. 54 | ''' 55 | 56 | from .pd import Decoder 57 | -------------------------------------------------------------------------------- /decoders/ook/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Steve R 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | OOK decodes On-off keying based remote control protocols. 22 | 23 | It is aimed at 433MHz but should also work with other common RC frequencies. 24 | The input can be captured directly from a transmitter (before the modulation 25 | stage) or demodulated by an RF receiver. 26 | 27 | Over the air captured traces will be a lot noisier and will probably need the 28 | area of interest to be zoomed onto, then selected with the "Cursors" and the 29 | "Save Selected Range As" feature to be used to extract it from the noise. 30 | 31 | There is a limited amount of pre-filtering and garbage removal built into the 32 | decoder which can sometimes extract signals directly from a larger over the air 33 | trace. It depends heavily on your environment. 34 | ''' 35 | 36 | from .pd import Decoder 37 | -------------------------------------------------------------------------------- /decoders/ook_oregon/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Steve R 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'ook' PD and decodes the Oregon Scientific 22 | 433MHz remote control protocol for weather sensors. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ook_oregon/lists.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Steve R 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | # Most of the info here comes from "434MHz RF Protocol Descriptions for 21 | # Wireless Weather Sensors - October 2015" Known Sensor ID Codes - p25. 22 | 23 | # Format is 4 hex digit ID code followed by a LIST of models that use that 24 | # ID and the type of sensor. 25 | # SensorID is used as the hash in a Python hash table, so it must be upper case. 26 | # The type of sensor is used to decode and display readings in the L2 decode, 27 | # it's case-sensitive. 28 | # Be very careful with the formatting ' [] and commas. 29 | 30 | sensor = { 31 | # 'SensorID': [['model1', 'model2'], 'type'], 32 | '1984': [['WGR800'], 'Wind'], # The newer anemometer with no temperature/RH sensor. 33 | '1994': [['WGR800'], 'Wind'], # The original anemometer which included a temperature/RH sensor. 34 | '1A2D': [['THGR228N'], 'Temp_Hum1'], 35 | '1A3D': [['THGR918'], ''], 36 | '1D20': [['THGN123N', 'THGR122NX', 'THGN123N', 'THGR228N'], 'Temp_Hum'], 37 | '1D30': [['THGN500', 'THGN132N'], ''], 38 | '2914': [['PCR800'], 'Rain'], 39 | '2A19': [['PCR800'], 'Rain1'], 40 | '2A1D': [['RGR918'], 'Rain'], 41 | '2D10': [['RGR968', 'PGR968 '], 'Rain1'], 42 | '3A0D': [['STR918', 'WGR918'], 'Wind'], 43 | '5A5D': [['BTHR918'], ''], 44 | '5A6D': [['BTHR918N'], 'Temp_Hum_Baro'], 45 | '5D53': [['BTHGN129'], 'Baro'], 46 | '5D60': [['BTHR968'], 'Temp_Hum_Baro'], 47 | 'C844': [['THWR800'], 'Temp'], 48 | 'CC13': [['RTGR328N'], 'Temp_Hum'], 49 | 'CC23': [['THGR328N'], 'Temp_Hum'], 50 | 'CD39': [['RTHR328N'], 'Temp'], 51 | 'D874': [['UVN800'], 'UV1'], 52 | 'EA4C': [['THWR288A'], 'Temp'], 53 | 'EC40': [['THN132N', 'THR238NF'], 'Temp'], 54 | 'EC70': [['UVR128'], 'UV'], 55 | 'F824': [['THGN800', 'THGN801', 'THGR810'], 'Temp_Hum'], 56 | 'F8B4': [['THGR810'], 'Temp_Hum'], 57 | # '': ['PSR01'], '', ''], 58 | # '': ['RTGR328NA'], '', ''], 59 | # '': ['THC268'], '', ''], 60 | # '': ['THWR288A-JD'], '', ''], 61 | # '': ['THGR268'], '', ''], 62 | # '': ['THR268'], '', ''], 63 | } 64 | 65 | # The sensor checksum exceptions are used to calculate the right checksum for 66 | # sensors that don't follow the v1, v2.1 and v3 methods. For instance a v2.1 67 | # sensor that has a v3 checksum. 68 | sensor_checksum = { 69 | # 'SensorID': ['checksum_method', 'comment'], 70 | '1D20': ['v3', 'THGR228N'], 71 | '5D60': ['v3', 'BTHR918N'], 72 | 'EC40': ['v3', 'THN132N'], 73 | } 74 | 75 | dir_table = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'] 76 | -------------------------------------------------------------------------------- /decoders/ook_vis/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Steve R 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'ook' PD and visualizes protocol details 22 | in various ways. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/pan1321/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'uart' PD and decodes the Panasonic PAN1321 22 | Bluetooth module Serial Port Profile (SPP) protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/parallel/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2013 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder can decode synchronous parallel buses with various 22 | data bits/channels counts, an (optional) clock line, and an (optional) 23 | select/enable/reset line. 24 | 25 | Data bits are taken from the decoder's lowest connected input pins. The 26 | input signal's data lines count need not span the full amount of the 27 | decoder's maximum supported data lines count. Not connected data lines 28 | are assumed to be low. 29 | 30 | Example use cases are: Connect D3/D2/D1/D0 (and CLK) to a 4-bit bus. 31 | Connect D7 and D6 to inspect the two most significant bits of an 8-bit 32 | bus (and have 8-bit values shown instead of just 2-bit values). 33 | 34 | When provided, the specified clock edge determines when data lines get 35 | sampled. Without a clock spec, each transition on any of the data lines 36 | will be shown, which can become busy/noisy depending on the input data. 37 | 38 | Another signal optionally can control the period of time within which 39 | the data lines' bit pattern gets interpreted. Typical use cases would be 40 | reset, or select, or enable signals that are related to the bus' data 41 | communication. This optional signal can also improve synchronization to 42 | wider payload data which spans several bus cycles (multiplexing). 43 | ''' 44 | 45 | from .pd import Decoder 46 | -------------------------------------------------------------------------------- /decoders/pca9571/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Mickael Bosch 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the NXP Semiconductors 22 | PCA9571 8-bit I²C output expander protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/pjdl/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Gerhard Sittig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder interprets the PJDL data link of the PJON protocol. 22 | Bytes and frames get extracted from single wire serial communication 23 | (which often is referred to as "software bitbang" because that's what 24 | the Arduino reference implementation happens to do). 25 | ''' 26 | 27 | from .pd import Decoder 28 | -------------------------------------------------------------------------------- /decoders/pjon/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Gerhard Sittig 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder interprets the PJON protocol on top of the PJDL 22 | link layer (and potentially other link layers). 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/ps2/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Daniel Schulte 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program. If not, see . 18 | ## 19 | 20 | ''' 21 | This protocol decoder can decode PS/2 device -> host communication. 22 | 23 | Host -> device communication is currently not supported. 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/pwm/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Torsten Duwe 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Pulse-width modulation (PWM) a.k.a pulse-duration modulation (PDM) decoder. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/qi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Josef Gajdusek 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder decodes demodulated data streams used by the Qi standard 22 | for communication from the receiver to the charging station. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/rc_encode/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Steve R 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This PD decodes the remote control protocol which is frequently used 22 | within key fobs and power socket remotes. 23 | 24 | They contain encoding chips like the PT2262 which converts the button 25 | pressed and address settings into a series of pulses which is then 26 | transmitted over whatever frequency and modulation that the designer 27 | chooses. These devices operate at a number of frequencies including 433MHz. 28 | 29 | This PD should also decode the HX2262 and SC5262 which are equivalents. 30 | 31 | The decoder also contains some additional decoding for a Maplin L95AR 32 | remote control and will turn the received signal into which button was 33 | pressed and what the address code DIP switches are set to. 34 | ''' 35 | 36 | from .pd import Decoder 37 | -------------------------------------------------------------------------------- /decoders/rfm12/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Sławek Piotrowski 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the HopeRF RFM12 22 | wireless transceiver control protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/rgb_led_spi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Matt Ranostay 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes generic RGB LED string 22 | values that are clocked over SPI in RGB values. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/rgb_led_spi/pd.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Matt Ranostay 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | import sigrokdecode as srd 21 | 22 | class Decoder(srd.Decoder): 23 | api_version = 3 24 | id = 'rgb_led_spi' 25 | name = 'RGB LED (SPI)' 26 | longname = 'RGB LED string decoder (SPI)' 27 | desc = 'RGB LED string protocol (RGB values clocked over SPI).' 28 | license = 'gplv2+' 29 | inputs = ['spi'] 30 | outputs = [] 31 | tags = ['Display'] 32 | annotations = ( 33 | ('rgb', 'RGB value'), 34 | ) 35 | 36 | def __init__(self): 37 | self.reset() 38 | 39 | def reset(self): 40 | self.ss_cmd, self.es_cmd = 0, 0 41 | self.mosi_bytes = [] 42 | 43 | def start(self): 44 | self.out_ann = self.register(srd.OUTPUT_ANN) 45 | 46 | def putx(self, data): 47 | self.put(self.ss_cmd, self.es_cmd, self.out_ann, data) 48 | 49 | def decode(self, ss, es, data): 50 | ptype, mosi, miso = data 51 | 52 | # Only care about data packets. 53 | if ptype != 'DATA': 54 | return 55 | self.ss, self.es = ss, es 56 | 57 | if len(self.mosi_bytes) == 0: 58 | self.ss_cmd = ss 59 | self.mosi_bytes.append(mosi) 60 | 61 | # RGB value == 3 bytes 62 | if len(self.mosi_bytes) != 3: 63 | return 64 | 65 | red, green, blue = self.mosi_bytes 66 | rgb_value = int(red) << 16 | int(green) << 8 | int(blue) 67 | 68 | self.es_cmd = es 69 | self.putx([0, ['#%.6x' % rgb_value]]) 70 | self.mosi_bytes = [] 71 | -------------------------------------------------------------------------------- /decoders/rgb_led_ws281x/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Vladimir Ermakov 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | WS281x RGB LED protocol decoder. 22 | 23 | Details: 24 | https://cpldcpu.wordpress.com/2014/01/14/light_ws2812-library-v2-0-part-i-understanding-the-ws2812/ 25 | ''' 26 | 27 | from .pd import Decoder 28 | -------------------------------------------------------------------------------- /decoders/rtc8564/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the Epson 22 | RTC-8564 JE/NB real-time clock (RTC) protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/sae_j1850_vpw/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Anthony Symons 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | SAE J1850 Variable Pulse Width decoder. Decode GM VPW 1X and 4X Vehicle Bus. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/sda2506/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Max Weller 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Decoder for Siemens EEPROM SDA 2506-5. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/sdcard_sd/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | SD card (SD mode) low-level protocol decoder. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/sdq/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019-2020 Philip Åkesson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The SDQ protocol was developed by Texas Instruments, and is used in 22 | devices like battery pack authentication. Apple uses SDQ in MagSafe 23 | and Lightning connectors, as well as some batteries. 24 | 25 | See https://www.ti.com/lit/ds/symlink/bq26100.pdf for details. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/seven_segment/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Benedikt Otto 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder decodes the output of a 7-segment display. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/signature/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Shirow Miura 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Signature analysis function for troubleshooting logic circuits. 22 | This generates the same signature as Hewlett-Packard 5004A. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/sipi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2020 Soeren Apel 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The Serial Inter-Processor Interface (SIPI) is a higher-level protocol that runs 22 | over the LFAST physical interface. Together, they form the NXP Zipwire interface. 23 | 24 | The SIPI interface is also provided by Infineon as HSST, using HSCT for transport. 25 | 26 | For details see https://www.nxp.com/docs/en/application-note/AN5134.pdf and 27 | https://hitex.co.uk/fileadmin/uk-files/downloads/ShieldBuddy/tc27xD_um_v2.2.pdf 28 | ''' 29 | 30 | from .pd import Decoder 31 | -------------------------------------------------------------------------------- /decoders/sle44xx/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Federico Cerutti 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | SLE 4418/28/32/42 memory cards implement a 2-wire protocol (CLK and I/O) 22 | for data communication, along with the RST signal which resets the card's 23 | internal state, and can terminate currently executing long memory reads. 24 | ''' 25 | 26 | from .pd import Decoder 27 | -------------------------------------------------------------------------------- /decoders/spdif/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Guenther Wenninger 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | S/PDIF (Sony/Philips Digital Interface Format) is a serial bus for 22 | transmitting audio data. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/spi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The SPI (Serial Peripheral Interface) protocol decoder supports synchronous 22 | SPI(-like) protocols with a clock line, a MISO and MOSI line for data 23 | transfer in two directions, and an optional CS# pin. 24 | 25 | Either MISO or MOSI (but not both) can be optional. 26 | 27 | If CS# is supplied, data is only decoded when CS# is asserted (clock 28 | transitions where CS# is not asserted are ignored). If CS# is not supplied, 29 | data is decoded on every clock transition (depending on SPI mode). 30 | ''' 31 | 32 | from .pd import Decoder 33 | -------------------------------------------------------------------------------- /decoders/spiflash/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012-2015 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the xx25 series 22 | SPI (NOR) flash chip protocol. 23 | 24 | It currently supports the MX25L1605D/MX25L3205D/MX25L6405D. 25 | 26 | Details: 27 | http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf 28 | ''' 29 | 30 | from .pd import Decoder 31 | -------------------------------------------------------------------------------- /decoders/ssi32/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Robert Bosch Car Multimedia GmbH 5 | ## Authors: Oleksij Rempel 6 | ## 7 | ## 8 | ## 9 | ## This program is free software; you can redistribute it and/or modify 10 | ## it under the terms of the GNU General Public License as published by 11 | ## the Free Software Foundation; either version 2 of the License, or 12 | ## (at your option) any later version. 13 | ## 14 | ## This program is distributed in the hope that it will be useful, 15 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ## GNU General Public License for more details. 18 | ## 19 | ## You should have received a copy of the GNU General Public License 20 | ## along with this program; if not, see . 21 | ## 22 | 23 | ''' 24 | This decoder stacks on top of the 'spi' PD and decodes the Bosch 25 | SSI32 protocol. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/st25r39xx_spi/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019-2020 Benjamin Vernoux 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the SPI PD and decodes the st25r39xx High performance NFC universal device and EMVCo reader protocol (SPI mode). 22 | 23 | It has been successfully tested with the st25r3916, other chips of this family may or may not be fully supported but not been verified. 24 | 25 | Please note that the SPI interface uses clock polarity 0 and clock phase 1, which is not the default setting. 26 | 27 | Details: 28 | https://www.st.com/resource/en/datasheet/st25r3916.pdf 29 | ''' 30 | 31 | from .pd import Decoder 32 | -------------------------------------------------------------------------------- /decoders/st7735/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Aleksander Alekseev 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder decodes the Sitronix ST7735 TFT controller protocol. 22 | 23 | Details: 24 | http://www.displayfuture.com/Display/datasheet/controller/ST7735.pdf 25 | ''' 26 | 27 | from .pd import Decoder 28 | -------------------------------------------------------------------------------- /decoders/stepper_motor/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Petteri Aimonen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This PD decodes the stepper motor controller signals (step / dir) and 22 | shows the step speed and absolute position of the stepper motor. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/swd/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Angus Gratton 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This PD decodes the ARM SWD (version 1) protocol, as described in the 22 | "ARM Debug Interface v5.2" Architecture Specification. 23 | 24 | Not supported: 25 | * Turnaround periods other than the default 1, as set in DLCR.TURNROUND 26 | (should be trivial to add) 27 | * SWD protocol version 2 (multi-drop support, etc.) 28 | 29 | Details: 30 | http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ihi0031c/index.html 31 | (Registration required) 32 | ''' 33 | 34 | from .pd import Decoder 35 | -------------------------------------------------------------------------------- /decoders/swim/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Mike Jagdis 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | SWIM is a single wire interface for STM8 series 8-bit microcontrollers 22 | that allows non-intrusive read/wite access to be performed on-the-fly 23 | to the memory and registers of the MCU for debug and flashing purposes. 24 | 25 | See the STMicroelectronics document UM0470 for details. 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/t55xx/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Benjamin Larsson 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | T55xx is a 100-150kHz RFID protocol according to the Atmel e555x 22 | downlink/write protocol (pulse interval coding). 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/tca6408a/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 alberink 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'i2c' PD and decodes the Texas Instruments 22 | TCA6408A 8-bit I²C I/O expander protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/tdm_audio/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Ben Dooks 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | TDM Audio is an audio serial bus for moving audio data between devices 22 | (usually on the same board) which can carry one or more channels of data. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/timing/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Torsten Duwe 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | Timing decoder, find the time between edges. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/tlc5620/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The Texas Instruments TLC5620 is an 8-bit quad DAC. 22 | ''' 23 | 24 | from .pd import Decoder 25 | -------------------------------------------------------------------------------- /decoders/uart/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | UART (Universal Asynchronous Receiver Transmitter) is a simple serial 22 | communication protocol which allows two devices to talk to each other. 23 | 24 | This decoder should work on all "UART-like" async protocols with one 25 | start bit (0), 5-9 databits, an (optional) parity bit, and one or more 26 | stop bits (1), in this order. 27 | 28 | It can be run on one signal line (RX or TX) only, or on two lines (RX + TX). 29 | 30 | There are various standards for the physical layer specification of the 31 | signals, including RS232, (TTL) UART, RS485, and others. However, the logic 32 | level of the respective pins is only relevant when acquiring the data via 33 | a logic analyzer (you have to select the correct logic analyzer and/or 34 | the correct place where to probe). Once the data is in digital form and 35 | matches the "UART" description above, this protocol decoder can work with 36 | it though, no matter whether the source was on TTL UART levels, or RS232, 37 | or others. 38 | ''' 39 | 40 | from .pd import Decoder 41 | -------------------------------------------------------------------------------- /decoders/usb_packet/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'usb_signalling' PD and decodes the USB 22 | (low-speed and full-speed) packet protocol. 23 | 24 | Protocol layer (USB spec, chapter 8): 25 | 26 | Bit/byte ordering: Bits are sent onto the bus LSB-first. Multibyte fields 27 | are transmitted in little-endian order (i.e., LSB to MSB). 28 | 29 | SYNC field: All packets begin with a SYNC field (8 bits). 30 | 31 | Packet field format: Packets start with an SOP (Start Of Packet) delimiter 32 | that is part of the SYNC field, and end with an EOP (End Of Packet). 33 | 34 | PID: A PID (packet identifier) follows the SYNC field of every packet. A PID 35 | consists of a 4-bit packet type field, and a 4 bit check field. 36 | The check field is the one's complement of the packet type field. 37 | 38 | Details: 39 | https://en.wikipedia.org/wiki/USB 40 | http://www.usb.org/developers/docs/ 41 | ''' 42 | 43 | from .pd import Decoder 44 | -------------------------------------------------------------------------------- /decoders/usb_power_delivery/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Google, Inc 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | USB Power Delivery - baseband protocol decoder / checker. 22 | ''' 23 | 24 | from .pd import * 25 | -------------------------------------------------------------------------------- /decoders/usb_request/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2015 Stefan Brüns 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'usb_packet' PD and decodes the USB 22 | (low-speed and full-speed) transactions. 23 | 24 | Transactions and requests are tracked per device address and endpoint. 25 | 26 | Tracking of CONTROL requests is quite accurate, as these always start with 27 | a SETUP token and are completed by an IN or OUT transaction, the status 28 | packet. All transactions during the DATA stage are combined. 29 | 30 | For BULK and INTERRUPT requests, each transaction starts with an IN or OUT 31 | request, and is considered completed after the first transaction containing 32 | data has been ACKed. Normally a request is only completed after a short or 33 | zero length packet, but this would require knowledge about the max packet 34 | size of an endpoint. 35 | 36 | All INTERRUPT requests are treated as BULK requests, as on the link layer 37 | both are identical. 38 | 39 | The PCAP binary output contains 'SUBMIT' and 'COMPLETE' records. For 40 | CONTROL request, the SUBMIT contains the SETUP request, the data is 41 | either contained in the SUBMIT (Host-to-Device) or the COMPLETE 42 | (Device-to-Host) record. 43 | 44 | Details: 45 | https://en.wikipedia.org/wiki/USB 46 | http://www.usb.org/developers/docs/ 47 | ''' 48 | 49 | from .pd import Decoder 50 | -------------------------------------------------------------------------------- /decoders/usb_signalling/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2012 Uwe Hermann 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This PD decodes the USB (low-speed and full-speed) signalling protocol. 22 | 23 | Electrical/signalling layer (USB spec, chapter 7): 24 | 25 | USB signalling consists of two signal lines, both driven at 3.3V 26 | logic levels. The signals are DP (D+) and DM (D-), and normally operate in 27 | differential mode. 28 | 29 | Low-speed: The state where DP=1,DM=0 is K, the state DP=0,DM=1 is J. 30 | Full-speed: The state where DP=1,DM=0 is J, the state DP=0,DM=1 is K. 31 | 32 | A state SE0 is defined where DP=DM=0. This common mode signal is used to 33 | signal a reset or end of packet (EOP). A state SE1 is defined where DP=DM=1. 34 | 35 | Data transmitted on the USB is encoded with NRZI. A transition from J to K 36 | or vice-versa indicates a logic 0, while no transition indicates a logic 1. 37 | If 6 ones are transmitted consecutively, a zero is inserted to force a 38 | transition. This is known as bit stuffing. 39 | 40 | Data is transferred at a rate of 1.5Mbit/s (low-speed) / 12Mbit/s (full-speed). 41 | 42 | The SE0 transmitted to signal an end-of-packet is two bit intervals long 43 | (low-speed: 1.25uS - 1.50uS, full-speed: 160ns - 175ns). 44 | 45 | Details: 46 | https://en.wikipedia.org/wiki/USB 47 | http://www.usb.org/developers/docs/ 48 | ''' 49 | 50 | from .pd import Decoder 51 | -------------------------------------------------------------------------------- /decoders/wiegand/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2016 Sean Burford 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The Wiegand interface is a de facto wiring standard commonly used to connect 22 | a card swipe mechanism to the rest of an electronic entry system. 23 | 24 | Details: 25 | https://en.wikipedia.org/wiki/Wiegand_interface 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/x2444m/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2018 Stefan Petersen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This decoder stacks on top of the 'spi' PD and decodes the Xicor X2444M/P 22 | nonvolatile static RAM protocol. 23 | ''' 24 | 25 | from .pd import Decoder 26 | -------------------------------------------------------------------------------- /decoders/xfp/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2013 Bert Vermeulen 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | This PD decodes the XFP I²C management interface structures/protocol. 22 | 23 | XFP modules include an I²C interface, used to monitor and control various 24 | aspects of the module. The specification defines an I²C slave at address 25 | 0x50 (0xa0) which returns 128 bytes of a standard structure ("lower memory"), 26 | and, after setting a table number in lower memory, a set of 256 "higher 27 | memory" tables, which can be mapped to different subdevices on the XFP. 28 | 29 | Only one table is defined in the specification: table 0x01, the default on 30 | module startup. Other table are either reserved for future expansion, or 31 | available for vendor-specific extensions. This decoder supports both lower 32 | memory and table 0x01. 33 | 34 | Details: 35 | ftp://ftp.seagate.com/sff/INF-8077.PDF (XFP specification) 36 | ''' 37 | 38 | from .pd import Decoder 39 | -------------------------------------------------------------------------------- /decoders/xy2-100/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2019 Uli Huber 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 2 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | XY2-100 is a serial bus for connecting galvo systems to controllers 22 | 23 | Details: 24 | 25 | http://www.newson.be/doc.php?id=XY2-100 26 | ''' 27 | 28 | from .pd import Decoder 29 | -------------------------------------------------------------------------------- /decoders/z80/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libsigrokdecode project. 3 | ## 4 | ## Copyright (C) 2014 Daniel Elstner 5 | ## 6 | ## This program is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This program is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with this program; if not, see . 18 | ## 19 | 20 | ''' 21 | The Zilog Z80 is an 8-bit microprocessor compatible with the Intel 8080. 22 | 23 | In addition to the 8-bit data bus, this decoder requires the input signals 24 | /M1 (machine cycle), /RD (read) and /WR (write) to do its work. An explicit 25 | clock signal is not required. However, the Z80 CPU clock may be used as 26 | sampling clock, if applicable. 27 | 28 | Notes on the Z80 opcode format and descriptions of both documented and 29 | "undocumented" opcodes are available here: 30 | 31 | Details: 32 | http://www.z80.info/decoding.htm 33 | http://clrhome.org/table/ 34 | ''' 35 | 36 | from .pd import Decoder 37 | -------------------------------------------------------------------------------- /irmp/README-sigrok.txt: -------------------------------------------------------------------------------- 1 | This directory contains a subset of the IRMP project source code. Then 2 | extends it to allow sigrok protocol decoders to use the IRMP backend. 3 | See README.txt for information on the IRMP project itself. 4 | -------------------------------------------------------------------------------- /irmp/README.txt: -------------------------------------------------------------------------------- 1 | IRMP - Infrared Multi Protocol Decoder 2 | -------------------------------------- 3 | 4 | Version IRMP: 3.1.5 2019-08-27 5 | Version IRSND: 3.1.5 2019-08-28 6 | 7 | Documentation: 8 | 9 | http://www.mikrocontroller.net/articles/IRMP 10 | http://www.mikrocontroller.net/articles/IRMP_-_english 11 | 12 | http://www.mikrocontroller.net/articles/IRSND 13 | http://www.mikrocontroller.net/articles/IRSND_-_english 14 | -------------------------------------------------------------------------------- /irmp/irmp-main-sharedlib.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossasia/libsigrokdecode/3f77dc2aae971c4ba97ad81c851c63b681074410/irmp/irmp-main-sharedlib.c -------------------------------------------------------------------------------- /irmp/irmp-main-sharedlib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossasia/libsigrokdecode/3f77dc2aae971c4ba97ad81c851c63b681074410/irmp/irmp-main-sharedlib.h -------------------------------------------------------------------------------- /irmp/irmp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossasia/libsigrokdecode/3f77dc2aae971c4ba97ad81c851c63b681074410/irmp/irmp.c -------------------------------------------------------------------------------- /libsigrokdecode.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | datarootdir=@datarootdir@ 6 | datadir=@datadir@ 7 | pkgdatadir=${datadir}/@PACKAGE_TARNAME@ 8 | decodersdir=${pkgdatadir}/decoders 9 | 10 | Name: libsigrokdecode 11 | Description: Protocol decoder library of the sigrok logic analyzer software 12 | URL: http://www.sigrok.org 13 | Requires: glib-2.0 14 | Requires.private: @SRD_PKGLIBS@ 15 | Version: @SRD_PACKAGE_VERSION@ 16 | Libs: -L${libdir} -lsigrokdecode 17 | Libs.private: @SRD_EXTRA_LIBS@ 18 | Cflags: -I${includedir} 19 | -------------------------------------------------------------------------------- /module_sigrokdecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the libsigrokdecode project. 3 | * 4 | * Copyright (C) 2012 Bert Vermeulen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include "libsigrokdecode-internal.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */ 22 | #include "libsigrokdecode.h" 23 | 24 | /** @cond PRIVATE */ 25 | 26 | /* 27 | * When initialized, a reference to this module inside the Python interpreter 28 | * lives here. 29 | */ 30 | SRD_PRIV PyObject *mod_sigrokdecode = NULL; 31 | 32 | /** @endcond */ 33 | 34 | static struct PyModuleDef sigrokdecode_module = { 35 | PyModuleDef_HEAD_INIT, 36 | .m_name = "sigrokdecode", 37 | .m_doc = "sigrokdecode module", 38 | .m_size = -1, 39 | }; 40 | 41 | /** @cond PRIVATE */ 42 | PyMODINIT_FUNC PyInit_sigrokdecode(void) 43 | { 44 | PyObject *mod, *Decoder_type; 45 | PyGILState_STATE gstate; 46 | 47 | gstate = PyGILState_Ensure(); 48 | 49 | mod = PyModule_Create(&sigrokdecode_module); 50 | if (!mod) 51 | goto err_out; 52 | 53 | Decoder_type = srd_Decoder_type_new(); 54 | if (!Decoder_type) 55 | goto err_out; 56 | if (PyModule_AddObject(mod, "Decoder", Decoder_type) < 0) 57 | goto err_out; 58 | 59 | /* Expose output types as symbols in the sigrokdecode module */ 60 | if (PyModule_AddIntConstant(mod, "OUTPUT_ANN", SRD_OUTPUT_ANN) < 0) 61 | goto err_out; 62 | if (PyModule_AddIntConstant(mod, "OUTPUT_PYTHON", SRD_OUTPUT_PYTHON) < 0) 63 | goto err_out; 64 | if (PyModule_AddIntConstant(mod, "OUTPUT_BINARY", SRD_OUTPUT_BINARY) < 0) 65 | goto err_out; 66 | if (PyModule_AddIntConstant(mod, "OUTPUT_META", SRD_OUTPUT_META) < 0) 67 | goto err_out; 68 | /* Expose meta input symbols. */ 69 | if (PyModule_AddIntConstant(mod, "SRD_CONF_SAMPLERATE", SRD_CONF_SAMPLERATE) < 0) 70 | goto err_out; 71 | 72 | mod_sigrokdecode = mod; 73 | 74 | PyGILState_Release(gstate); 75 | 76 | return mod; 77 | 78 | err_out: 79 | Py_XDECREF(mod); 80 | srd_exception_catch("Failed to initialize module"); 81 | PyGILState_Release(gstate); 82 | 83 | return NULL; 84 | } 85 | 86 | /** @endcond */ 87 | -------------------------------------------------------------------------------- /tests/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the libsigrokdecode project. 3 | * 4 | * Copyright (C) 2013 Uwe Hermann 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #ifndef LIBSIGROKDECODE_TESTS_LIB_H 21 | #define LIBSIGROKDECODE_TESTS_LIB_H 22 | 23 | void srdtest_setup(void); 24 | void srdtest_teardown(void); 25 | 26 | Suite *suite_core(void); 27 | Suite *suite_decoder(void); 28 | Suite *suite_inst(void); 29 | Suite *suite_session(void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /tests/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the libsigrokdecode project. 3 | * 4 | * Copyright (C) 2013 Uwe Hermann 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, see . 18 | */ 19 | 20 | #include 21 | #include /* First, to avoid compiler warning. */ 22 | #include 23 | #include 24 | #include "lib.h" 25 | 26 | void srdtest_setup(void) 27 | { 28 | /* Silence libsigrokdecode while the unit tests run. */ 29 | srd_log_loglevel_set(SRD_LOG_NONE); 30 | } 31 | 32 | void srdtest_teardown(void) 33 | { 34 | } 35 | 36 | int main(void) 37 | { 38 | int ret; 39 | Suite *s; 40 | SRunner *srunner; 41 | 42 | s = suite_create("mastersuite"); 43 | srunner = srunner_create(s); 44 | 45 | /* Add all testsuites to the master suite. */ 46 | srunner_add_suite(srunner, suite_core()); 47 | srunner_add_suite(srunner, suite_decoder()); 48 | srunner_add_suite(srunner, suite_inst()); 49 | srunner_add_suite(srunner, suite_session()); 50 | 51 | srunner_run_all(srunner, CK_VERBOSE); 52 | ret = srunner_ntests_failed(srunner); 53 | srunner_free(srunner); 54 | 55 | return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 56 | } 57 | -------------------------------------------------------------------------------- /version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the libsigrokdecode project. 3 | * 4 | * Copyright (C) 2010 Uwe Hermann 5 | * Copyright (C) 2012 Bert Vermeulen 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBSIGROKDECODE_VERSION_H 22 | #define LIBSIGROKDECODE_VERSION_H 23 | 24 | /** 25 | * @file 26 | * 27 | * Version number definitions and macros. 28 | */ 29 | 30 | /** 31 | * @ingroup grp_versions 32 | * 33 | * @{ 34 | */ 35 | 36 | /* 37 | * Package version macros (can be used for conditional compilation). 38 | */ 39 | 40 | /** The libsigrokdecode package 'major' version number. */ 41 | #undef SRD_PACKAGE_VERSION_MAJOR 42 | 43 | /** The libsigrokdecode package 'minor' version number. */ 44 | #undef SRD_PACKAGE_VERSION_MINOR 45 | 46 | /** The libsigrokdecode package 'micro' version number. */ 47 | #undef SRD_PACKAGE_VERSION_MICRO 48 | 49 | /** The libsigrokdecode package version ("major.minor.micro") as string. */ 50 | #undef SRD_PACKAGE_VERSION_STRING 51 | 52 | /* 53 | * Library/libtool version macros (can be used for conditional compilation). 54 | */ 55 | 56 | /** The libsigrokdecode libtool 'current' version number. */ 57 | #undef SRD_LIB_VERSION_CURRENT 58 | 59 | /** The libsigrokdecode libtool 'revision' version number. */ 60 | #undef SRD_LIB_VERSION_REVISION 61 | 62 | /** The libsigrokdecode libtool 'age' version number. */ 63 | #undef SRD_LIB_VERSION_AGE 64 | 65 | /** The libsigrokdecode libtool version ("current:revision:age") as string. */ 66 | #undef SRD_LIB_VERSION_STRING 67 | 68 | /** @} */ 69 | 70 | #endif 71 | --------------------------------------------------------------------------------