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,386 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2015 Stefan Brüns <stefan.bruens@rwth-aachen.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
|
+
import sigrokdecode as srd
|
|
21
|
+
import struct
|
|
22
|
+
|
|
23
|
+
class SamplerateError(Exception):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
class pcap_usb_pkt():
|
|
27
|
+
# Linux usbmon format, see Documentation/usb/usbmon.txt
|
|
28
|
+
h = b'\x00\x00\x00\x00' # ID part 1
|
|
29
|
+
h += b'\x00\x00\x00\x00' # ID part 2
|
|
30
|
+
h += b'C' # 'S'ubmit / 'C'omplete / 'E'rror
|
|
31
|
+
h += b'\x03' # ISO (0), Intr, Control, Bulk (3)
|
|
32
|
+
h += b'\x00' # Endpoint
|
|
33
|
+
h += b'\x00' # Device address
|
|
34
|
+
h += b'\x00\x00' # Bus number
|
|
35
|
+
h += b'-' # Setup tag - 0: Setup present, '-' otherwise
|
|
36
|
+
h += b'<' # Data tag - '<' no data, 0 otherwise
|
|
37
|
+
# Timestamp
|
|
38
|
+
h += b'\x00\x00\x00\x00' # TS seconds part 1
|
|
39
|
+
h += b'\x00\x00\x00\x00' # TS seconds part 2
|
|
40
|
+
h += b'\x00\x00\x00\x00' # TS useconds
|
|
41
|
+
#
|
|
42
|
+
h += b'\x00\x00\x00\x00' # Status 0: OK
|
|
43
|
+
h += b'\x00\x00\x00\x00' # URB length
|
|
44
|
+
h += b'\x00\x00\x00\x00' # Data length
|
|
45
|
+
# Setup packet data, valid if setup tag == 0
|
|
46
|
+
h += b'\x00' # bmRequestType
|
|
47
|
+
h += b'\x00' # bRequest
|
|
48
|
+
h += b'\x00\x00' # wValue
|
|
49
|
+
h += b'\x00\x00' # wIndex
|
|
50
|
+
h += b'\x00\x00' # wLength
|
|
51
|
+
#
|
|
52
|
+
h += b'\x00\x00\x00\x00' # ISO/interrupt interval
|
|
53
|
+
h += b'\x00\x00\x00\x00' # ISO start frame
|
|
54
|
+
h += b'\x00\x00\x00\x00' # URB flags
|
|
55
|
+
h += b'\x00\x00\x00\x00' # Number of ISO descriptors
|
|
56
|
+
|
|
57
|
+
def __init__(self, req, ts, is_submit):
|
|
58
|
+
self.header = bytearray(pcap_usb_pkt.h)
|
|
59
|
+
self.data = b''
|
|
60
|
+
self.set_urbid(req['id'])
|
|
61
|
+
self.set_urbtype('S' if is_submit else 'C')
|
|
62
|
+
self.set_timestamp(ts)
|
|
63
|
+
self.set_addr_ep(req['addr'], req['ep'])
|
|
64
|
+
if req['type'] in ('SETUP IN', 'SETUP OUT'):
|
|
65
|
+
self.set_transfertype(2) # Control
|
|
66
|
+
self.set_setup(req['setup_data'])
|
|
67
|
+
if req['type'] in ('BULK IN'):
|
|
68
|
+
self.set_addr_ep(req['addr'], 0x80 | req['ep'])
|
|
69
|
+
self.set_data(req['data'])
|
|
70
|
+
|
|
71
|
+
def set_urbid(self, urbid):
|
|
72
|
+
self.header[4:8] = struct.pack('>I', urbid)
|
|
73
|
+
|
|
74
|
+
def set_urbtype(self, urbtype):
|
|
75
|
+
self.header[8] = ord(urbtype)
|
|
76
|
+
|
|
77
|
+
def set_transfertype(self, transfertype):
|
|
78
|
+
self.header[9] = transfertype
|
|
79
|
+
|
|
80
|
+
def set_addr_ep(self, addr, ep):
|
|
81
|
+
self.header[11] = addr
|
|
82
|
+
self.header[10] = ep
|
|
83
|
+
|
|
84
|
+
def set_timestamp(self, ts):
|
|
85
|
+
self.timestamp = ts
|
|
86
|
+
self.header[20:24] = struct.pack('>I', ts[0]) # seconds
|
|
87
|
+
self.header[24:28] = struct.pack('>I', ts[1]) # microseconds
|
|
88
|
+
|
|
89
|
+
def set_data(self, data):
|
|
90
|
+
self.data = data
|
|
91
|
+
self.header[15] = 0
|
|
92
|
+
self.header[36:40] = struct.pack('>I', len(data))
|
|
93
|
+
|
|
94
|
+
def set_setup(self, data):
|
|
95
|
+
self.header[14] = 0
|
|
96
|
+
self.header[40:48] = data
|
|
97
|
+
|
|
98
|
+
def packet(self):
|
|
99
|
+
return bytes(self.header) + bytes(self.data)
|
|
100
|
+
|
|
101
|
+
def record_header(self):
|
|
102
|
+
# See https://wiki.wireshark.org/Development/LibpcapFileFormat.
|
|
103
|
+
(secs, usecs) = self.timestamp
|
|
104
|
+
h = struct.pack('>I', secs) # TS seconds
|
|
105
|
+
h += struct.pack('>I', usecs) # TS microseconds
|
|
106
|
+
# No truncation, so both lengths are the same.
|
|
107
|
+
h += struct.pack('>I', len(self)) # Captured len (usb hdr + data)
|
|
108
|
+
h += struct.pack('>I', len(self)) # Original len
|
|
109
|
+
return h
|
|
110
|
+
|
|
111
|
+
def __len__(self):
|
|
112
|
+
return 64 + len(self.data)
|
|
113
|
+
|
|
114
|
+
class Decoder(srd.Decoder):
|
|
115
|
+
api_version = 3
|
|
116
|
+
id = 'usb_request'
|
|
117
|
+
name = 'USB request'
|
|
118
|
+
longname = 'Universal Serial Bus (LS/FS) transaction/request'
|
|
119
|
+
desc = 'USB (low-speed/full-speed) transaction/request protocol.'
|
|
120
|
+
license = 'gplv2+'
|
|
121
|
+
inputs = ['usb_packet']
|
|
122
|
+
outputs = ['usb_request']
|
|
123
|
+
options = (
|
|
124
|
+
{'id': 'in_request_start', 'desc': 'Start IN requests on',
|
|
125
|
+
'default': 'submit', 'values': ('submit', 'first-ack')},
|
|
126
|
+
)
|
|
127
|
+
tags = ['PC']
|
|
128
|
+
annotations = (
|
|
129
|
+
('request-setup-read', 'Setup: Device-to-host'),
|
|
130
|
+
('request-setup-write', 'Setup: Host-to-device'),
|
|
131
|
+
('request-bulk-read', 'Bulk: Device-to-host'),
|
|
132
|
+
('request-bulk-write', 'Bulk: Host-to-device'),
|
|
133
|
+
('error', 'Unexpected packet'),
|
|
134
|
+
)
|
|
135
|
+
annotation_rows = (
|
|
136
|
+
('request-setup', 'USB SETUP', (0, 1)),
|
|
137
|
+
('request-in', 'USB BULK IN', (2,)),
|
|
138
|
+
('request-out', 'USB BULK OUT', (3,)),
|
|
139
|
+
('errors', 'Errors', (4,)),
|
|
140
|
+
)
|
|
141
|
+
binary = (
|
|
142
|
+
('pcap', 'PCAP format'),
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
def __init__(self):
|
|
146
|
+
self.reset()
|
|
147
|
+
|
|
148
|
+
def reset(self):
|
|
149
|
+
self.samplerate = None
|
|
150
|
+
self.request = {}
|
|
151
|
+
self.request_id = 0
|
|
152
|
+
self.transaction_state = 'IDLE'
|
|
153
|
+
self.ss_transaction = None
|
|
154
|
+
self.es_transaction = None
|
|
155
|
+
self.transaction_ep = None
|
|
156
|
+
self.transaction_addr = None
|
|
157
|
+
self.wrote_pcap_header = False
|
|
158
|
+
|
|
159
|
+
def putr(self, ss, es, data):
|
|
160
|
+
self.put(ss, es, self.out_ann, data)
|
|
161
|
+
|
|
162
|
+
def putb(self, ts, data):
|
|
163
|
+
self.put(ts, ts, self.out_binary, data)
|
|
164
|
+
|
|
165
|
+
def pcap_global_header(self):
|
|
166
|
+
# See https://wiki.wireshark.org/Development/LibpcapFileFormat.
|
|
167
|
+
h = b'\xa1\xb2\xc3\xd4' # Magic, indicate microsecond ts resolution
|
|
168
|
+
h += b'\x00\x02' # Major version 2
|
|
169
|
+
h += b'\x00\x04' # Minor version 4
|
|
170
|
+
h += b'\x00\x00\x00\x00' # Correction vs. UTC, seconds
|
|
171
|
+
h += b'\x00\x00\x00\x00' # Timestamp accuracy
|
|
172
|
+
h += b'\xff\xff\xff\xff' # Max packet len
|
|
173
|
+
# LINKTYPE_USB_LINUX_MMAPPED 220
|
|
174
|
+
# Linux usbmon format, see Documentation/usb/usbmon.txt.
|
|
175
|
+
h += b'\x00\x00\x00\xdc' # Link layer
|
|
176
|
+
return h
|
|
177
|
+
|
|
178
|
+
def metadata(self, key, value):
|
|
179
|
+
if key == srd.SRD_CONF_SAMPLERATE:
|
|
180
|
+
self.samplerate = value
|
|
181
|
+
if self.samplerate:
|
|
182
|
+
self.secs_per_sample = float(1) / float(self.samplerate)
|
|
183
|
+
|
|
184
|
+
def start(self):
|
|
185
|
+
self.out_binary = self.register(srd.OUTPUT_BINARY)
|
|
186
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
187
|
+
self.in_request_start = self.options['in_request_start']
|
|
188
|
+
|
|
189
|
+
def handle_transfer(self):
|
|
190
|
+
request_started = 0
|
|
191
|
+
request_end = self.handshake in ('ACK', 'STALL', 'timeout')
|
|
192
|
+
ep = self.transaction_ep
|
|
193
|
+
addr = self.transaction_addr
|
|
194
|
+
|
|
195
|
+
# Handle protocol STALLs, condition lasts until next SETUP transfer (8.5.3.4)
|
|
196
|
+
if self.transaction_type == 'SETUP' and (addr, ep) in self.request:
|
|
197
|
+
request = self.request[(addr,ep)]
|
|
198
|
+
if request['type'] in ('SETUP IN', 'SETUP OUT'):
|
|
199
|
+
request['es'] = self.ss_transaction
|
|
200
|
+
self.handle_request(0, 1)
|
|
201
|
+
|
|
202
|
+
if not (addr, ep) in self.request:
|
|
203
|
+
self.request[(addr, ep)] = {'setup_data': [], 'data': [],
|
|
204
|
+
'type': None, 'ss': self.ss_transaction, 'es': None,
|
|
205
|
+
'ss_data': None, 'id': self.request_id, 'addr': addr, 'ep': ep}
|
|
206
|
+
self.request_id += 1
|
|
207
|
+
request_started = 1
|
|
208
|
+
request = self.request[(addr,ep)]
|
|
209
|
+
|
|
210
|
+
if request_end:
|
|
211
|
+
request['es'] = self.es_transaction
|
|
212
|
+
request['handshake'] = self.handshake
|
|
213
|
+
|
|
214
|
+
# BULK or INTERRUPT transfer
|
|
215
|
+
if request['type'] in (None, 'BULK IN') and self.transaction_type == 'IN':
|
|
216
|
+
request['type'] = 'BULK IN'
|
|
217
|
+
if len(request['data']) == 0 and len(self.transaction_data) > 0:
|
|
218
|
+
request['ss_data'] = self.ss_transaction
|
|
219
|
+
request['data'] += self.transaction_data
|
|
220
|
+
self.handle_request(request_started, request_end)
|
|
221
|
+
elif request['type'] in (None, 'BULK OUT') and self.transaction_type == 'OUT':
|
|
222
|
+
request['type'] = 'BULK OUT'
|
|
223
|
+
if self.handshake == 'ACK':
|
|
224
|
+
request['data'] += self.transaction_data
|
|
225
|
+
self.handle_request(request_started, request_end)
|
|
226
|
+
|
|
227
|
+
# CONTROL, SETUP stage
|
|
228
|
+
elif request['type'] is None and self.transaction_type == 'SETUP':
|
|
229
|
+
request['setup_data'] = self.transaction_data
|
|
230
|
+
request['wLength'] = struct.unpack('<H',
|
|
231
|
+
bytes(self.transaction_data[6:8]))[0]
|
|
232
|
+
if self.transaction_data[0] & 0x80:
|
|
233
|
+
request['type'] = 'SETUP IN'
|
|
234
|
+
self.handle_request(1, 0)
|
|
235
|
+
else:
|
|
236
|
+
request['type'] = 'SETUP OUT'
|
|
237
|
+
self.handle_request(request['wLength'] == 0, 0)
|
|
238
|
+
|
|
239
|
+
# CONTROL, DATA stage
|
|
240
|
+
elif request['type'] == 'SETUP IN' and self.transaction_type == 'IN':
|
|
241
|
+
request['data'] += self.transaction_data
|
|
242
|
+
|
|
243
|
+
elif request['type'] == 'SETUP OUT' and self.transaction_type == 'OUT':
|
|
244
|
+
if self.handshake == 'ACK':
|
|
245
|
+
request['data'] += self.transaction_data
|
|
246
|
+
if request['wLength'] == len(request['data']):
|
|
247
|
+
self.handle_request(1, 0)
|
|
248
|
+
|
|
249
|
+
# CONTROL, STATUS stage
|
|
250
|
+
elif request['type'] == 'SETUP IN' and self.transaction_type == 'OUT':
|
|
251
|
+
self.handle_request(0, request_end)
|
|
252
|
+
|
|
253
|
+
elif request['type'] == 'SETUP OUT' and self.transaction_type == 'IN':
|
|
254
|
+
self.handle_request(0, request_end)
|
|
255
|
+
|
|
256
|
+
else:
|
|
257
|
+
return
|
|
258
|
+
|
|
259
|
+
return
|
|
260
|
+
|
|
261
|
+
def ts_from_samplenum(self, sample):
|
|
262
|
+
ts = float(sample) * self.secs_per_sample
|
|
263
|
+
return (int(ts), int((ts % 1.0) * 1e6))
|
|
264
|
+
|
|
265
|
+
def write_pcap_header(self):
|
|
266
|
+
if not self.wrote_pcap_header:
|
|
267
|
+
self.put(0, 0, self.out_binary, [0, self.pcap_global_header()])
|
|
268
|
+
self.wrote_pcap_header = True
|
|
269
|
+
|
|
270
|
+
def request_summary(self, request):
|
|
271
|
+
s = '['
|
|
272
|
+
if request['type'] in ('SETUP IN', 'SETUP OUT'):
|
|
273
|
+
for b in request['setup_data']:
|
|
274
|
+
s += ' %02X' % b
|
|
275
|
+
s += ' ]['
|
|
276
|
+
for b in request['data']:
|
|
277
|
+
s += ' %02X' % b
|
|
278
|
+
s += ' ] : %s' % request['handshake']
|
|
279
|
+
return s
|
|
280
|
+
|
|
281
|
+
def handle_request(self, request_start, request_end):
|
|
282
|
+
if request_start != 1 and request_end != 1:
|
|
283
|
+
return
|
|
284
|
+
self.write_pcap_header()
|
|
285
|
+
ep = self.transaction_ep
|
|
286
|
+
addr = self.transaction_addr
|
|
287
|
+
request = self.request[(addr, ep)]
|
|
288
|
+
|
|
289
|
+
ss, es, ss_data = request['ss'], request['es'], request['ss_data']
|
|
290
|
+
if self.in_request_start == 'submit':
|
|
291
|
+
ss_data = ss
|
|
292
|
+
|
|
293
|
+
if request_start == 1:
|
|
294
|
+
# Issue PCAP 'SUBMIT' packet.
|
|
295
|
+
ts = self.ts_from_samplenum(ss)
|
|
296
|
+
pkt = pcap_usb_pkt(request, ts, True)
|
|
297
|
+
self.putb(ss, [0, pkt.record_header()])
|
|
298
|
+
self.putb(ss, [0, pkt.packet()])
|
|
299
|
+
|
|
300
|
+
if request_end == 1:
|
|
301
|
+
# Write annotation.
|
|
302
|
+
summary = self.request_summary(request)
|
|
303
|
+
if request['type'] == 'SETUP IN':
|
|
304
|
+
self.putr(ss, es, [0, ['SETUP in: %s' % summary]])
|
|
305
|
+
elif request['type'] == 'SETUP OUT':
|
|
306
|
+
self.putr(ss, es, [1, ['SETUP out: %s' % summary]])
|
|
307
|
+
elif request['type'] == 'BULK IN':
|
|
308
|
+
self.putr(ss_data, es, [2, ['BULK in: %s' % summary]])
|
|
309
|
+
elif request['type'] == 'BULK OUT':
|
|
310
|
+
self.putr(ss, es, [3, ['BULK out: %s' % summary]])
|
|
311
|
+
|
|
312
|
+
# Issue PCAP 'COMPLETE' packet.
|
|
313
|
+
ts = self.ts_from_samplenum(es)
|
|
314
|
+
pkt = pcap_usb_pkt(request, ts, False)
|
|
315
|
+
self.putb(ss, [0, pkt.record_header()])
|
|
316
|
+
self.putb(ss, [0, pkt.packet()])
|
|
317
|
+
del self.request[(addr, ep)]
|
|
318
|
+
|
|
319
|
+
def decode(self, ss, es, data):
|
|
320
|
+
if not self.samplerate:
|
|
321
|
+
raise SamplerateError('Cannot decode without samplerate.')
|
|
322
|
+
ptype, pdata = data
|
|
323
|
+
|
|
324
|
+
# We only care about certain packet types for now.
|
|
325
|
+
if ptype not in ('PACKET'):
|
|
326
|
+
return
|
|
327
|
+
|
|
328
|
+
pcategory, pname, pinfo = pdata
|
|
329
|
+
|
|
330
|
+
if pcategory == 'TOKEN':
|
|
331
|
+
if pname == 'SOF':
|
|
332
|
+
return
|
|
333
|
+
if self.transaction_state == 'TOKEN RECEIVED':
|
|
334
|
+
transaction_timeout = self.es_transaction
|
|
335
|
+
# Token length is 35 bits, timeout is 16..18 bit times
|
|
336
|
+
# (USB 2.0 7.1.19.1).
|
|
337
|
+
transaction_timeout += int((self.es_transaction - self.ss_transaction) / 2)
|
|
338
|
+
if ss > transaction_timeout:
|
|
339
|
+
self.es_transaction = transaction_timeout
|
|
340
|
+
self.handshake = 'timeout'
|
|
341
|
+
self.handle_transfer()
|
|
342
|
+
self.transaction_state = 'IDLE'
|
|
343
|
+
|
|
344
|
+
if self.transaction_state != 'IDLE':
|
|
345
|
+
self.putr(ss, es, [4, ['ERR: received %s token in state %s' %
|
|
346
|
+
(pname, self.transaction_state)]])
|
|
347
|
+
return
|
|
348
|
+
|
|
349
|
+
sync, pid, addr, ep, crc5 = pinfo
|
|
350
|
+
self.transaction_data = []
|
|
351
|
+
self.ss_transaction = ss
|
|
352
|
+
self.es_transaction = es
|
|
353
|
+
self.transaction_state = 'TOKEN RECEIVED'
|
|
354
|
+
self.transaction_ep = ep
|
|
355
|
+
if ep > 0 and pname == 'IN':
|
|
356
|
+
self.transaction_ep = ep + 0x80
|
|
357
|
+
self.transaction_addr = addr
|
|
358
|
+
self.transaction_type = pname # IN OUT SETUP
|
|
359
|
+
|
|
360
|
+
elif pcategory == 'DATA':
|
|
361
|
+
if self.transaction_state != 'TOKEN RECEIVED':
|
|
362
|
+
self.putr(ss, es, [4, ['ERR: received %s token in state %s' %
|
|
363
|
+
(pname, self.transaction_state)]])
|
|
364
|
+
return
|
|
365
|
+
|
|
366
|
+
self.transaction_data = pinfo[2]
|
|
367
|
+
self.transaction_state = 'DATA RECEIVED'
|
|
368
|
+
|
|
369
|
+
elif pcategory == 'HANDSHAKE':
|
|
370
|
+
if self.transaction_state not in ('TOKEN RECEIVED', 'DATA RECEIVED'):
|
|
371
|
+
self.putr(ss, es, [4, ['ERR: received %s token in state %s' %
|
|
372
|
+
(pname, self.transaction_state)]])
|
|
373
|
+
return
|
|
374
|
+
|
|
375
|
+
self.handshake = pname
|
|
376
|
+
self.transaction_state = 'IDLE'
|
|
377
|
+
self.es_transaction = es
|
|
378
|
+
self.handle_transfer()
|
|
379
|
+
|
|
380
|
+
elif pname == 'PRE':
|
|
381
|
+
return
|
|
382
|
+
|
|
383
|
+
else:
|
|
384
|
+
self.putr(ss, es, [4, ['ERR: received unhandled %s token in state %s' %
|
|
385
|
+
(pname, self.transaction_state)]])
|
|
386
|
+
return
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.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
|
+
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
|