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,348 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
|
|
5
|
+
## Copyright (C) 2012-2020 Uwe Hermann <uwe@hermann-uwe.de>
|
|
6
|
+
##
|
|
7
|
+
## This program is free software; you can redistribute it and/or modify
|
|
8
|
+
## it under the terms of the GNU General Public License as published by
|
|
9
|
+
## the Free Software Foundation; either version 2 of the License, or
|
|
10
|
+
## (at your option) any later version.
|
|
11
|
+
##
|
|
12
|
+
## This program is distributed in the hope that it will be useful,
|
|
13
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
## GNU General Public License for more details.
|
|
16
|
+
##
|
|
17
|
+
## You should have received a copy of the GNU General Public License
|
|
18
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
##
|
|
20
|
+
|
|
21
|
+
import sigrokdecode as srd
|
|
22
|
+
from common.srdhelper import SrdIntEnum
|
|
23
|
+
|
|
24
|
+
'''
|
|
25
|
+
OUTPUT_PYTHON format:
|
|
26
|
+
|
|
27
|
+
Packet:
|
|
28
|
+
[<ptype>, <pdata>]
|
|
29
|
+
|
|
30
|
+
<ptype>, <pdata>:
|
|
31
|
+
- 'SOP', None
|
|
32
|
+
- 'SYM', <sym>
|
|
33
|
+
- 'BIT', <bit>
|
|
34
|
+
- 'STUFF BIT', None
|
|
35
|
+
- 'EOP', None
|
|
36
|
+
- 'ERR', None
|
|
37
|
+
- 'KEEP ALIVE', None
|
|
38
|
+
- 'RESET', None
|
|
39
|
+
|
|
40
|
+
<sym>:
|
|
41
|
+
- 'J', 'K', 'SE0', or 'SE1'
|
|
42
|
+
|
|
43
|
+
<bit>:
|
|
44
|
+
- '0' or '1'
|
|
45
|
+
- Note: Symbols like SE0, SE1, and the J that's part of EOP don't yield 'BIT'.
|
|
46
|
+
'''
|
|
47
|
+
|
|
48
|
+
# Low-/full-speed symbols.
|
|
49
|
+
# Note: Low-speed J and K are inverted compared to the full-speed J and K!
|
|
50
|
+
symbols = {
|
|
51
|
+
'low-speed': {
|
|
52
|
+
# (<dp>, <dm>): <symbol/state>
|
|
53
|
+
(0, 0): 'SE0',
|
|
54
|
+
(1, 0): 'K',
|
|
55
|
+
(0, 1): 'J',
|
|
56
|
+
(1, 1): 'SE1',
|
|
57
|
+
},
|
|
58
|
+
'full-speed': {
|
|
59
|
+
# (<dp>, <dm>): <symbol/state>
|
|
60
|
+
(0, 0): 'SE0',
|
|
61
|
+
(1, 0): 'J',
|
|
62
|
+
(0, 1): 'K',
|
|
63
|
+
(1, 1): 'SE1',
|
|
64
|
+
},
|
|
65
|
+
'automatic': {
|
|
66
|
+
# (<dp>, <dm>): <symbol/state>
|
|
67
|
+
(0, 0): 'SE0',
|
|
68
|
+
(1, 0): 'FS_J',
|
|
69
|
+
(0, 1): 'LS_J',
|
|
70
|
+
(1, 1): 'SE1',
|
|
71
|
+
},
|
|
72
|
+
# After a PREamble PID, the bus segment between Host and Hub uses LS
|
|
73
|
+
# signalling rate and FS signalling polarity (USB 2.0 spec, 11.8.4: "For
|
|
74
|
+
# both upstream and downstream low-speed data, the hub is responsible for
|
|
75
|
+
# inverting the polarity of the data before transmitting to/from a
|
|
76
|
+
# low-speed port.").
|
|
77
|
+
'low-speed-rp': {
|
|
78
|
+
# (<dp>, <dm>): <symbol/state>
|
|
79
|
+
(0, 0): 'SE0',
|
|
80
|
+
(1, 0): 'J',
|
|
81
|
+
(0, 1): 'K',
|
|
82
|
+
(1, 1): 'SE1',
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
bitrates = {
|
|
87
|
+
'low-speed': 1500000, # 1.5Mb/s (+/- 1.5%)
|
|
88
|
+
'low-speed-rp': 1500000, # 1.5Mb/s (+/- 1.5%)
|
|
89
|
+
'full-speed': 12000000, # 12Mb/s (+/- 0.25%)
|
|
90
|
+
'automatic': None
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
sym_annotation = {
|
|
94
|
+
'J': [0, ['J']],
|
|
95
|
+
'K': [1, ['K']],
|
|
96
|
+
'SE0': [2, ['SE0', '0']],
|
|
97
|
+
'SE1': [3, ['SE1', '1']],
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
St = SrdIntEnum.from_str('St', 'IDLE GET_BIT GET_EOP WAIT_IDLE')
|
|
101
|
+
|
|
102
|
+
class SamplerateError(Exception):
|
|
103
|
+
pass
|
|
104
|
+
|
|
105
|
+
class Decoder(srd.Decoder):
|
|
106
|
+
api_version = 3
|
|
107
|
+
id = 'usb_signalling'
|
|
108
|
+
name = 'USB signalling'
|
|
109
|
+
longname = 'Universal Serial Bus (LS/FS) signalling'
|
|
110
|
+
desc = 'USB (low-speed/full-speed) signalling protocol.'
|
|
111
|
+
license = 'gplv2+'
|
|
112
|
+
inputs = ['logic']
|
|
113
|
+
outputs = ['usb_signalling']
|
|
114
|
+
tags = ['PC']
|
|
115
|
+
channels = (
|
|
116
|
+
{'id': 'dp', 'name': 'D+', 'desc': 'USB D+ signal'},
|
|
117
|
+
{'id': 'dm', 'name': 'D-', 'desc': 'USB D- signal'},
|
|
118
|
+
)
|
|
119
|
+
options = (
|
|
120
|
+
{'id': 'signalling', 'desc': 'Signalling',
|
|
121
|
+
'default': 'automatic', 'values': ('automatic', 'full-speed', 'low-speed')},
|
|
122
|
+
)
|
|
123
|
+
annotations = (
|
|
124
|
+
('sym-j', 'J symbol'),
|
|
125
|
+
('sym-k', 'K symbol'),
|
|
126
|
+
('sym-se0', 'SE0 symbol'),
|
|
127
|
+
('sym-se1', 'SE1 symbol'),
|
|
128
|
+
('sop', 'Start of packet (SOP)'),
|
|
129
|
+
('eop', 'End of packet (EOP)'),
|
|
130
|
+
('bit', 'Bit'),
|
|
131
|
+
('stuffbit', 'Stuff bit'),
|
|
132
|
+
('error', 'Error'),
|
|
133
|
+
('keep-alive', 'Low-speed keep-alive'),
|
|
134
|
+
('reset', 'Reset'),
|
|
135
|
+
)
|
|
136
|
+
annotation_rows = (
|
|
137
|
+
('bits', 'Bits', (4, 5, 6, 7, 8, 9, 10)),
|
|
138
|
+
('symbols', 'Symbols', (0, 1, 2, 3)),
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
def __init__(self):
|
|
142
|
+
self.reset()
|
|
143
|
+
|
|
144
|
+
def reset(self):
|
|
145
|
+
self.samplerate = None
|
|
146
|
+
self.oldsym = 'J' # The "idle" state is J.
|
|
147
|
+
self.ss_block = None
|
|
148
|
+
self.bitrate = None
|
|
149
|
+
self.bitwidth = None
|
|
150
|
+
self.samplepos = None
|
|
151
|
+
self.samplenum_target = None
|
|
152
|
+
self.samplenum_edge = None
|
|
153
|
+
self.samplenum_lastedge = 0
|
|
154
|
+
self.edgepins = None
|
|
155
|
+
self.consecutive_ones = 0
|
|
156
|
+
self.bits = None
|
|
157
|
+
self.state = St.IDLE
|
|
158
|
+
|
|
159
|
+
def start(self):
|
|
160
|
+
self.out_python = self.register(srd.OUTPUT_PYTHON)
|
|
161
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
162
|
+
|
|
163
|
+
def metadata(self, key, value):
|
|
164
|
+
if key == srd.SRD_CONF_SAMPLERATE:
|
|
165
|
+
self.samplerate = value
|
|
166
|
+
self.signalling = self.options['signalling']
|
|
167
|
+
if self.signalling != 'automatic':
|
|
168
|
+
self.update_bitrate()
|
|
169
|
+
|
|
170
|
+
def update_bitrate(self):
|
|
171
|
+
self.bitrate = bitrates[self.signalling]
|
|
172
|
+
self.bitwidth = float(self.samplerate) / float(self.bitrate)
|
|
173
|
+
|
|
174
|
+
def putpx(self, data):
|
|
175
|
+
s = self.samplenum_edge
|
|
176
|
+
self.put(s, s, self.out_python, data)
|
|
177
|
+
|
|
178
|
+
def putx(self, data):
|
|
179
|
+
s = self.samplenum_edge
|
|
180
|
+
self.put(s, s, self.out_ann, data)
|
|
181
|
+
|
|
182
|
+
def putpm(self, data):
|
|
183
|
+
e = self.samplenum_edge
|
|
184
|
+
self.put(self.ss_block, e, self.out_python, data)
|
|
185
|
+
|
|
186
|
+
def putm(self, data):
|
|
187
|
+
e = self.samplenum_edge
|
|
188
|
+
self.put(self.ss_block, e, self.out_ann, data)
|
|
189
|
+
|
|
190
|
+
def putpb(self, data):
|
|
191
|
+
s, e = self.samplenum_lastedge, self.samplenum_edge
|
|
192
|
+
self.put(s, e, self.out_python, data)
|
|
193
|
+
|
|
194
|
+
def putb(self, data):
|
|
195
|
+
s, e = self.samplenum_lastedge, self.samplenum_edge
|
|
196
|
+
self.put(s, e, self.out_ann, data)
|
|
197
|
+
|
|
198
|
+
def set_new_target_samplenum(self):
|
|
199
|
+
self.samplepos += self.bitwidth
|
|
200
|
+
self.samplenum_target = int(self.samplepos)
|
|
201
|
+
self.samplenum_lastedge = self.samplenum_edge
|
|
202
|
+
self.samplenum_edge = int(self.samplepos - (self.bitwidth / 2))
|
|
203
|
+
|
|
204
|
+
def wait_for_sop(self, sym):
|
|
205
|
+
# Wait for a Start of Packet (SOP), i.e. a J->K symbol change.
|
|
206
|
+
if sym != 'K' or self.oldsym != 'J':
|
|
207
|
+
return
|
|
208
|
+
self.consecutive_ones = 0
|
|
209
|
+
self.bits = ''
|
|
210
|
+
self.update_bitrate()
|
|
211
|
+
self.samplepos = self.samplenum - (self.bitwidth / 2) + 0.5
|
|
212
|
+
self.set_new_target_samplenum()
|
|
213
|
+
self.putpx(['SOP', None])
|
|
214
|
+
self.putx([4, ['SOP', 'S']])
|
|
215
|
+
self.state = St.GET_BIT
|
|
216
|
+
|
|
217
|
+
def handle_bit(self, b):
|
|
218
|
+
if self.consecutive_ones == 6:
|
|
219
|
+
if b == '0':
|
|
220
|
+
# Stuff bit.
|
|
221
|
+
self.putpb(['STUFF BIT', None])
|
|
222
|
+
self.putb([7, ['Stuff bit: 0', 'SB: 0', '0']])
|
|
223
|
+
self.consecutive_ones = 0
|
|
224
|
+
else:
|
|
225
|
+
self.putpb(['ERR', None])
|
|
226
|
+
self.putb([8, ['Bit stuff error', 'BS ERR', 'B']])
|
|
227
|
+
self.state = St.IDLE
|
|
228
|
+
else:
|
|
229
|
+
# Normal bit (not a stuff bit).
|
|
230
|
+
self.putpb(['BIT', b])
|
|
231
|
+
self.putb([6, ['%s' % b]])
|
|
232
|
+
if b == '1':
|
|
233
|
+
self.consecutive_ones += 1
|
|
234
|
+
else:
|
|
235
|
+
self.consecutive_ones = 0
|
|
236
|
+
|
|
237
|
+
def get_eop(self, sym):
|
|
238
|
+
# EOP: SE0 for >= 1 bittime (usually 2 bittimes), then J.
|
|
239
|
+
self.set_new_target_samplenum()
|
|
240
|
+
self.putpb(['SYM', sym])
|
|
241
|
+
self.putb(sym_annotation[sym])
|
|
242
|
+
self.oldsym = sym
|
|
243
|
+
if sym == 'SE0':
|
|
244
|
+
pass
|
|
245
|
+
elif sym == 'J':
|
|
246
|
+
# Got an EOP.
|
|
247
|
+
self.putpm(['EOP', None])
|
|
248
|
+
self.putm([5, ['EOP', 'E']])
|
|
249
|
+
self.state = St.WAIT_IDLE
|
|
250
|
+
else:
|
|
251
|
+
self.putpm(['ERR', None])
|
|
252
|
+
self.putm([8, ['EOP Error', 'EErr', 'E']])
|
|
253
|
+
self.state = St.IDLE
|
|
254
|
+
|
|
255
|
+
def get_bit(self, sym):
|
|
256
|
+
self.set_new_target_samplenum()
|
|
257
|
+
b = '0' if self.oldsym != sym else '1'
|
|
258
|
+
self.oldsym = sym
|
|
259
|
+
if sym == 'SE0':
|
|
260
|
+
# Start of an EOP. Change state, save edge
|
|
261
|
+
self.state = St.GET_EOP
|
|
262
|
+
self.ss_block = self.samplenum_lastedge
|
|
263
|
+
else:
|
|
264
|
+
self.handle_bit(b)
|
|
265
|
+
self.putpb(['SYM', sym])
|
|
266
|
+
self.putb(sym_annotation[sym])
|
|
267
|
+
if len(self.bits) <= 16:
|
|
268
|
+
self.bits += b
|
|
269
|
+
if len(self.bits) == 16 and self.bits == '0000000100111100':
|
|
270
|
+
# Sync and low-speed PREamble seen
|
|
271
|
+
self.putpx(['EOP', None])
|
|
272
|
+
self.state = St.IDLE
|
|
273
|
+
self.signalling = 'low-speed-rp'
|
|
274
|
+
self.update_bitrate()
|
|
275
|
+
self.oldsym = 'J'
|
|
276
|
+
if b == '0':
|
|
277
|
+
edgesym = symbols[self.signalling][tuple(self.edgepins)]
|
|
278
|
+
if edgesym not in ('SE0', 'SE1'):
|
|
279
|
+
if edgesym == sym:
|
|
280
|
+
self.bitwidth = self.bitwidth - (0.001 * self.bitwidth)
|
|
281
|
+
self.samplepos = self.samplepos - (0.01 * self.bitwidth)
|
|
282
|
+
else:
|
|
283
|
+
self.bitwidth = self.bitwidth + (0.001 * self.bitwidth)
|
|
284
|
+
self.samplepos = self.samplepos + (0.01 * self.bitwidth)
|
|
285
|
+
|
|
286
|
+
def handle_idle(self, sym):
|
|
287
|
+
self.samplenum_edge = self.samplenum
|
|
288
|
+
se0_length = float(self.samplenum - self.samplenum_lastedge) / self.samplerate
|
|
289
|
+
if se0_length > 2.5e-6: # 2.5us
|
|
290
|
+
self.putpb(['RESET', None])
|
|
291
|
+
self.putb([10, ['Reset', 'Res', 'R']])
|
|
292
|
+
self.signalling = self.options['signalling']
|
|
293
|
+
elif se0_length > 1.2e-6 and self.signalling == 'low-speed':
|
|
294
|
+
self.putpb(['KEEP ALIVE', None])
|
|
295
|
+
self.putb([9, ['Keep-alive', 'KA', 'A']])
|
|
296
|
+
|
|
297
|
+
if sym == 'FS_J':
|
|
298
|
+
self.signalling = 'full-speed'
|
|
299
|
+
self.update_bitrate()
|
|
300
|
+
elif sym == 'LS_J':
|
|
301
|
+
self.signalling = 'low-speed'
|
|
302
|
+
self.update_bitrate()
|
|
303
|
+
self.oldsym = 'J'
|
|
304
|
+
self.state = St.IDLE
|
|
305
|
+
|
|
306
|
+
def decode(self):
|
|
307
|
+
if not self.samplerate:
|
|
308
|
+
raise SamplerateError('Cannot decode without samplerate.')
|
|
309
|
+
|
|
310
|
+
# Seed internal state from the very first sample.
|
|
311
|
+
pins = self.wait()
|
|
312
|
+
sym = symbols[self.options['signalling']][pins]
|
|
313
|
+
self.handle_idle(sym)
|
|
314
|
+
|
|
315
|
+
while True:
|
|
316
|
+
# State machine.
|
|
317
|
+
if self.state == St.IDLE:
|
|
318
|
+
# Wait for any edge on either DP and/or DM.
|
|
319
|
+
pins = self.wait([{0: 'e'}, {1: 'e'}])
|
|
320
|
+
sym = symbols[self.signalling][pins]
|
|
321
|
+
if sym == 'SE0':
|
|
322
|
+
self.samplenum_lastedge = self.samplenum
|
|
323
|
+
self.state = St.WAIT_IDLE
|
|
324
|
+
else:
|
|
325
|
+
self.wait_for_sop(sym)
|
|
326
|
+
self.edgepins = pins
|
|
327
|
+
elif self.state in (St.GET_BIT, St.GET_EOP):
|
|
328
|
+
# Wait until we're in the middle of the desired bit.
|
|
329
|
+
self.edgepins = self.wait([{'skip': self.samplenum_edge - self.samplenum}])
|
|
330
|
+
pins = self.wait([{'skip': self.samplenum_target - self.samplenum}])
|
|
331
|
+
|
|
332
|
+
sym = symbols[self.signalling][pins]
|
|
333
|
+
if self.state == St.GET_BIT:
|
|
334
|
+
self.get_bit(sym)
|
|
335
|
+
elif self.state == St.GET_EOP:
|
|
336
|
+
self.get_eop(sym)
|
|
337
|
+
elif self.state == St.WAIT_IDLE:
|
|
338
|
+
# Skip "all-low" input. Wait for high level on either DP or DM.
|
|
339
|
+
pins = self.wait()
|
|
340
|
+
while not pins[0] and not pins[1]:
|
|
341
|
+
pins = self.wait([{0: 'h'}, {1: 'h'}])
|
|
342
|
+
if self.samplenum - self.samplenum_lastedge > 1:
|
|
343
|
+
sym = symbols[self.options['signalling']][pins]
|
|
344
|
+
self.handle_idle(sym)
|
|
345
|
+
else:
|
|
346
|
+
sym = symbols[self.signalling][pins]
|
|
347
|
+
self.wait_for_sop(sym)
|
|
348
|
+
self.edgepins = pins
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2016 Sean Burford <sburford@google.com>
|
|
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
|
+
The Wiegand interface is a de facto wiring standard commonly used to connect
|
|
22
|
+
a card swipe mechanism to the rest of an electronic entry system.
|
|
23
|
+
|
|
24
|
+
Details:
|
|
25
|
+
https://en.wikipedia.org/wiki/Wiegand_interface
|
|
26
|
+
'''
|
|
27
|
+
|
|
28
|
+
from .pd import Decoder
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2016 Sean Burford <sburford@google.com>
|
|
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 = 'wiegand'
|
|
28
|
+
name = 'Wiegand'
|
|
29
|
+
longname = 'Wiegand interface'
|
|
30
|
+
desc = 'Wiegand interface for electronic entry systems.'
|
|
31
|
+
license = 'gplv2+'
|
|
32
|
+
inputs = ['logic']
|
|
33
|
+
outputs = []
|
|
34
|
+
tags = ['Embedded/industrial', 'RFID']
|
|
35
|
+
channels = (
|
|
36
|
+
{'id': 'd0', 'name': 'D0', 'desc': 'Data 0 line'},
|
|
37
|
+
{'id': 'd1', 'name': 'D1', 'desc': 'Data 1 line'},
|
|
38
|
+
)
|
|
39
|
+
options = (
|
|
40
|
+
{'id': 'active', 'desc': 'Data lines active level',
|
|
41
|
+
'default': 'low', 'values': ('low', 'high')},
|
|
42
|
+
{'id': 'bitwidth_ms', 'desc': 'Single bit width in milliseconds',
|
|
43
|
+
'default': 4, 'values': (1, 2, 4, 8, 16, 32)},
|
|
44
|
+
)
|
|
45
|
+
annotations = (
|
|
46
|
+
('bit', 'Bit'),
|
|
47
|
+
('state', 'State'),
|
|
48
|
+
)
|
|
49
|
+
annotation_rows = (
|
|
50
|
+
('bits', 'Bits', (0,)),
|
|
51
|
+
('states', 'Stream states', (1,)),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
def __init__(self):
|
|
55
|
+
self.reset()
|
|
56
|
+
|
|
57
|
+
def reset(self):
|
|
58
|
+
self.samplerate = None
|
|
59
|
+
self._samples_per_bit = 10
|
|
60
|
+
|
|
61
|
+
self._d0_prev = None
|
|
62
|
+
self._d1_prev = None
|
|
63
|
+
|
|
64
|
+
self._state = None
|
|
65
|
+
self.ss_state = None
|
|
66
|
+
|
|
67
|
+
self.ss_bit = None
|
|
68
|
+
self.es_bit = None
|
|
69
|
+
self._bit = None
|
|
70
|
+
self._bits = []
|
|
71
|
+
|
|
72
|
+
def start(self):
|
|
73
|
+
'Register output types and verify user supplied decoder values.'
|
|
74
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
75
|
+
self._active = 1 if self.options['active'] == 'high' else 0
|
|
76
|
+
self._inactive = 1 - self._active
|
|
77
|
+
|
|
78
|
+
def metadata(self, key, value):
|
|
79
|
+
'Receive decoder metadata about the data stream.'
|
|
80
|
+
if key == srd.SRD_CONF_SAMPLERATE:
|
|
81
|
+
self.samplerate = value
|
|
82
|
+
if self.samplerate:
|
|
83
|
+
ms_per_sample = 1000 * (1.0 / self.samplerate)
|
|
84
|
+
ms_per_bit = float(self.options['bitwidth_ms'])
|
|
85
|
+
self._samples_per_bit = int(max(1, int(ms_per_bit / ms_per_sample)))
|
|
86
|
+
|
|
87
|
+
def _update_state(self, state, bit=None):
|
|
88
|
+
'Update state and bit values when they change.'
|
|
89
|
+
if self._bit is not None:
|
|
90
|
+
self._bits.append(self._bit)
|
|
91
|
+
self.put(self.ss_bit, self.samplenum, self.out_ann,
|
|
92
|
+
[0, [str(self._bit)]])
|
|
93
|
+
self._bit = bit
|
|
94
|
+
self.ss_bit = self.samplenum
|
|
95
|
+
if bit is not None:
|
|
96
|
+
# Set a timeout so that the final bit ends.
|
|
97
|
+
self.es_bit = self.samplenum + self._samples_per_bit
|
|
98
|
+
else:
|
|
99
|
+
self.es_bit = None
|
|
100
|
+
|
|
101
|
+
if state != self._state:
|
|
102
|
+
ann = None
|
|
103
|
+
if self._state == 'data':
|
|
104
|
+
accum_bits = ''.join(str(x) for x in self._bits)
|
|
105
|
+
ann = [1, ['%d bits %s' % (len(self._bits), accum_bits),
|
|
106
|
+
'%d bits' % len(self._bits)]]
|
|
107
|
+
elif self._state == 'invalid':
|
|
108
|
+
ann = [1, [self._state]]
|
|
109
|
+
if ann:
|
|
110
|
+
self.put(self.ss_state, self.samplenum, self.out_ann, ann)
|
|
111
|
+
self.ss_state = self.samplenum
|
|
112
|
+
self._state = state
|
|
113
|
+
self._bits = []
|
|
114
|
+
|
|
115
|
+
def decode(self):
|
|
116
|
+
if not self.samplerate:
|
|
117
|
+
raise SamplerateError('Cannot decode without samplerate.')
|
|
118
|
+
while True:
|
|
119
|
+
# TODO: Come up with more appropriate self.wait() conditions.
|
|
120
|
+
(d0, d1) = self.wait()
|
|
121
|
+
|
|
122
|
+
if d0 == self._d0_prev and d1 == self._d1_prev:
|
|
123
|
+
if self.es_bit and self.samplenum >= self.es_bit:
|
|
124
|
+
if (d0, d1) == (self._inactive, self._inactive):
|
|
125
|
+
self._update_state('idle')
|
|
126
|
+
else:
|
|
127
|
+
self._update_state('invalid')
|
|
128
|
+
continue
|
|
129
|
+
|
|
130
|
+
if self._state in (None, 'idle', 'data'):
|
|
131
|
+
if (d0, d1) == (self._active, self._inactive):
|
|
132
|
+
self._update_state('data', 0)
|
|
133
|
+
elif (d0, d1) == (self._inactive, self._active):
|
|
134
|
+
self._update_state('data', 1)
|
|
135
|
+
elif (d0, d1) == (self._active, self._active):
|
|
136
|
+
self._update_state('invalid')
|
|
137
|
+
elif self._state == 'invalid':
|
|
138
|
+
# Wait until we see an idle state before leaving invalid.
|
|
139
|
+
# This prevents inverted lines from being misread.
|
|
140
|
+
if (d0, d1) == (self._inactive, self._inactive):
|
|
141
|
+
self._update_state('idle')
|
|
142
|
+
|
|
143
|
+
self._d0_prev, self._d1_prev = d0, d1
|
|
144
|
+
|
|
145
|
+
def report(self):
|
|
146
|
+
return '%s: %s D0 %d D1 %d (active on %d), %d samples per bit' % (
|
|
147
|
+
self.name, self._state, self._d0_prev, self._d1_prev,
|
|
148
|
+
self._active, self._samples_per_bit)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2018 Stefan Petersen <spe@ciellt.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
|
+
'''
|
|
21
|
+
This decoder stacks on top of the 'spi' PD and decodes the Xicor X2444M/P
|
|
22
|
+
nonvolatile static RAM protocol.
|
|
23
|
+
'''
|
|
24
|
+
|
|
25
|
+
from .pd import Decoder
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2018 Stefan Petersen <spe@ciellt.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 re
|
|
21
|
+
import sigrokdecode as srd
|
|
22
|
+
|
|
23
|
+
registers = {
|
|
24
|
+
0x80: ['WRDS', 0, lambda _: ''],
|
|
25
|
+
0x81: ['STO', 1, lambda _: ''],
|
|
26
|
+
0x82: ['SLEEP', 2, lambda _: ''],
|
|
27
|
+
0x83: ['WRITE', 3, lambda v: '0x%x' % v],
|
|
28
|
+
0x84: ['WREN', 4, lambda _: ''],
|
|
29
|
+
0x85: ['RCL', 5, lambda _: ''],
|
|
30
|
+
0x86: ['READ', 6, lambda v: '0x%x' % v],
|
|
31
|
+
0x87: ['READ', 6, lambda v: '0x%x' % v],
|
|
32
|
+
# 0x86/0x87 are both valid READ commands (bit 0 is "don't care").
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
class Decoder(srd.Decoder):
|
|
36
|
+
api_version = 3
|
|
37
|
+
id = 'x2444m'
|
|
38
|
+
name = 'X2444M/P'
|
|
39
|
+
longname = 'Xicor X2444M/P'
|
|
40
|
+
desc = 'Xicor X2444M/P nonvolatile static RAM protocol.'
|
|
41
|
+
license = 'gplv2+'
|
|
42
|
+
inputs = ['spi']
|
|
43
|
+
outputs = []
|
|
44
|
+
tags = ['IC', 'Memory']
|
|
45
|
+
annotations = (
|
|
46
|
+
('wrds', 'Write disable'),
|
|
47
|
+
('sto', 'Store RAM data in EEPROM'),
|
|
48
|
+
('sleep', 'Enter sleep mode'),
|
|
49
|
+
('write', 'Write data into RAM'),
|
|
50
|
+
('wren', 'Write enable'),
|
|
51
|
+
('rcl', 'Recall EEPROM data into RAM'),
|
|
52
|
+
('read', 'Data read from RAM'),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def __init__(self):
|
|
56
|
+
self.reset()
|
|
57
|
+
|
|
58
|
+
def reset(self):
|
|
59
|
+
self.cs_start = 0
|
|
60
|
+
self.cs_asserted = False
|
|
61
|
+
self.cmd_digit = 0
|
|
62
|
+
|
|
63
|
+
def start(self):
|
|
64
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
65
|
+
|
|
66
|
+
def putreadwrite(self, ss, es, reg, idx, addr, value):
|
|
67
|
+
self.put(ss, es, self.out_ann,
|
|
68
|
+
[idx, ['%s: %s => 0x%4.4x' % (reg, addr, value),
|
|
69
|
+
'%s: %s => 0x%4.4x' % (reg[0], addr, value), reg[0]]])
|
|
70
|
+
|
|
71
|
+
def putcmd(self, ss, es, reg, idx):
|
|
72
|
+
self.put(ss, es, self.out_ann, [idx, [reg, reg[0]]])
|
|
73
|
+
|
|
74
|
+
def decode(self, ss, es, data):
|
|
75
|
+
ptype, mosi, miso = data
|
|
76
|
+
|
|
77
|
+
if ptype == 'DATA':
|
|
78
|
+
if not self.cs_asserted:
|
|
79
|
+
return
|
|
80
|
+
|
|
81
|
+
if self.cmd_digit == 0:
|
|
82
|
+
self.addr = mosi
|
|
83
|
+
self.addr_start = ss
|
|
84
|
+
elif self.cmd_digit > 0:
|
|
85
|
+
self.read_value = (self.read_value << 8) + miso
|
|
86
|
+
self.write_value = (self.write_value << 8) + mosi
|
|
87
|
+
self.cmd_digit += 1
|
|
88
|
+
elif ptype == 'CS-CHANGE':
|
|
89
|
+
self.cs_asserted = (miso == 1)
|
|
90
|
+
# When not asserted, CS has just changed from asserted to deasserted.
|
|
91
|
+
if not self.cs_asserted:
|
|
92
|
+
# Only one digit, simple command. Else read/write.
|
|
93
|
+
if self.cmd_digit == 1:
|
|
94
|
+
name, idx, decoder = registers[self.addr & 0x87]
|
|
95
|
+
self.putcmd(self.addr_start, es, name, idx)
|
|
96
|
+
elif self.cmd_digit > 1:
|
|
97
|
+
name, idx, decoder = registers[self.addr & 0x87]
|
|
98
|
+
if name == 'READ':
|
|
99
|
+
value = self.read_value
|
|
100
|
+
elif name == 'WRITE':
|
|
101
|
+
value = self.write_value
|
|
102
|
+
else:
|
|
103
|
+
value = 0
|
|
104
|
+
self.putreadwrite(self.addr_start, es, name, idx,
|
|
105
|
+
decoder((self.addr >> 3) & 0x0f), value)
|
|
106
|
+
|
|
107
|
+
if self.cs_asserted:
|
|
108
|
+
self.cs_start = ss
|
|
109
|
+
self.cmd_digit = 0
|
|
110
|
+
self.read_value = 0
|
|
111
|
+
self.write_value = 0
|