logic-agent-mcp 0.0.0-stage → 1.3.0
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 +213 -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/libz-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/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,27 @@
|
|
|
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 is a generic I²C demultiplexing protocol decoder.
|
|
22
|
+
|
|
23
|
+
It takes an I²C stream as input and outputs multiple I²C streams, each
|
|
24
|
+
stream containing only I²C packets for one specific I²C slave.
|
|
25
|
+
'''
|
|
26
|
+
|
|
27
|
+
from .pd import Decoder
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
import sigrokdecode as srd
|
|
21
|
+
|
|
22
|
+
class Decoder(srd.Decoder):
|
|
23
|
+
api_version = 3
|
|
24
|
+
id = 'i2cdemux'
|
|
25
|
+
name = 'I²C demux'
|
|
26
|
+
longname = 'I²C demultiplexer'
|
|
27
|
+
desc = 'Demux I²C packets into per-slave-address streams.'
|
|
28
|
+
license = 'gplv2+'
|
|
29
|
+
inputs = ['i2c']
|
|
30
|
+
outputs = [] # TODO: Only known at run-time.
|
|
31
|
+
tags = ['Util']
|
|
32
|
+
|
|
33
|
+
def __init__(self):
|
|
34
|
+
self.reset()
|
|
35
|
+
|
|
36
|
+
def reset(self):
|
|
37
|
+
self.packets = [] # Local cache of I²C packets
|
|
38
|
+
self.slaves = [] # List of known slave addresses
|
|
39
|
+
self.stream = -1 # Current output stream
|
|
40
|
+
self.streamcount = 0 # Number of created output streams
|
|
41
|
+
|
|
42
|
+
def start(self):
|
|
43
|
+
self.out_python = []
|
|
44
|
+
|
|
45
|
+
# Grab I²C packets into a local cache, until an I²C STOP condition
|
|
46
|
+
# packet comes along. At some point before that STOP condition, there
|
|
47
|
+
# will have been an ADDRESS READ or ADDRESS WRITE which contains the
|
|
48
|
+
# I²C address of the slave that the master wants to talk to.
|
|
49
|
+
# We use this slave address to figure out which output stream should
|
|
50
|
+
# get the whole chunk of packets (from START to STOP).
|
|
51
|
+
def decode(self, ss, es, data):
|
|
52
|
+
|
|
53
|
+
cmd, databyte = data
|
|
54
|
+
|
|
55
|
+
# Add the I²C packet to our local cache.
|
|
56
|
+
self.packets.append([ss, es, data])
|
|
57
|
+
|
|
58
|
+
if cmd in ('ADDRESS READ', 'ADDRESS WRITE'):
|
|
59
|
+
if databyte in self.slaves:
|
|
60
|
+
self.stream = self.slaves.index(databyte)
|
|
61
|
+
return
|
|
62
|
+
|
|
63
|
+
# We're never seen this slave, add a new stream.
|
|
64
|
+
self.slaves.append(databyte)
|
|
65
|
+
self.out_python.append(self.register(srd.OUTPUT_PYTHON,
|
|
66
|
+
proto_id='i2c-%s' % hex(databyte)))
|
|
67
|
+
self.stream = self.streamcount
|
|
68
|
+
self.streamcount += 1
|
|
69
|
+
elif cmd == 'STOP':
|
|
70
|
+
if self.stream == -1:
|
|
71
|
+
raise Exception('Invalid stream!') # FIXME?
|
|
72
|
+
|
|
73
|
+
# Send the whole chunk of I²C packets to the correct stream.
|
|
74
|
+
for p in self.packets:
|
|
75
|
+
self.put(p[0], p[1], self.out_python[self.stream], p[2])
|
|
76
|
+
|
|
77
|
+
self.packets = []
|
|
78
|
+
self.stream = -1
|
|
79
|
+
else:
|
|
80
|
+
pass # Do nothing, only add the I²C packet to our cache.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Bert Vermeulen <bert@biot.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 3 of the License, or
|
|
9
|
+
## (at your option) any later version.
|
|
10
|
+
##
|
|
11
|
+
## This program is distributed in the hope that it will be useful,
|
|
12
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
## GNU General Public License for more details.
|
|
15
|
+
##
|
|
16
|
+
## You should have received a copy of the GNU General Public License
|
|
17
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
##
|
|
19
|
+
|
|
20
|
+
'''
|
|
21
|
+
This is a generic I²C filtering protocol decoder.
|
|
22
|
+
|
|
23
|
+
It takes input from the I²C protocol decoder and removes all traffic
|
|
24
|
+
except that from/to the specified slave address and/or direction.
|
|
25
|
+
|
|
26
|
+
It then outputs the filtered data again as OUTPUT_PROTO of type/format 'i2c'
|
|
27
|
+
(up the protocol decoder stack). No annotations are output.
|
|
28
|
+
|
|
29
|
+
The I²C slave address to filter out should be passed in as an option
|
|
30
|
+
'address', as an integer. A specific read or write operation can be selected
|
|
31
|
+
with the 'direction' option, which should be 'read', 'write', or 'both'.
|
|
32
|
+
|
|
33
|
+
Both of these are optional; if no options are specified the entire payload
|
|
34
|
+
of the I²C session will be output.
|
|
35
|
+
'''
|
|
36
|
+
|
|
37
|
+
from .pd import Decoder
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
|
|
5
|
+
## Copyright (C) 2012 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 3 of the License, or
|
|
10
|
+
## (at your option) any later version.
|
|
11
|
+
##
|
|
12
|
+
## This program is distributed in the hope that it will be useful,
|
|
13
|
+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
## GNU General Public License for more details.
|
|
16
|
+
##
|
|
17
|
+
## You should have received a copy of the GNU General Public License
|
|
18
|
+
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
##
|
|
20
|
+
|
|
21
|
+
# TODO
|
|
22
|
+
# - Accept other slave address forms than decimal numbers?
|
|
23
|
+
# - Support for filtering out multiple slave/direction pairs?
|
|
24
|
+
# - Support 10bit slave addresses?
|
|
25
|
+
|
|
26
|
+
import copy
|
|
27
|
+
import sigrokdecode as srd
|
|
28
|
+
|
|
29
|
+
class Decoder(srd.Decoder):
|
|
30
|
+
api_version = 3
|
|
31
|
+
id = 'i2cfilter'
|
|
32
|
+
name = 'I²C filter'
|
|
33
|
+
longname = 'I²C filter'
|
|
34
|
+
desc = 'Filter out addresses/directions in an I²C stream.'
|
|
35
|
+
license = 'gplv3+'
|
|
36
|
+
inputs = ['i2c']
|
|
37
|
+
outputs = ['i2c']
|
|
38
|
+
tags = ['Util']
|
|
39
|
+
options = (
|
|
40
|
+
{'id': 'address', 'desc': 'Slave address to filter (decimal)',
|
|
41
|
+
'default': 0},
|
|
42
|
+
{'id': 'direction', 'desc': 'Direction to filter', 'default': 'both',
|
|
43
|
+
'values': ('read', 'write', 'both')}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def __init__(self):
|
|
47
|
+
self.reset()
|
|
48
|
+
|
|
49
|
+
def reset(self):
|
|
50
|
+
self.seen_packets = []
|
|
51
|
+
self.do_forward = None
|
|
52
|
+
|
|
53
|
+
def start(self):
|
|
54
|
+
self.out_python = self.register(srd.OUTPUT_PYTHON, proto_id='i2c')
|
|
55
|
+
if self.options['address'] not in range(0, 127 + 1):
|
|
56
|
+
raise Exception('Invalid slave (must be 0..127).')
|
|
57
|
+
self.want_addrs = []
|
|
58
|
+
if self.options['address']:
|
|
59
|
+
self.want_addrs.append(self.options['address'])
|
|
60
|
+
self.want_dir = {
|
|
61
|
+
'read': 'READ', 'write': 'WRITE',
|
|
62
|
+
}.get(self.options['direction'], None)
|
|
63
|
+
|
|
64
|
+
def _need_to_forward(self, slave_addr, direction):
|
|
65
|
+
if self.want_addrs and slave_addr not in self.want_addrs:
|
|
66
|
+
return False
|
|
67
|
+
if self.want_dir and direction != self.want_dir:
|
|
68
|
+
return False
|
|
69
|
+
return True
|
|
70
|
+
|
|
71
|
+
# Accumulate observed I2C packets until a STOP or REPEATED START
|
|
72
|
+
# condition is seen. These are conditions where transfers end or
|
|
73
|
+
# where direction potentially changes. Forward all previously
|
|
74
|
+
# accumulated traffic if it passes the slave address and direction
|
|
75
|
+
# filter. This assumes that the slave address as well as the read
|
|
76
|
+
# or write direction was part of the observed traffic. There should
|
|
77
|
+
# be no surprise when incomplete traffic does not match the filter
|
|
78
|
+
# condition.
|
|
79
|
+
def decode(self, ss, es, data):
|
|
80
|
+
|
|
81
|
+
# Unconditionally accumulate every lower layer packet we see.
|
|
82
|
+
# Keep deep copies for later, only reference caller's values
|
|
83
|
+
# as long as this .decode() invocation executes.
|
|
84
|
+
self.seen_packets.append([ss, es, copy.deepcopy(data)])
|
|
85
|
+
cmd, _ = data
|
|
86
|
+
|
|
87
|
+
# Check the slave address and transfer direction early when
|
|
88
|
+
# we see them. Keep accumulating packets while it's already
|
|
89
|
+
# known here whether to forward them. This simplifies other
|
|
90
|
+
# code paths. Including future handling of 10bit addresses.
|
|
91
|
+
if cmd in ('ADDRESS READ', 'ADDRESS WRITE'):
|
|
92
|
+
direction = cmd[len('ADDRESS '):]
|
|
93
|
+
_, slave_addr = data
|
|
94
|
+
self.do_forward = self._need_to_forward(slave_addr, direction)
|
|
95
|
+
return
|
|
96
|
+
|
|
97
|
+
# Forward previously accumulated packets as we see their
|
|
98
|
+
# completion, and when they pass the filter condition. Prepare
|
|
99
|
+
# to handle the next transfer (the next read/write part of it).
|
|
100
|
+
if cmd in ('STOP', 'START REPEAT'):
|
|
101
|
+
if self.do_forward:
|
|
102
|
+
for ss, es, data in self.seen_packets:
|
|
103
|
+
self.put(ss, es, self.out_python, data)
|
|
104
|
+
self.seen_packets.clear()
|
|
105
|
+
self.do_forward = None
|
|
106
|
+
return
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Joel Holdsworth <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
|
+
I²S (Integrated Interchip Sound) is a serial bus for connecting digital
|
|
22
|
+
audio devices (usually on the same device/board).
|
|
23
|
+
|
|
24
|
+
Details:
|
|
25
|
+
http://www.nxp.com/acrobat_download/various/I2SBUS.pdf
|
|
26
|
+
http://en.wikipedia.org/wiki/I2s
|
|
27
|
+
'''
|
|
28
|
+
|
|
29
|
+
from .pd import Decoder
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.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
|
+
import struct
|
|
22
|
+
|
|
23
|
+
'''
|
|
24
|
+
OUTPUT_PYTHON format:
|
|
25
|
+
|
|
26
|
+
Packet:
|
|
27
|
+
[<ptype>, <pdata>]
|
|
28
|
+
|
|
29
|
+
<ptype>, <pdata>:
|
|
30
|
+
- 'DATA', [<channel>, <value>]
|
|
31
|
+
|
|
32
|
+
<channel>: 'L' or 'R'
|
|
33
|
+
<value>: integer
|
|
34
|
+
'''
|
|
35
|
+
|
|
36
|
+
class Decoder(srd.Decoder):
|
|
37
|
+
api_version = 3
|
|
38
|
+
id = 'i2s'
|
|
39
|
+
name = 'I²S'
|
|
40
|
+
longname = 'Integrated Interchip Sound'
|
|
41
|
+
desc = 'Serial bus for connecting digital audio devices.'
|
|
42
|
+
license = 'gplv2+'
|
|
43
|
+
inputs = ['logic']
|
|
44
|
+
outputs = ['i2s']
|
|
45
|
+
tags = ['Audio', 'PC']
|
|
46
|
+
channels = (
|
|
47
|
+
{'id': 'sck', 'name': 'SCK', 'desc': 'Bit clock line'},
|
|
48
|
+
{'id': 'ws', 'name': 'WS', 'desc': 'Word select line'},
|
|
49
|
+
{'id': 'sd', 'name': 'SD', 'desc': 'Serial data line'},
|
|
50
|
+
)
|
|
51
|
+
annotations = (
|
|
52
|
+
('left', 'Left channel'),
|
|
53
|
+
('right', 'Right channel'),
|
|
54
|
+
('warnings', 'Warnings'),
|
|
55
|
+
)
|
|
56
|
+
binary = (
|
|
57
|
+
('wav', 'WAV file'),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def __init__(self):
|
|
61
|
+
self.reset()
|
|
62
|
+
|
|
63
|
+
def reset(self):
|
|
64
|
+
self.samplerate = None
|
|
65
|
+
self.oldws = 1
|
|
66
|
+
self.bitcount = 0
|
|
67
|
+
self.data = 0
|
|
68
|
+
self.samplesreceived = 0
|
|
69
|
+
self.first_sample = None
|
|
70
|
+
self.ss_block = None
|
|
71
|
+
self.wordlength = -1
|
|
72
|
+
self.wrote_wav_header = False
|
|
73
|
+
|
|
74
|
+
def start(self):
|
|
75
|
+
self.out_python = self.register(srd.OUTPUT_PYTHON)
|
|
76
|
+
self.out_binary = self.register(srd.OUTPUT_BINARY)
|
|
77
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
78
|
+
|
|
79
|
+
def metadata(self, key, value):
|
|
80
|
+
if key == srd.SRD_CONF_SAMPLERATE:
|
|
81
|
+
self.samplerate = value
|
|
82
|
+
|
|
83
|
+
def putpb(self, data):
|
|
84
|
+
self.put(self.ss_block, self.samplenum, self.out_python, data)
|
|
85
|
+
|
|
86
|
+
def putbin(self, data):
|
|
87
|
+
self.put(self.ss_block, self.samplenum, self.out_binary, data)
|
|
88
|
+
|
|
89
|
+
def putb(self, data):
|
|
90
|
+
self.put(self.ss_block, self.samplenum, self.out_ann, data)
|
|
91
|
+
|
|
92
|
+
def report(self):
|
|
93
|
+
# Calculate the sample rate.
|
|
94
|
+
samplerate = '?'
|
|
95
|
+
if self.ss_block is not None and \
|
|
96
|
+
self.first_sample is not None and \
|
|
97
|
+
self.ss_block > self.first_sample and \
|
|
98
|
+
self.samplerate:
|
|
99
|
+
samplerate = '%d' % (self.samplesreceived *
|
|
100
|
+
self.samplerate / (self.ss_block -
|
|
101
|
+
self.first_sample))
|
|
102
|
+
|
|
103
|
+
return 'I²S: %d %d-bit samples received at %sHz' % \
|
|
104
|
+
(self.samplesreceived, self.wordlength, samplerate)
|
|
105
|
+
|
|
106
|
+
def wav_header(self):
|
|
107
|
+
# Chunk descriptor
|
|
108
|
+
h = b'RIFF'
|
|
109
|
+
h += b'\x24\x80\x00\x00' # Chunk size (2084)
|
|
110
|
+
h += b'WAVE'
|
|
111
|
+
# Fmt subchunk
|
|
112
|
+
h += b'fmt '
|
|
113
|
+
h += b'\x10\x00\x00\x00' # Subchunk size (16 bytes)
|
|
114
|
+
h += b'\x01\x00' # Audio format (0x0001 == PCM)
|
|
115
|
+
h += b'\x02\x00' # Number of channels (2)
|
|
116
|
+
h += b'\x80\x3e\x00\x00' # Samplerate (16000)
|
|
117
|
+
h += b'\x00\xfa\x00\x00' # Byterate (64000)
|
|
118
|
+
h += b'\x04\x00' # Blockalign (4)
|
|
119
|
+
h += b'\x20\x00' # Bits per sample (32)
|
|
120
|
+
# Data subchunk
|
|
121
|
+
h += b'data'
|
|
122
|
+
h += b'\xff\xff\xff\xff' # Subchunk size (4G bytes) TODO
|
|
123
|
+
return h
|
|
124
|
+
|
|
125
|
+
def wav_sample(self, sample):
|
|
126
|
+
return struct.pack('<I', self.data)
|
|
127
|
+
|
|
128
|
+
def decode(self):
|
|
129
|
+
while True:
|
|
130
|
+
# Wait for a rising edge on the SCK pin.
|
|
131
|
+
sck, ws, sd = self.wait({0: 'r'})
|
|
132
|
+
|
|
133
|
+
self.data = (self.data << 1) | sd
|
|
134
|
+
self.bitcount += 1
|
|
135
|
+
|
|
136
|
+
# This was not the LSB unless WS has flipped.
|
|
137
|
+
if ws == self.oldws:
|
|
138
|
+
continue
|
|
139
|
+
|
|
140
|
+
# Only submit the sample, if we received the beginning of it.
|
|
141
|
+
if self.ss_block is not None:
|
|
142
|
+
|
|
143
|
+
if not self.wrote_wav_header:
|
|
144
|
+
self.put(0, 0, self.out_binary, [0, self.wav_header()])
|
|
145
|
+
self.wrote_wav_header = True
|
|
146
|
+
|
|
147
|
+
self.samplesreceived += 1
|
|
148
|
+
|
|
149
|
+
sck = self.wait({0: 'f'})
|
|
150
|
+
|
|
151
|
+
idx = 0 if not self.oldws else 1
|
|
152
|
+
c1 = 'Left channel' if not self.oldws else 'Right channel'
|
|
153
|
+
c2 = 'Left' if not self.oldws else 'Right'
|
|
154
|
+
c3 = 'L' if not self.oldws else 'R'
|
|
155
|
+
v = '%08x' % self.data
|
|
156
|
+
self.putpb(['DATA', [c3, self.data]])
|
|
157
|
+
self.putb([idx, ['%s: %s' % (c1, v), '%s: %s' % (c2, v),
|
|
158
|
+
'%s: %s' % (c3, v), c3]])
|
|
159
|
+
self.putbin([0, self.wav_sample(self.data)])
|
|
160
|
+
|
|
161
|
+
# Check that the data word was the correct length.
|
|
162
|
+
if self.wordlength != -1 and self.wordlength != self.bitcount:
|
|
163
|
+
self.putb([2, ['Received %d-bit word, expected %d-bit '
|
|
164
|
+
'word' % (self.bitcount, self.wordlength)]])
|
|
165
|
+
|
|
166
|
+
self.wordlength = self.bitcount
|
|
167
|
+
else:
|
|
168
|
+
sck = self.wait({0: 'f'})
|
|
169
|
+
|
|
170
|
+
# Reset decoder state.
|
|
171
|
+
self.data = 0
|
|
172
|
+
self.bitcount = 0
|
|
173
|
+
self.ss_block = self.samplenum
|
|
174
|
+
|
|
175
|
+
# Save the first sample position.
|
|
176
|
+
if self.first_sample is None:
|
|
177
|
+
self.first_sample = self.samplenum
|
|
178
|
+
|
|
179
|
+
self.oldws = ws
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2019 Gerhard Sittig <gerhard.sittig@gmx.net>
|
|
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 protocol decoder can decode the GPIB (IEEE-488) protocol. Both variants
|
|
22
|
+
of (up to) 16 parallel lines as well as serial communication (IEC bus) are
|
|
23
|
+
supported in this implementation.
|
|
24
|
+
'''
|
|
25
|
+
|
|
26
|
+
from .pd import Decoder
|