logic-agent-mcp 0.0.0-stage → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.cmd +5 -0
- package/CAPTURE.cmd +8 -0
- package/CHECK.cmd +7 -0
- package/FIRMWARE-RECOVER.cmd +6 -0
- package/FIRMWARE-STATUS.cmd +8 -0
- package/INSTALL-DRIVER.cmd +6 -0
- package/INSTALL-MCP.cmd +16 -0
- package/LICENSE +31 -0
- package/MCP.cmd +5 -0
- package/README.md +127 -2
- package/SELF-TEST.cmd +6 -0
- package/THIRD-PARTY-NOTICES.md +32 -0
- package/VERIFY-FILES.cmd +6 -0
- package/VERSION.txt +17 -0
- package/VIEW.cmd +16 -0
- package/checksums.sha256 +449 -0
- package/docs/DRIVER.md +54 -0
- package/docs/DSLOGIC-PLUS.md +180 -0
- package/docs/FIRMWARE.md +53 -0
- package/docs/INSTALL.md +74 -0
- package/docs/MCP-CLIENTS.md +200 -0
- package/docs/PROTOCOLS.md +200 -0
- package/docs/TROUBLESHOOTING.md +41 -0
- package/docs/UPSTREAM-SYNC.md +141 -0
- package/docs/WAVEFORM-VIEWER.md +48 -0
- package/firmware/DSLogicPlus.fw +0 -0
- package/firmware/LICENSE-DreamSourceLab.txt +20 -0
- package/launcher/logic-agent-mcp.mjs +106 -0
- package/package.json +56 -6
- package/runtime/app/logic_agent/__init__.py +4 -0
- package/runtime/app/logic_agent/analysis.py +84 -0
- package/runtime/app/logic_agent/backends/__init__.py +7 -0
- package/runtime/app/logic_agent/backends/base.py +37 -0
- package/runtime/app/logic_agent/backends/dslab.py +278 -0
- package/runtime/app/logic_agent/backends/mock.py +101 -0
- package/runtime/app/logic_agent/backends/sigrok.py +252 -0
- package/runtime/app/logic_agent/cli.py +387 -0
- package/runtime/app/logic_agent/decoders.py +868 -0
- package/runtime/app/logic_agent/errors.py +50 -0
- package/runtime/app/logic_agent/importer.py +129 -0
- package/runtime/app/logic_agent/mcp_clients.py +956 -0
- package/runtime/app/logic_agent/mcp_server.py +345 -0
- package/runtime/app/logic_agent/models.py +150 -0
- package/runtime/app/logic_agent/protocols.py +233 -0
- package/runtime/app/logic_agent/service.py +378 -0
- package/runtime/app/logic_agent/signal.py +206 -0
- package/runtime/app/logic_agent/store.py +197 -0
- package/runtime/bin/_bz2.pyd +0 -0
- package/runtime/bin/_ctypes.pyd +0 -0
- package/runtime/bin/_decimal.pyd +0 -0
- package/runtime/bin/_elementtree.pyd +0 -0
- package/runtime/bin/_hashlib.pyd +0 -0
- package/runtime/bin/_lzma.pyd +0 -0
- package/runtime/bin/_multiprocessing.pyd +0 -0
- package/runtime/bin/_socket.pyd +0 -0
- package/runtime/bin/_sqlite3.pyd +0 -0
- package/runtime/bin/_ssl.pyd +0 -0
- package/runtime/bin/dslab.exe +0 -0
- package/runtime/bin/libglib-2.0-0.dll +0 -0
- package/runtime/bin/libiconv-2.dll +0 -0
- package/runtime/bin/libintl-8.dll +0 -0
- package/runtime/bin/libpcre2-8-0.dll +0 -0
- package/runtime/bin/libusb-1.0.dll +0 -0
- package/runtime/bin/libwinpthread-1.dll +0 -0
- package/runtime/bin/msvcp100.dll +0 -0
- package/runtime/bin/msvcr100.dll +0 -0
- package/runtime/bin/pyexpat.pyd +0 -0
- package/runtime/bin/python34.dll +0 -0
- package/runtime/bin/python34.zip +0 -0
- package/runtime/bin/res/DSCope.bin +0 -0
- package/runtime/bin/res/DSCope.fw +0 -0
- package/runtime/bin/res/DSCope1.def.dsc +88 -0
- package/runtime/bin/res/DSCope2.def.dsc +54 -0
- package/runtime/bin/res/DSCope20.bin +0 -0
- package/runtime/bin/res/DSCope20.fw +0 -0
- package/runtime/bin/res/DSCopeC20B.bin +0 -0
- package/runtime/bin/res/DSCopeC20P.bin +0 -0
- package/runtime/bin/res/DSCopeU2B100.bin +0 -0
- package/runtime/bin/res/DSCopeU2B20.bin +0 -0
- package/runtime/bin/res/DSCopeU2P20.bin +0 -0
- package/runtime/bin/res/DSCopeU3P100.bin +0 -0
- package/runtime/bin/res/DSLogic.fw +0 -0
- package/runtime/bin/res/DSLogic0.def.dsc +297 -0
- package/runtime/bin/res/DSLogic1.def.dsc +82 -0
- package/runtime/bin/res/DSLogic2.def.dsc +52 -0
- package/runtime/bin/res/DSLogic33.bin +0 -0
- package/runtime/bin/res/DSLogic50.bin +0 -0
- package/runtime/bin/res/DSLogicBasic.bin +0 -0
- package/runtime/bin/res/DSLogicPlus-pgl12-2.bin +0 -0
- package/runtime/bin/res/DSLogicPlus-pgl12.bin +0 -0
- package/runtime/bin/res/DSLogicPlus.bin +0 -0
- package/runtime/bin/res/DSLogicPlus.fw +0 -0
- package/runtime/bin/res/DSLogicPro.bin +0 -0
- package/runtime/bin/res/DSLogicPro.fw +0 -0
- package/runtime/bin/res/DSLogicU2Basic-pgl12-2.bin +0 -0
- package/runtime/bin/res/DSLogicU2Basic-pgl12.bin +0 -0
- package/runtime/bin/res/DSLogicU2Basic.bin +0 -0
- package/runtime/bin/res/DSLogicU2Pro16.bin +0 -0
- package/runtime/bin/res/DSLogicU3Pro16.bin +0 -0
- package/runtime/bin/res/DSLogicU3Pro32.bin +0 -0
- package/runtime/bin/res/license.txt +20 -0
- package/runtime/bin/res/virtual-demo1.dsc +68 -0
- package/runtime/bin/select.pyd +0 -0
- package/runtime/bin/sigrok-cli.exe +0 -0
- package/runtime/bin/unicodedata.pyd +0 -0
- package/runtime/bin/winsound.pyd +0 -0
- package/runtime/bin/zlib1.dll +0 -0
- package/runtime/decoders/ac97/__init__.py +38 -0
- package/runtime/decoders/ac97/pd.py +477 -0
- package/runtime/decoders/ad5626/__init__.py +25 -0
- package/runtime/decoders/ad5626/pd.py +62 -0
- package/runtime/decoders/ad79x0/__init__.py +25 -0
- package/runtime/decoders/ad79x0/pd.py +137 -0
- package/runtime/decoders/ade77xx/__init__.py +31 -0
- package/runtime/decoders/ade77xx/lists.py +102 -0
- package/runtime/decoders/ade77xx/pd.py +131 -0
- package/runtime/decoders/adf435x/__init__.py +29 -0
- package/runtime/decoders/adf435x/pd.py +230 -0
- package/runtime/decoders/adns5020/__init__.py +27 -0
- package/runtime/decoders/adns5020/pd.py +116 -0
- package/runtime/decoders/adxl345/__init__.py +26 -0
- package/runtime/decoders/adxl345/lists.py +96 -0
- package/runtime/decoders/adxl345/pd.py +453 -0
- package/runtime/decoders/am230x/__init__.py +36 -0
- package/runtime/decoders/am230x/pd.py +229 -0
- package/runtime/decoders/amulet_ascii/__init__.py +28 -0
- package/runtime/decoders/amulet_ascii/lists.py +73 -0
- package/runtime/decoders/amulet_ascii/pd.py +699 -0
- package/runtime/decoders/arm_etmv3/__init__.py +25 -0
- package/runtime/decoders/arm_etmv3/pd.py +567 -0
- package/runtime/decoders/arm_itm/__init__.py +25 -0
- package/runtime/decoders/arm_itm/pd.py +373 -0
- package/runtime/decoders/arm_tpiu/__init__.py +28 -0
- package/runtime/decoders/arm_tpiu/pd.py +131 -0
- package/runtime/decoders/atsha204a/__init__.py +30 -0
- package/runtime/decoders/atsha204a/pd.py +323 -0
- package/runtime/decoders/aud/__init__.py +31 -0
- package/runtime/decoders/aud/pd.py +108 -0
- package/runtime/decoders/avr_isp/__init__.py +25 -0
- package/runtime/decoders/avr_isp/parts.py +163 -0
- package/runtime/decoders/avr_isp/pd.py +278 -0
- package/runtime/decoders/avr_pdi/__init__.py +42 -0
- package/runtime/decoders/avr_pdi/pd.py +574 -0
- package/runtime/decoders/caliper/__init__.py +36 -0
- package/runtime/decoders/caliper/pd.py +146 -0
- package/runtime/decoders/can/__init__.py +31 -0
- package/runtime/decoders/can/pd.py +519 -0
- package/runtime/decoders/cc1101/__init__.py +28 -0
- package/runtime/decoders/cc1101/lists.py +115 -0
- package/runtime/decoders/cc1101/pd.py +294 -0
- package/runtime/decoders/cec/__init__.py +25 -0
- package/runtime/decoders/cec/pd.py +311 -0
- package/runtime/decoders/cec/protocoldata.py +117 -0
- package/runtime/decoders/cfp/__init__.py +34 -0
- package/runtime/decoders/cfp/pd.py +110 -0
- package/runtime/decoders/cjtag/__init__.py +36 -0
- package/runtime/decoders/cjtag/pd.py +323 -0
- package/runtime/decoders/common/__init__.py +19 -0
- package/runtime/decoders/common/plugtrx/__init__.py +20 -0
- package/runtime/decoders/common/plugtrx/mod.py +192 -0
- package/runtime/decoders/common/sdcard/__init__.py +20 -0
- package/runtime/decoders/common/sdcard/mod.py +150 -0
- package/runtime/decoders/common/srdhelper/__init__.py +20 -0
- package/runtime/decoders/common/srdhelper/mod.py +98 -0
- package/runtime/decoders/counter/__init__.py +28 -0
- package/runtime/decoders/counter/pd.py +145 -0
- package/runtime/decoders/dali/__init__.py +24 -0
- package/runtime/decoders/dali/lists.py +98 -0
- package/runtime/decoders/dali/pd.py +244 -0
- package/runtime/decoders/dcf77/__init__.py +28 -0
- package/runtime/decoders/dcf77/pd.py +311 -0
- package/runtime/decoders/dmx512/__init__.py +25 -0
- package/runtime/decoders/dmx512/pd.py +361 -0
- package/runtime/decoders/ds1307/__init__.py +25 -0
- package/runtime/decoders/ds1307/pd.py +270 -0
- package/runtime/decoders/ds2408/__init__.py +25 -0
- package/runtime/decoders/ds2408/pd.py +129 -0
- package/runtime/decoders/ds243x/__init__.py +25 -0
- package/runtime/decoders/ds243x/pd.py +270 -0
- package/runtime/decoders/ds28ea00/__init__.py +25 -0
- package/runtime/decoders/ds28ea00/pd.py +93 -0
- package/runtime/decoders/dsi/__init__.py +24 -0
- package/runtime/decoders/dsi/pd.py +157 -0
- package/runtime/decoders/edid/__init__.py +35 -0
- package/runtime/decoders/edid/pd.py +671 -0
- package/runtime/decoders/edid/pnpids.txt +2135 -0
- package/runtime/decoders/eeprom24xx/__init__.py +25 -0
- package/runtime/decoders/eeprom24xx/lists.py +214 -0
- package/runtime/decoders/eeprom24xx/pd.py +443 -0
- package/runtime/decoders/eeprom93xx/__init__.py +32 -0
- package/runtime/decoders/eeprom93xx/pd.py +163 -0
- package/runtime/decoders/em4100/__init__.py +24 -0
- package/runtime/decoders/em4100/pd.py +238 -0
- package/runtime/decoders/em4305/__init__.py +24 -0
- package/runtime/decoders/em4305/pd.py +394 -0
- package/runtime/decoders/enc28j60/__init__.py +32 -0
- package/runtime/decoders/enc28j60/lists.py +161 -0
- package/runtime/decoders/enc28j60/pd.py +294 -0
- package/runtime/decoders/flexray/__init__.py +32 -0
- package/runtime/decoders/flexray/pd.py +413 -0
- package/runtime/decoders/graycode/__init__.py +24 -0
- package/runtime/decoders/graycode/pd.py +197 -0
- package/runtime/decoders/guess_bitrate/__init__.py +40 -0
- package/runtime/decoders/guess_bitrate/pd.py +79 -0
- package/runtime/decoders/hdcp/__init__.py +27 -0
- package/runtime/decoders/hdcp/pd.py +191 -0
- package/runtime/decoders/i2c/__init__.py +25 -0
- package/runtime/decoders/i2c/pd.py +364 -0
- package/runtime/decoders/i2cdemux/__init__.py +27 -0
- package/runtime/decoders/i2cdemux/pd.py +80 -0
- package/runtime/decoders/i2cfilter/__init__.py +37 -0
- package/runtime/decoders/i2cfilter/pd.py +106 -0
- package/runtime/decoders/i2s/__init__.py +29 -0
- package/runtime/decoders/i2s/pd.py +179 -0
- package/runtime/decoders/ieee488/__init__.py +26 -0
- package/runtime/decoders/ieee488/pd.py +849 -0
- package/runtime/decoders/ir_irmp/__init__.py +25 -0
- package/runtime/decoders/ir_irmp/irmp_library.py +168 -0
- package/runtime/decoders/ir_irmp/pd.py +139 -0
- package/runtime/decoders/ir_nec/__init__.py +25 -0
- package/runtime/decoders/ir_nec/lists.py +93 -0
- package/runtime/decoders/ir_nec/pd.py +300 -0
- package/runtime/decoders/ir_rc5/__init__.py +24 -0
- package/runtime/decoders/ir_rc5/lists.py +93 -0
- package/runtime/decoders/ir_rc5/pd.py +182 -0
- package/runtime/decoders/ir_rc6/__init__.py +24 -0
- package/runtime/decoders/ir_rc6/pd.py +205 -0
- package/runtime/decoders/ir_sirc/__init__.py +26 -0
- package/runtime/decoders/ir_sirc/lists.py +201 -0
- package/runtime/decoders/ir_sirc/pd.py +215 -0
- package/runtime/decoders/jitter/__init__.py +29 -0
- package/runtime/decoders/jitter/pd.py +198 -0
- package/runtime/decoders/jtag/__init__.py +30 -0
- package/runtime/decoders/jtag/pd.py +235 -0
- package/runtime/decoders/jtag_ejtag/__init__.py +25 -0
- package/runtime/decoders/jtag_ejtag/pd.py +408 -0
- package/runtime/decoders/jtag_stm32/__init__.py +29 -0
- package/runtime/decoders/jtag_stm32/pd.py +269 -0
- package/runtime/decoders/lfast/__init__.py +35 -0
- package/runtime/decoders/lfast/pd.py +335 -0
- package/runtime/decoders/lin/__init__.py +28 -0
- package/runtime/decoders/lin/pd.py +247 -0
- package/runtime/decoders/lm75/__init__.py +25 -0
- package/runtime/decoders/lm75/pd.py +186 -0
- package/runtime/decoders/lpc/__init__.py +25 -0
- package/runtime/decoders/lpc/pd.py +365 -0
- package/runtime/decoders/ltc242x/__init__.py +25 -0
- package/runtime/decoders/ltc242x/pd.py +86 -0
- package/runtime/decoders/ltc26x7/__init__.py +25 -0
- package/runtime/decoders/ltc26x7/pd.py +187 -0
- package/runtime/decoders/maple_bus/__init__.py +25 -0
- package/runtime/decoders/maple_bus/pd.py +222 -0
- package/runtime/decoders/max72xx/__init__.py +25 -0
- package/runtime/decoders/max72xx/pd.py +130 -0
- package/runtime/decoders/mcp230xx/__init__.py +25 -0
- package/runtime/decoders/mcp230xx/pd.py +143 -0
- package/runtime/decoders/mcs48/__init__.py +31 -0
- package/runtime/decoders/mcs48/pd.py +126 -0
- package/runtime/decoders/mdio/__init__.py +39 -0
- package/runtime/decoders/mdio/pd.py +325 -0
- package/runtime/decoders/microwire/__init__.py +40 -0
- package/runtime/decoders/microwire/pd.py +194 -0
- package/runtime/decoders/midi/__init__.py +28 -0
- package/runtime/decoders/midi/lists.py +840 -0
- package/runtime/decoders/midi/pd.py +627 -0
- package/runtime/decoders/miller/__init__.py +26 -0
- package/runtime/decoders/miller/pd.py +190 -0
- package/runtime/decoders/mlx90614/__init__.py +25 -0
- package/runtime/decoders/mlx90614/pd.py +82 -0
- package/runtime/decoders/modbus/__init__.py +28 -0
- package/runtime/decoders/modbus/pd.py +941 -0
- package/runtime/decoders/morse/__init__.py +28 -0
- package/runtime/decoders/morse/pd.py +250 -0
- package/runtime/decoders/mrf24j40/__init__.py +25 -0
- package/runtime/decoders/mrf24j40/lists.py +165 -0
- package/runtime/decoders/mrf24j40/pd.py +188 -0
- package/runtime/decoders/mxc6225xu/__init__.py +28 -0
- package/runtime/decoders/mxc6225xu/pd.py +217 -0
- package/runtime/decoders/nes_gamepad/__init__.py +54 -0
- package/runtime/decoders/nes_gamepad/pd.py +92 -0
- package/runtime/decoders/nrf24l01/__init__.py +29 -0
- package/runtime/decoders/nrf24l01/pd.py +332 -0
- package/runtime/decoders/nrf905/__init__.py +26 -0
- package/runtime/decoders/nrf905/pd.py +301 -0
- package/runtime/decoders/numbers_and_state/__init__.py +41 -0
- package/runtime/decoders/numbers_and_state/pd.py +377 -0
- package/runtime/decoders/nunchuk/__init__.py +30 -0
- package/runtime/decoders/nunchuk/pd.py +207 -0
- package/runtime/decoders/onewire_link/__init__.py +56 -0
- package/runtime/decoders/onewire_link/pd.py +347 -0
- package/runtime/decoders/onewire_network/__init__.py +56 -0
- package/runtime/decoders/onewire_network/pd.py +185 -0
- package/runtime/decoders/ook/__init__.py +36 -0
- package/runtime/decoders/ook/pd.py +484 -0
- package/runtime/decoders/ook_oregon/__init__.py +25 -0
- package/runtime/decoders/ook_oregon/lists.py +75 -0
- package/runtime/decoders/ook_oregon/pd.py +389 -0
- package/runtime/decoders/ook_vis/__init__.py +25 -0
- package/runtime/decoders/ook_vis/pd.py +194 -0
- package/runtime/decoders/pan1321/__init__.py +25 -0
- package/runtime/decoders/pan1321/pd.py +164 -0
- package/runtime/decoders/parallel/__init__.py +45 -0
- package/runtime/decoders/parallel/pd.py +285 -0
- package/runtime/decoders/pca9571/__init__.py +25 -0
- package/runtime/decoders/pca9571/pd.py +122 -0
- package/runtime/decoders/pjdl/__init__.py +27 -0
- package/runtime/decoders/pjdl/pd.py +723 -0
- package/runtime/decoders/pjon/__init__.py +25 -0
- package/runtime/decoders/pjon/pd.py +603 -0
- package/runtime/decoders/ps2/__init__.py +26 -0
- package/runtime/decoders/ps2/pd.py +126 -0
- package/runtime/decoders/pwm/__init__.py +24 -0
- package/runtime/decoders/pwm/pd.py +167 -0
- package/runtime/decoders/qi/__init__.py +25 -0
- package/runtime/decoders/qi/pd.py +244 -0
- package/runtime/decoders/rc_encode/__init__.py +40 -0
- package/runtime/decoders/rc_encode/pd.py +215 -0
- package/runtime/decoders/rfm12/__init__.py +25 -0
- package/runtime/decoders/rfm12/pd.py +497 -0
- package/runtime/decoders/rgb_led_spi/__init__.py +25 -0
- package/runtime/decoders/rgb_led_spi/pd.py +72 -0
- package/runtime/decoders/rgb_led_ws281x/__init__.py +27 -0
- package/runtime/decoders/rgb_led_ws281x/pd.py +267 -0
- package/runtime/decoders/rtc8564/__init__.py +25 -0
- package/runtime/decoders/rtc8564/pd.py +254 -0
- package/runtime/decoders/sae_j1850_vpw/__init__.py +24 -0
- package/runtime/decoders/sae_j1850_vpw/pd.py +296 -0
- package/runtime/decoders/sbus_futaba/__init__.py +35 -0
- package/runtime/decoders/sbus_futaba/pd.py +273 -0
- package/runtime/decoders/sda2506/__init__.py +24 -0
- package/runtime/decoders/sda2506/pd.py +146 -0
- package/runtime/decoders/sdcard_sd/__init__.py +24 -0
- package/runtime/decoders/sdcard_sd/pd.py +554 -0
- package/runtime/decoders/sdcard_spi/__init__.py +68 -0
- package/runtime/decoders/sdcard_spi/pd.py +518 -0
- package/runtime/decoders/sdq/__init__.py +28 -0
- package/runtime/decoders/sdq/pd.py +131 -0
- package/runtime/decoders/seven_segment/__init__.py +24 -0
- package/runtime/decoders/seven_segment/pd.py +186 -0
- package/runtime/decoders/signature/__init__.py +25 -0
- package/runtime/decoders/signature/pd.py +142 -0
- package/runtime/decoders/sipi/__init__.py +30 -0
- package/runtime/decoders/sipi/pd.py +181 -0
- package/runtime/decoders/sle44xx/__init__.py +26 -0
- package/runtime/decoders/sle44xx/pd.py +541 -0
- package/runtime/decoders/smart_qspi/PORTING.md +22 -0
- package/runtime/decoders/smart_qspi/__init__.py +1 -0
- package/runtime/decoders/smart_qspi/pd.py +826 -0
- package/runtime/decoders/spdif/__init__.py +25 -0
- package/runtime/decoders/spdif/pd.py +295 -0
- package/runtime/decoders/spi/__init__.py +32 -0
- package/runtime/decoders/spi/pd.py +347 -0
- package/runtime/decoders/spiflash/__init__.py +30 -0
- package/runtime/decoders/spiflash/lists.py +178 -0
- package/runtime/decoders/spiflash/pd.py +537 -0
- package/runtime/decoders/ssi32/__init__.py +28 -0
- package/runtime/decoders/ssi32/pd.py +127 -0
- package/runtime/decoders/st25r39xx_spi/__init__.py +31 -0
- package/runtime/decoders/st25r39xx_spi/lists.py +231 -0
- package/runtime/decoders/st25r39xx_spi/pd.py +360 -0
- package/runtime/decoders/st7735/__init__.py +27 -0
- package/runtime/decoders/st7735/pd.py +173 -0
- package/runtime/decoders/stepper_motor/__init__.py +25 -0
- package/runtime/decoders/stepper_motor/pd.py +95 -0
- package/runtime/decoders/swd/__init__.py +34 -0
- package/runtime/decoders/swd/pd.py +350 -0
- package/runtime/decoders/swim/__init__.py +28 -0
- package/runtime/decoders/swim/pd.py +303 -0
- package/runtime/decoders/t55xx/__init__.py +25 -0
- package/runtime/decoders/t55xx/pd.py +326 -0
- package/runtime/decoders/tca6408a/__init__.py +25 -0
- package/runtime/decoders/tca6408a/pd.py +157 -0
- package/runtime/decoders/tdm_audio/__init__.py +25 -0
- package/runtime/decoders/tdm_audio/pd.py +116 -0
- package/runtime/decoders/timing/__init__.py +24 -0
- package/runtime/decoders/timing/pd.py +194 -0
- package/runtime/decoders/tlc5620/__init__.py +24 -0
- package/runtime/decoders/tlc5620/pd.py +212 -0
- package/runtime/decoders/uart/__init__.py +40 -0
- package/runtime/decoders/uart/pd.py +635 -0
- package/runtime/decoders/usb_packet/__init__.py +43 -0
- package/runtime/decoders/usb_packet/pd.py +401 -0
- package/runtime/decoders/usb_power_delivery/__init__.py +24 -0
- package/runtime/decoders/usb_power_delivery/pd.py +642 -0
- package/runtime/decoders/usb_request/__init__.py +49 -0
- package/runtime/decoders/usb_request/pd.py +386 -0
- package/runtime/decoders/usb_signalling/__init__.py +50 -0
- package/runtime/decoders/usb_signalling/pd.py +348 -0
- package/runtime/decoders/wiegand/__init__.py +28 -0
- package/runtime/decoders/wiegand/pd.py +148 -0
- package/runtime/decoders/x2444m/__init__.py +25 -0
- package/runtime/decoders/x2444m/pd.py +111 -0
- package/runtime/decoders/xfp/__init__.py +38 -0
- package/runtime/decoders/xfp/pd.py +486 -0
- package/runtime/decoders/xy2-100/__init__.py +28 -0
- package/runtime/decoders/xy2-100/pd.py +242 -0
- package/runtime/decoders/z80/__init__.py +36 -0
- package/runtime/decoders/z80/pd.py +358 -0
- package/runtime/decoders/z80/tables.py +1083 -0
- package/runtime/dslab.cmd +5 -0
- package/runtime/licenses/DreamSourceLab-res-MIT.txt +20 -0
- package/runtime/licenses/dslab-GPL-3.0.txt +674 -0
- package/runtime/licenses/logic-agent-MIT.txt +31 -0
- package/runtime/licenses/python-PSF.txt +645 -0
- package/runtime/licenses/sigrok-cli-GPL-3.0.txt +674 -0
- package/runtime/licenses/smart_qspi-PORTING.md +22 -0
- package/runtime/licenses/source/patches/dsview-v1.3.2-dslab.patch +124 -0
- package/runtime/logic-agent-mcp.cmd +9 -0
- package/runtime/logic-agent.cmd +9 -0
- package/runtime/python/LICENSE.txt +645 -0
- package/runtime/python/_asyncio.pyd +0 -0
- package/runtime/python/_bz2.pyd +0 -0
- package/runtime/python/_ctypes.pyd +0 -0
- package/runtime/python/_decimal.pyd +0 -0
- package/runtime/python/_elementtree.pyd +0 -0
- package/runtime/python/_hashlib.pyd +0 -0
- package/runtime/python/_lzma.pyd +0 -0
- package/runtime/python/_multiprocessing.pyd +0 -0
- package/runtime/python/_overlapped.pyd +0 -0
- package/runtime/python/_queue.pyd +0 -0
- package/runtime/python/_socket.pyd +0 -0
- package/runtime/python/_sqlite3.pyd +0 -0
- package/runtime/python/_ssl.pyd +0 -0
- package/runtime/python/_uuid.pyd +0 -0
- package/runtime/python/_wmi.pyd +0 -0
- package/runtime/python/_zoneinfo.pyd +0 -0
- package/runtime/python/libcrypto-3.dll +0 -0
- package/runtime/python/libffi-8.dll +0 -0
- package/runtime/python/libssl-3.dll +0 -0
- package/runtime/python/pyexpat.pyd +0 -0
- package/runtime/python/python.cat +0 -0
- package/runtime/python/python.exe +0 -0
- package/runtime/python/python3.dll +0 -0
- package/runtime/python/python313._pth +3 -0
- package/runtime/python/python313.dll +0 -0
- package/runtime/python/python313.zip +0 -0
- package/runtime/python/pythonw.exe +0 -0
- package/runtime/python/select.pyd +0 -0
- package/runtime/python/sqlite3.dll +0 -0
- package/runtime/python/unicodedata.pyd +0 -0
- package/runtime/python/vcruntime140.dll +0 -0
- package/runtime/python/vcruntime140_1.dll +0 -0
- package/runtime/python/winsound.pyd +0 -0
- package/runtime/scripts/deploy-check.ps1 +171 -0
- package/scripts/check.ps1 +14 -0
- package/scripts/firmware-recover.ps1 +27 -0
- package/scripts/install-driver.ps1 +30 -0
- package/scripts/self-test.ps1 +14 -0
- package/scripts/verify-files.py +39 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2015 Benjamin Larsson <benjamin@southpole.se>
|
|
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 <http://www.gnu.org/licenses/>.
|
|
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 = 't55xx'
|
|
28
|
+
name = 'T55xx'
|
|
29
|
+
longname = 'RFID T55xx'
|
|
30
|
+
desc = 'T55xx 100-150kHz RFID protocol.'
|
|
31
|
+
license = 'gplv2+'
|
|
32
|
+
inputs = ['logic']
|
|
33
|
+
outputs = []
|
|
34
|
+
tags = ['IC', 'RFID']
|
|
35
|
+
channels = (
|
|
36
|
+
{'id': 'data', 'name': 'Data', 'desc': 'Data line'},
|
|
37
|
+
)
|
|
38
|
+
options = (
|
|
39
|
+
{'id': 'coilfreq', 'desc': 'Coil frequency', 'default': 125000},
|
|
40
|
+
{'id': 'start_gap', 'desc': 'Start gap min', 'default': 20},
|
|
41
|
+
{'id': 'w_gap', 'desc': 'Write gap min', 'default': 20},
|
|
42
|
+
{'id': 'w_one_min', 'desc': 'Write one min', 'default': 48},
|
|
43
|
+
{'id': 'w_one_max', 'desc': 'Write one max', 'default': 63},
|
|
44
|
+
{'id': 'w_zero_min', 'desc': 'Write zero min', 'default': 16},
|
|
45
|
+
{'id': 'w_zero_max', 'desc': 'Write zero max', 'default': 31},
|
|
46
|
+
{'id': 'em4100_decode', 'desc': 'EM4100 decode', 'default': 'on',
|
|
47
|
+
'values': ('on', 'off')},
|
|
48
|
+
)
|
|
49
|
+
annotations = (
|
|
50
|
+
('bit_value', 'Bit value'),
|
|
51
|
+
('start_gap', 'Start gap'),
|
|
52
|
+
('write_gap', 'Write gap'),
|
|
53
|
+
('write_mode_exit', 'Write mode exit'),
|
|
54
|
+
('bit', 'Bit'),
|
|
55
|
+
('opcode', 'Opcode'),
|
|
56
|
+
('lock', 'Lock'),
|
|
57
|
+
('data', 'Data'),
|
|
58
|
+
('password', 'Password'),
|
|
59
|
+
('address', 'Address'),
|
|
60
|
+
('bitrate', 'Bitrate'),
|
|
61
|
+
)
|
|
62
|
+
annotation_rows = (
|
|
63
|
+
('bits', 'Bits', (0,)),
|
|
64
|
+
('structure', 'Structure', (1, 2, 3, 4)),
|
|
65
|
+
('fields', 'Fields', (5, 6, 7, 8, 9)),
|
|
66
|
+
('decode', 'Decode', (10,)),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
def __init__(self):
|
|
70
|
+
self.reset()
|
|
71
|
+
|
|
72
|
+
def reset(self):
|
|
73
|
+
self.samplerate = None
|
|
74
|
+
self.last_samplenum = None
|
|
75
|
+
self.lastlast_samplenum = None
|
|
76
|
+
self.state = 'START_GAP'
|
|
77
|
+
self.bits_pos = [[0 for col in range(3)] for row in range(70)]
|
|
78
|
+
self.br_string = ['RF/8', 'RF/16', 'RF/32', 'RF/40',
|
|
79
|
+
'RF/50', 'RF/64', 'RF/100', 'RF/128']
|
|
80
|
+
self.mod_str1 = ['Direct', 'Manchester', 'Biphase', 'Reserved']
|
|
81
|
+
self.mod_str2 = ['Direct', 'PSK1', 'PSK2', 'PSK3', 'FSK1', 'FSK2',
|
|
82
|
+
'FSK1a', 'FSK2a']
|
|
83
|
+
self.pskcf_str = ['RF/2', 'RF/4', 'RF/8', 'Reserved']
|
|
84
|
+
self.em4100_decode1_partial = 0
|
|
85
|
+
|
|
86
|
+
def metadata(self, key, value):
|
|
87
|
+
if key == srd.SRD_CONF_SAMPLERATE:
|
|
88
|
+
self.samplerate = value
|
|
89
|
+
self.field_clock = self.samplerate / self.options['coilfreq']
|
|
90
|
+
self.wzmax = self.options['w_zero_max'] * self.field_clock
|
|
91
|
+
self.wzmin = self.options['w_zero_min'] * self.field_clock
|
|
92
|
+
self.womax = self.options['w_one_max'] * self.field_clock
|
|
93
|
+
self.womin = self.options['w_one_min'] * self.field_clock
|
|
94
|
+
self.startgap = self.options['start_gap'] * self.field_clock
|
|
95
|
+
self.writegap = self.options['w_gap'] * self.field_clock
|
|
96
|
+
self.nogap = 64 * self.field_clock
|
|
97
|
+
|
|
98
|
+
def start(self):
|
|
99
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
100
|
+
|
|
101
|
+
def decode_config(self, idx):
|
|
102
|
+
safer_key = self.bits_pos[idx][0]<<3 | self.bits_pos[idx+1][0]<<2 | \
|
|
103
|
+
self.bits_pos[idx+2][0]<<1 | self.bits_pos[idx+3][0]
|
|
104
|
+
self.put(self.bits_pos[idx][1], self.bits_pos[idx+3][2], self.out_ann,
|
|
105
|
+
[10, ['Safer Key' + ': %X' % safer_key,'%X' % safer_key]])
|
|
106
|
+
bitrate = self.bits_pos[idx+11][0]<<2 | self.bits_pos[idx+12][0]<<1 | \
|
|
107
|
+
self.bits_pos[idx+13][0]
|
|
108
|
+
self.put(self.bits_pos[idx+11][1], self.bits_pos[idx+13][2],
|
|
109
|
+
self.out_ann, [10, ['Data Bit Rate: ' + \
|
|
110
|
+
self.br_string[bitrate], self.br_string[bitrate]]])
|
|
111
|
+
modulation1 = self.bits_pos[idx+15][0]<<1 | self.bits_pos[idx+16][0]
|
|
112
|
+
modulation2 = self.bits_pos[idx+17][0]<<2 | \
|
|
113
|
+
self.bits_pos[idx+18][0]<<1 | self.bits_pos[idx+19][0]
|
|
114
|
+
if modulation1 == 0:
|
|
115
|
+
mod_string = self.mod_str2[modulation2]
|
|
116
|
+
else:
|
|
117
|
+
mod_string = self.mod_str1[modulation1]
|
|
118
|
+
self.put(self.bits_pos[idx+15][1], self.bits_pos[idx+19][2],
|
|
119
|
+
self.out_ann, [10, ['Modulation: ' + mod_string, mod_string]])
|
|
120
|
+
psk_cf = self.bits_pos[idx+20][0]<<1 | self.bits_pos[idx+21][0]
|
|
121
|
+
self.put(self.bits_pos[idx+20][1], self.bits_pos[idx+21][2],
|
|
122
|
+
self.out_ann, [10, ['PSK-CF: ' + self.pskcf_str[psk_cf],
|
|
123
|
+
self.pskcf_str[psk_cf]]])
|
|
124
|
+
self.put(self.bits_pos[idx+22][1], self.bits_pos[idx+22][2],
|
|
125
|
+
self.out_ann, [10, ['AOR' + ': %d' % \
|
|
126
|
+
(self.bits_pos[idx+22][0]),'%d' % (self.bits_pos[idx+22][0])]])
|
|
127
|
+
maxblock = self.bits_pos[idx+24][0]<<2 | self.bits_pos[idx+25][0]<<1 | \
|
|
128
|
+
self.bits_pos[idx+26][0]
|
|
129
|
+
self.put(self.bits_pos[idx+24][1], self.bits_pos[idx+26][2],
|
|
130
|
+
self.out_ann, [10, ['Max-Block' + ': %d' % maxblock,
|
|
131
|
+
'%d' % maxblock]])
|
|
132
|
+
self.put(self.bits_pos[idx+27][1], self.bits_pos[idx+27][2],
|
|
133
|
+
self.out_ann, [10, ['PWD' + ': %d' % \
|
|
134
|
+
(self.bits_pos[idx+27][0]),'%d' % (self.bits_pos[idx+27][0])]])
|
|
135
|
+
self.put(self.bits_pos[idx+28][1], self.bits_pos[idx+28][2],
|
|
136
|
+
self.out_ann, [10, ['ST-sequence terminator' + ': %d' % \
|
|
137
|
+
(self.bits_pos[idx+28][0]),'%d' % (self.bits_pos[idx+28][0])]])
|
|
138
|
+
self.put(self.bits_pos[idx+31][1], self.bits_pos[idx+31][2],
|
|
139
|
+
self.out_ann, [10, ['POR delay' + ': %d' % \
|
|
140
|
+
(self.bits_pos[idx+31][0]),'%d' % (self.bits_pos[idx+31][0])]])
|
|
141
|
+
|
|
142
|
+
def put4bits(self, idx):
|
|
143
|
+
bits = self.bits_pos[idx][0]<<3 | self.bits_pos[idx+1][0]<<2 | \
|
|
144
|
+
self.bits_pos[idx+2][0]<<1 | self.bits_pos[idx+3][0]
|
|
145
|
+
self.put(self.bits_pos[idx][1], self.bits_pos[idx+3][2], self.out_ann,
|
|
146
|
+
[10, ['%X' % bits]])
|
|
147
|
+
|
|
148
|
+
def em4100_decode1(self, idx):
|
|
149
|
+
self.put(self.bits_pos[idx][1], self.bits_pos[idx+8][2], self.out_ann,
|
|
150
|
+
[10, ['EM4100 header', 'EM header', 'Header', 'H']])
|
|
151
|
+
self.put4bits(idx+9)
|
|
152
|
+
self.put4bits(idx+14)
|
|
153
|
+
self.put4bits(idx+19)
|
|
154
|
+
self.put4bits(idx+24)
|
|
155
|
+
self.em4100_decode1_partial = self.bits_pos[idx+29][0]<<3 | \
|
|
156
|
+
self.bits_pos[idx+30][0]<<2 | self.bits_pos[idx+31][0]<<1
|
|
157
|
+
self.put(self.bits_pos[idx+29][1], self.bits_pos[idx+31][2],
|
|
158
|
+
self.out_ann, [10, ['Partial nibble']])
|
|
159
|
+
|
|
160
|
+
def em4100_decode2(self, idx):
|
|
161
|
+
if self.em4100_decode1_partial != 0:
|
|
162
|
+
bits = self.em4100_decode1_partial + self.bits_pos[idx][0]
|
|
163
|
+
self.put(self.bits_pos[idx][1], self.bits_pos[idx][2],
|
|
164
|
+
self.out_ann, [10, ['%X' % bits]])
|
|
165
|
+
self.em4100_decode1_partial = 0
|
|
166
|
+
else:
|
|
167
|
+
self.put(self.bits_pos[idx][1], self.bits_pos[idx][2],
|
|
168
|
+
self.out_ann, [10, ['Partial nibble']])
|
|
169
|
+
|
|
170
|
+
self.put4bits(idx+2)
|
|
171
|
+
self.put4bits(idx+7)
|
|
172
|
+
self.put4bits(idx+12)
|
|
173
|
+
self.put4bits(idx+17)
|
|
174
|
+
self.put4bits(idx+22)
|
|
175
|
+
self.put(self.bits_pos[idx+27][1], self.bits_pos[idx+31][2],
|
|
176
|
+
self.out_ann, [10, ['EM4100 trailer']])
|
|
177
|
+
|
|
178
|
+
def get_32_bits(self, idx):
|
|
179
|
+
retval = 0
|
|
180
|
+
for i in range(0, 32):
|
|
181
|
+
retval <<= 1
|
|
182
|
+
retval |= self.bits_pos[i+idx][0]
|
|
183
|
+
return retval
|
|
184
|
+
|
|
185
|
+
def get_3_bits(self, idx):
|
|
186
|
+
retval = self.bits_pos[idx][0]<<2 | self.bits_pos[idx+1][0]<<1 | \
|
|
187
|
+
self.bits_pos[idx+2][0]
|
|
188
|
+
return retval
|
|
189
|
+
|
|
190
|
+
def put_fields(self):
|
|
191
|
+
if (self.bit_nr == 70):
|
|
192
|
+
self.put(self.bits_pos[0][1], self.bits_pos[1][2], self.out_ann,
|
|
193
|
+
[5, ['Opcode' + ': %d%d' % (self.bits_pos[0][0],
|
|
194
|
+
self.bits_pos[1][0]), '%d%d' % (self.bits_pos[0][0],
|
|
195
|
+
self.bits_pos[1][0])]])
|
|
196
|
+
password = self.get_32_bits(2)
|
|
197
|
+
self.put(self.bits_pos[2][1], self.bits_pos[33][2], self.out_ann,
|
|
198
|
+
[8, ['Password' + ': %X' % password, '%X' % password]])
|
|
199
|
+
self.put(self.bits_pos[34][1], self.bits_pos[34][2], self.out_ann,
|
|
200
|
+
[6, ['Lock' + ': %X' % self.bits_pos[34][0],
|
|
201
|
+
'%X' % self.bits_pos[34][0]]])
|
|
202
|
+
data = self.get_32_bits(35)
|
|
203
|
+
self.put(self.bits_pos[35][1], self.bits_pos[66][2], self.out_ann,
|
|
204
|
+
[7, ['Data' + ': %X' % data, '%X' % data]])
|
|
205
|
+
addr = self.get_3_bits(67)
|
|
206
|
+
self.put(self.bits_pos[67][1], self.bits_pos[69][2], self.out_ann,
|
|
207
|
+
[9, ['Addr' + ': %X' % addr, '%X' % addr]])
|
|
208
|
+
if addr == 0:
|
|
209
|
+
self.decode_config(35)
|
|
210
|
+
if addr == 7:
|
|
211
|
+
self.put(self.bits_pos[35][1], self.bits_pos[66][2],
|
|
212
|
+
self.out_ann, [10, ['Password' + ': %X' % data,
|
|
213
|
+
'%X' % data]])
|
|
214
|
+
# If we are programming EM4100 data we can decode it halfway.
|
|
215
|
+
if addr == 1 and self.options['em4100_decode'] == 'on':
|
|
216
|
+
self.em4100_decode1(35)
|
|
217
|
+
if addr == 2 and self.options['em4100_decode'] == 'on':
|
|
218
|
+
self.em4100_decode2(35)
|
|
219
|
+
|
|
220
|
+
if (self.bit_nr == 38):
|
|
221
|
+
self.put(self.bits_pos[0][1], self.bits_pos[1][2], self.out_ann,
|
|
222
|
+
[5, ['Opcode' + ': %d%d' % (self.bits_pos[0][0],
|
|
223
|
+
self.bits_pos[1][0]), '%d%d' % (self.bits_pos[0][0],
|
|
224
|
+
self.bits_pos[1][0])]])
|
|
225
|
+
self.put(self.bits_pos[2][1], self.bits_pos[2][2], self.out_ann,
|
|
226
|
+
[6, ['Lock' + ': %X' % self.bits_pos[2][0],
|
|
227
|
+
'%X' % self.bits_pos[2][0]]])
|
|
228
|
+
data = self.get_32_bits(3)
|
|
229
|
+
self.put(self.bits_pos[3][1], self.bits_pos[34][2], self.out_ann,
|
|
230
|
+
[7, ['Data' + ': %X' % data, '%X' % data]])
|
|
231
|
+
addr = self.get_3_bits(35)
|
|
232
|
+
self.put(self.bits_pos[35][1], self.bits_pos[37][2], self.out_ann,
|
|
233
|
+
[9, ['Addr' + ': %X' % addr, '%X' % addr]])
|
|
234
|
+
if addr == 0:
|
|
235
|
+
self.decode_config(3)
|
|
236
|
+
if addr == 7:
|
|
237
|
+
self.put(self.bits_pos[3][1], self.bits_pos[34][2],
|
|
238
|
+
self.out_ann, [10, ['Password' + ': %X' % data,
|
|
239
|
+
'%X' % data]])
|
|
240
|
+
# If we are programming EM4100 data we can decode it halfway.
|
|
241
|
+
if addr == 1 and self.options['em4100_decode'] == 'on':
|
|
242
|
+
self.em4100_decode1(3)
|
|
243
|
+
if addr == 2 and self.options['em4100_decode'] == 'on':
|
|
244
|
+
self.em4100_decode2(3)
|
|
245
|
+
|
|
246
|
+
if (self.bit_nr == 2):
|
|
247
|
+
self.put(self.bits_pos[0][1], self.bits_pos[1][2], self.out_ann,
|
|
248
|
+
[5, ['Opcode' + ': %d%d' % (self.bits_pos[0][0],
|
|
249
|
+
self.bits_pos[1][0]), '%d%d' % (self.bits_pos[0][0],
|
|
250
|
+
self.bits_pos[1][0])]])
|
|
251
|
+
self.bit_nr = 0
|
|
252
|
+
|
|
253
|
+
def add_bits_pos(self, bit, bit_start, bit_end):
|
|
254
|
+
if self.bit_nr < 70:
|
|
255
|
+
self.bits_pos[self.bit_nr][0] = bit
|
|
256
|
+
self.bits_pos[self.bit_nr][1] = bit_start
|
|
257
|
+
self.bits_pos[self.bit_nr][2] = bit_end
|
|
258
|
+
self.bit_nr += 1
|
|
259
|
+
|
|
260
|
+
def decode(self):
|
|
261
|
+
if not self.samplerate:
|
|
262
|
+
raise SamplerateError('Cannot decode without samplerate.')
|
|
263
|
+
|
|
264
|
+
self.last_samplenum = 0
|
|
265
|
+
self.lastlast_samplenum = 0
|
|
266
|
+
self.last_edge = 0
|
|
267
|
+
self.oldpl = 0
|
|
268
|
+
self.oldpp = 0
|
|
269
|
+
self.oldsamplenum = 0
|
|
270
|
+
self.last_bit_pos = 0
|
|
271
|
+
self.old_gap_start = 0
|
|
272
|
+
self.old_gap_end = 0
|
|
273
|
+
self.gap_detected = 0
|
|
274
|
+
self.bit_nr = 0
|
|
275
|
+
|
|
276
|
+
while True:
|
|
277
|
+
(pin,) = self.wait({0: 'e'})
|
|
278
|
+
|
|
279
|
+
pl = self.samplenum - self.oldsamplenum
|
|
280
|
+
pp = pin
|
|
281
|
+
samples = self.samplenum - self.last_samplenum
|
|
282
|
+
|
|
283
|
+
if self.state == 'WRITE_GAP':
|
|
284
|
+
if pl > self.writegap:
|
|
285
|
+
self.gap_detected = 1
|
|
286
|
+
self.put(self.last_samplenum, self.samplenum,
|
|
287
|
+
self.out_ann, [2, ['Write gap']])
|
|
288
|
+
if (self.last_samplenum-self.old_gap_end) > self.nogap:
|
|
289
|
+
self.gap_detected = 0
|
|
290
|
+
self.state = 'START_GAP'
|
|
291
|
+
self.put(self.old_gap_end, self.last_samplenum,
|
|
292
|
+
self.out_ann, [3, ['Write mode exit']])
|
|
293
|
+
self.put_fields()
|
|
294
|
+
|
|
295
|
+
if self.state == 'START_GAP':
|
|
296
|
+
if pl > self.startgap:
|
|
297
|
+
self.gap_detected = 1
|
|
298
|
+
self.put(self.last_samplenum, self.samplenum,
|
|
299
|
+
self.out_ann, [1, ['Start gap']])
|
|
300
|
+
self.state = 'WRITE_GAP'
|
|
301
|
+
|
|
302
|
+
if self.gap_detected == 1:
|
|
303
|
+
self.gap_detected = 0
|
|
304
|
+
if (self.last_samplenum - self.old_gap_end) > self.wzmin \
|
|
305
|
+
and (self.last_samplenum - self.old_gap_end) < self.wzmax:
|
|
306
|
+
self.put(self.old_gap_end, self.last_samplenum,
|
|
307
|
+
self.out_ann, [0, ['0']])
|
|
308
|
+
self.put(self.old_gap_end, self.last_samplenum,
|
|
309
|
+
self.out_ann, [4, ['Bit']])
|
|
310
|
+
self.add_bits_pos(0, self.old_gap_end,
|
|
311
|
+
self.last_samplenum)
|
|
312
|
+
if (self.last_samplenum - self.old_gap_end) > self.womin \
|
|
313
|
+
and (self.last_samplenum - self.old_gap_end) < self.womax:
|
|
314
|
+
self.put(self.old_gap_end, self.last_samplenum,
|
|
315
|
+
self.out_ann, [0, ['1']])
|
|
316
|
+
self.put(self.old_gap_end, self.last_samplenum,
|
|
317
|
+
self.out_ann, [4, ['Bit']])
|
|
318
|
+
self.add_bits_pos(1, self.old_gap_end, self.last_samplenum)
|
|
319
|
+
|
|
320
|
+
self.old_gap_start = self.last_samplenum
|
|
321
|
+
self.old_gap_end = self.samplenum
|
|
322
|
+
|
|
323
|
+
self.oldpl = pl
|
|
324
|
+
self.oldpp = pp
|
|
325
|
+
self.oldsamplenum = self.samplenum
|
|
326
|
+
self.last_samplenum = self.samplenum
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2014 alberink <alberink@stampfini.org>
|
|
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 <http://www.gnu.org/licenses/>.
|
|
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
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
|
|
5
|
+
## Copyright (C) 2013 Matt Ranostay <mranostay@gmail.com>
|
|
6
|
+
## Copyright (C) 2014 alberink <alberink@stampfini.org>
|
|
7
|
+
##
|
|
8
|
+
## This program is free software; you can redistribute it and/or modify
|
|
9
|
+
## it under the terms of the GNU General Public License as published by
|
|
10
|
+
## the Free Software Foundation; either version 2 of the License, or
|
|
11
|
+
## (at your option) any later version.
|
|
12
|
+
##
|
|
13
|
+
## This program is distributed in the hope that it will be useful,
|
|
14
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
## GNU General Public License for more details.
|
|
17
|
+
##
|
|
18
|
+
## You should have received a copy of the GNU General Public License
|
|
19
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
##
|
|
21
|
+
|
|
22
|
+
import sigrokdecode as srd
|
|
23
|
+
|
|
24
|
+
NUM_OUTPUT_CHANNELS = 8
|
|
25
|
+
|
|
26
|
+
def logic_channels(num_channels):
|
|
27
|
+
l = []
|
|
28
|
+
for i in range(num_channels):
|
|
29
|
+
l.append(tuple(['p%d' % i, 'P-port input/output %d' % i]))
|
|
30
|
+
return tuple(l)
|
|
31
|
+
|
|
32
|
+
class Decoder(srd.Decoder):
|
|
33
|
+
api_version = 3
|
|
34
|
+
id = 'tca6408a'
|
|
35
|
+
name = 'TI TCA6408A'
|
|
36
|
+
longname = 'Texas Instruments TCA6408A'
|
|
37
|
+
desc = 'Texas Instruments TCA6408A 8-bit I²C I/O expander.'
|
|
38
|
+
license = 'gplv2+'
|
|
39
|
+
inputs = ['i2c']
|
|
40
|
+
outputs = []
|
|
41
|
+
tags = ['Embedded/industrial', 'IC']
|
|
42
|
+
annotations = (
|
|
43
|
+
('register', 'Register type'),
|
|
44
|
+
('value', 'Register value'),
|
|
45
|
+
('warning', 'Warning'),
|
|
46
|
+
)
|
|
47
|
+
logic_output_channels = logic_channels(NUM_OUTPUT_CHANNELS)
|
|
48
|
+
annotation_rows = (
|
|
49
|
+
('regs', 'Registers', (0, 1)),
|
|
50
|
+
('warnings', 'Warnings', (2,)),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def __init__(self):
|
|
54
|
+
self.reset()
|
|
55
|
+
|
|
56
|
+
def reset(self):
|
|
57
|
+
self.state = 'IDLE'
|
|
58
|
+
self.chip = -1
|
|
59
|
+
|
|
60
|
+
self.logic_output_es = 0
|
|
61
|
+
self.logic_value = 0
|
|
62
|
+
|
|
63
|
+
def start(self):
|
|
64
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
65
|
+
self.out_logic = self.register(srd.OUTPUT_LOGIC)
|
|
66
|
+
|
|
67
|
+
def flush(self):
|
|
68
|
+
self.put_logic_states()
|
|
69
|
+
|
|
70
|
+
def putx(self, data):
|
|
71
|
+
self.put(self.ss, self.es, self.out_ann, data)
|
|
72
|
+
|
|
73
|
+
def put_logic_states(self):
|
|
74
|
+
if (self.es > self.logic_output_es):
|
|
75
|
+
data = bytes([self.logic_value])
|
|
76
|
+
self.put(self.logic_output_es, self.es, self.out_logic, [0, data])
|
|
77
|
+
self.logic_output_es = self.es
|
|
78
|
+
|
|
79
|
+
def handle_reg_0x00(self, b):
|
|
80
|
+
self.putx([1, ['State of inputs: %02X' % b]])
|
|
81
|
+
# TODO
|
|
82
|
+
|
|
83
|
+
def handle_reg_0x01(self, b):
|
|
84
|
+
self.put_logic_states()
|
|
85
|
+
self.putx([1, ['Outputs set: %02X' % b]])
|
|
86
|
+
self.logic_value = b
|
|
87
|
+
|
|
88
|
+
def handle_reg_0x02(self, b):
|
|
89
|
+
self.putx([1, ['Polarity inverted: %02X' % b]])
|
|
90
|
+
|
|
91
|
+
def handle_reg_0x03(self, b):
|
|
92
|
+
self.putx([1, ['Configuration: %02X' % b]])
|
|
93
|
+
|
|
94
|
+
def handle_write_reg(self, b):
|
|
95
|
+
if b == 0:
|
|
96
|
+
self.putx([0, ['Input port', 'In', 'I']])
|
|
97
|
+
elif b == 1:
|
|
98
|
+
self.putx([0, ['Output port', 'Out', 'O']])
|
|
99
|
+
elif b == 2:
|
|
100
|
+
self.putx([0, ['Polarity inversion register', 'Pol', 'P']])
|
|
101
|
+
elif b == 3:
|
|
102
|
+
self.putx([0, ['Configuration register', 'Conf', 'C']])
|
|
103
|
+
|
|
104
|
+
def check_correct_chip(self, addr):
|
|
105
|
+
if addr not in (0x20, 0x21):
|
|
106
|
+
self.putx([2, ['Warning: I²C slave 0x%02X not a TCA6408A '
|
|
107
|
+
'compatible chip.' % addr]])
|
|
108
|
+
self.state = 'IDLE'
|
|
109
|
+
|
|
110
|
+
def decode(self, ss, es, data):
|
|
111
|
+
cmd, databyte = data
|
|
112
|
+
|
|
113
|
+
# Store the start/end samples of this I²C packet.
|
|
114
|
+
self.ss, self.es = ss, es
|
|
115
|
+
|
|
116
|
+
# State machine.
|
|
117
|
+
if self.state == 'IDLE':
|
|
118
|
+
# Wait for an I²C START condition.
|
|
119
|
+
if cmd != 'START':
|
|
120
|
+
return
|
|
121
|
+
self.state = 'GET SLAVE ADDR'
|
|
122
|
+
elif self.state == 'GET SLAVE ADDR':
|
|
123
|
+
self.chip = databyte
|
|
124
|
+
self.state = 'GET REG ADDR'
|
|
125
|
+
elif self.state == 'GET REG ADDR':
|
|
126
|
+
# Wait for a data write (master selects the slave register).
|
|
127
|
+
if cmd in ('ADDRESS READ', 'ADDRESS WRITE'):
|
|
128
|
+
self.check_correct_chip(databyte)
|
|
129
|
+
if cmd != 'DATA WRITE':
|
|
130
|
+
return
|
|
131
|
+
self.reg = databyte
|
|
132
|
+
self.handle_write_reg(self.reg)
|
|
133
|
+
self.state = 'WRITE IO REGS'
|
|
134
|
+
elif self.state == 'WRITE IO REGS':
|
|
135
|
+
# If we see a Repeated Start here, the master wants to read.
|
|
136
|
+
if cmd == 'START REPEAT':
|
|
137
|
+
self.state = 'READ IO REGS'
|
|
138
|
+
return
|
|
139
|
+
# Otherwise: Get data bytes until a STOP condition occurs.
|
|
140
|
+
if cmd == 'DATA WRITE':
|
|
141
|
+
handle_reg = getattr(self, 'handle_reg_0x%02x' % self.reg)
|
|
142
|
+
handle_reg(databyte)
|
|
143
|
+
elif cmd == 'STOP':
|
|
144
|
+
self.state = 'IDLE'
|
|
145
|
+
self.chip = -1
|
|
146
|
+
elif self.state == 'READ IO REGS':
|
|
147
|
+
# Wait for an address read operation.
|
|
148
|
+
if cmd == 'ADDRESS READ':
|
|
149
|
+
self.state = 'READ IO REGS2'
|
|
150
|
+
self.chip = databyte
|
|
151
|
+
return
|
|
152
|
+
elif self.state == 'READ IO REGS2':
|
|
153
|
+
if cmd == 'DATA READ':
|
|
154
|
+
handle_reg = getattr(self, 'handle_reg_0x%02x' % self.reg)
|
|
155
|
+
handle_reg(databyte)
|
|
156
|
+
elif cmd == 'STOP':
|
|
157
|
+
self.state = 'IDLE'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2019 Ben Dooks <ben.dooks@codethink.co.uk>
|
|
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 <http://www.gnu.org/licenses/>.
|
|
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
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2019 Ben Dooks <ben.dooks@codethink.co.uk>
|
|
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 <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
import sigrokdecode as srd
|
|
21
|
+
|
|
22
|
+
MAX_CHANNELS = 8
|
|
23
|
+
|
|
24
|
+
class Decoder(srd.Decoder):
|
|
25
|
+
api_version = 3
|
|
26
|
+
id = 'tdm_audio'
|
|
27
|
+
name = 'TDM audio'
|
|
28
|
+
longname = 'Time division multiplex audio'
|
|
29
|
+
desc = 'TDM multi-channel audio protocol.'
|
|
30
|
+
license = 'gplv2+'
|
|
31
|
+
inputs = ['logic']
|
|
32
|
+
outputs = []
|
|
33
|
+
tags = ['Audio']
|
|
34
|
+
channels = (
|
|
35
|
+
{ 'id': 'clock', 'name': 'Bitclk', 'desc': 'Data bit clock' },
|
|
36
|
+
{ 'id': 'frame', 'name': 'Framesync', 'desc': 'Frame sync' },
|
|
37
|
+
{ 'id': 'data', 'name': 'Data', 'desc': 'Serial data' },
|
|
38
|
+
)
|
|
39
|
+
options = (
|
|
40
|
+
{'id': 'bps', 'desc': 'Bits per sample', 'default': 16 },
|
|
41
|
+
{'id': 'channels', 'desc': 'Channels per frame', 'default': MAX_CHANNELS },
|
|
42
|
+
{'id': 'edge', 'desc': 'Clock edge to sample on', 'default': 'rising', 'values': ('rising', 'falling') }
|
|
43
|
+
)
|
|
44
|
+
annotations = tuple(('ch%d' % i, 'Ch%d' % i) for i in range(MAX_CHANNELS))
|
|
45
|
+
annotation_rows = tuple(('ch%d-vals' % i, 'Ch%d' % i, (i,)) for i in range(MAX_CHANNELS))
|
|
46
|
+
|
|
47
|
+
def __init__(self):
|
|
48
|
+
self.reset()
|
|
49
|
+
|
|
50
|
+
def reset(self):
|
|
51
|
+
self.samplerate = None
|
|
52
|
+
self.channels = MAX_CHANNELS
|
|
53
|
+
self.channel = 0
|
|
54
|
+
self.bitdepth = 16
|
|
55
|
+
self.bitcount = 0
|
|
56
|
+
self.samplecount = 0
|
|
57
|
+
self.lastsync = 0
|
|
58
|
+
self.lastframe = 0
|
|
59
|
+
self.data = 0
|
|
60
|
+
self.ss_block = None
|
|
61
|
+
|
|
62
|
+
def metdatadata(self, key, value):
|
|
63
|
+
if key == srd.SRD_CONF_SAMPLERATE:
|
|
64
|
+
self.samplerate = value
|
|
65
|
+
|
|
66
|
+
def start(self):
|
|
67
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
68
|
+
self.bitdepth = self.options['bps']
|
|
69
|
+
self.edge = self.options['edge']
|
|
70
|
+
|
|
71
|
+
def decode(self):
|
|
72
|
+
while True:
|
|
73
|
+
# Wait for edge of clock (sample on rising/falling edge).
|
|
74
|
+
clock, frame, data = self.wait({0: self.edge[0]})
|
|
75
|
+
|
|
76
|
+
self.data = (self.data << 1) | data
|
|
77
|
+
self.bitcount += 1
|
|
78
|
+
|
|
79
|
+
if self.ss_block is not None:
|
|
80
|
+
if self.bitcount >= self.bitdepth:
|
|
81
|
+
self.bitcount = 0
|
|
82
|
+
self.channel += 1
|
|
83
|
+
|
|
84
|
+
c1 = 'Channel %d' % self.channel
|
|
85
|
+
c2 = 'C%d' % self.channel
|
|
86
|
+
c3 = '%d' % self.channel
|
|
87
|
+
if self.bitdepth <= 8:
|
|
88
|
+
v = '%02x' % self.data
|
|
89
|
+
elif self.bitdepth <= 16:
|
|
90
|
+
v = '%04x' % self.data
|
|
91
|
+
else:
|
|
92
|
+
v = '%08x' % self.data
|
|
93
|
+
|
|
94
|
+
if self.channel < self.channels:
|
|
95
|
+
ch = self.channel
|
|
96
|
+
else:
|
|
97
|
+
ch = 0
|
|
98
|
+
|
|
99
|
+
self.put(self.ss_block, self.samplenum, self.out_ann,
|
|
100
|
+
[ch, ['%s: %s' % (c1, v), '%s: %s' % (c2, v),
|
|
101
|
+
'%s: %s' % (c3, v)]])
|
|
102
|
+
self.data = 0
|
|
103
|
+
self.ss_block = self.samplenum
|
|
104
|
+
self.samplecount += 1
|
|
105
|
+
|
|
106
|
+
# Check for new frame.
|
|
107
|
+
# Note, frame may be a single clock, or active for the first
|
|
108
|
+
# sample in the frame.
|
|
109
|
+
if frame != self.lastframe and frame == 1:
|
|
110
|
+
self.channel = 0
|
|
111
|
+
self.bitcount = 0
|
|
112
|
+
self.data = 0
|
|
113
|
+
if self.ss_block is None:
|
|
114
|
+
self.ss_block = 0
|
|
115
|
+
|
|
116
|
+
self.lastframe = frame
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2014 Torsten Duwe <duwe@suse.de>
|
|
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 <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
'''
|
|
21
|
+
Timing decoder, find the time between edges.
|
|
22
|
+
'''
|
|
23
|
+
|
|
24
|
+
from .pd import Decoder
|