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,699 @@
|
|
|
1
|
+
##
|
|
2
|
+
## This file is part of the libsigrokdecode project.
|
|
3
|
+
##
|
|
4
|
+
## Copyright (C) 2019 Vesa-Pekka Palmu <vpalmu@depili.fi>
|
|
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
|
+
import sigrokdecode as srd
|
|
21
|
+
from math import ceil
|
|
22
|
+
from common.srdhelper import SrdIntEnum
|
|
23
|
+
from .lists import *
|
|
24
|
+
|
|
25
|
+
L = len(cmds)
|
|
26
|
+
RX = 0
|
|
27
|
+
TX = 1
|
|
28
|
+
|
|
29
|
+
Ann = SrdIntEnum.from_list('Ann',
|
|
30
|
+
[c[0] for c in cmds.values()] + ['BIT', 'FIELD', 'WARN'])
|
|
31
|
+
|
|
32
|
+
def cmd_annotation_classes():
|
|
33
|
+
return tuple([tuple([cmd[0].lower(), cmd[1]]) for cmd in cmds.values()])
|
|
34
|
+
|
|
35
|
+
class Decoder(srd.Decoder):
|
|
36
|
+
api_version = 3
|
|
37
|
+
id = 'amulet_ascii'
|
|
38
|
+
name = 'Amulet ASCII'
|
|
39
|
+
longname = 'Amulet LCD ASCII'
|
|
40
|
+
desc = 'Amulet Technologies LCD controller ASCII protocol.'
|
|
41
|
+
license = 'gplv3+'
|
|
42
|
+
inputs = ['uart']
|
|
43
|
+
outputs = []
|
|
44
|
+
tags = ['Display']
|
|
45
|
+
annotations = cmd_annotation_classes() + (
|
|
46
|
+
('bit', 'Bit'),
|
|
47
|
+
('field', 'Field'),
|
|
48
|
+
('warning', 'Warning'),
|
|
49
|
+
)
|
|
50
|
+
annotation_rows = (
|
|
51
|
+
('bits', 'Bits', (L + 0,)),
|
|
52
|
+
('fields', 'Fields', (L + 1,)),
|
|
53
|
+
('commands', 'Commands', tuple(range(L))),
|
|
54
|
+
('warnings', 'Warnings', (L + 2,)),
|
|
55
|
+
)
|
|
56
|
+
options = (
|
|
57
|
+
{'id': 'ms_chan', 'desc': 'Master -> slave channel',
|
|
58
|
+
'default': 'RX', 'values': ('RX', 'TX')},
|
|
59
|
+
{'id': 'sm_chan', 'desc': 'Slave -> master channel',
|
|
60
|
+
'default': 'TX', 'values': ('RX', 'TX')},
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
def __init__(self):
|
|
64
|
+
self.reset()
|
|
65
|
+
|
|
66
|
+
def reset(self):
|
|
67
|
+
self.state = None
|
|
68
|
+
self.cmdstate = None
|
|
69
|
+
|
|
70
|
+
# Build dict mapping command keys to handler functions. Each
|
|
71
|
+
# command in 'cmds' (defined in lists.py) has a matching
|
|
72
|
+
# handler self.handle_<shortname>.
|
|
73
|
+
def get_handler(cmd):
|
|
74
|
+
s = 'handle_%s' % cmds[cmd][0].lower().replace('/', '_')
|
|
75
|
+
return getattr(self, s)
|
|
76
|
+
self.cmd_handlers = dict((cmd, get_handler(cmd)) for cmd in cmds.keys())
|
|
77
|
+
|
|
78
|
+
def start(self):
|
|
79
|
+
self.out_ann = self.register(srd.OUTPUT_ANN)
|
|
80
|
+
|
|
81
|
+
def putx(self, data):
|
|
82
|
+
# Simplification, most annotations span exactly one SPI byte/packet.
|
|
83
|
+
self.put(self.ss, self.es, self.out_ann, data)
|
|
84
|
+
|
|
85
|
+
def putf(self, data):
|
|
86
|
+
self.put(self.ss_field, self.es_field, self.out_ann, data)
|
|
87
|
+
|
|
88
|
+
def putc(self, data):
|
|
89
|
+
self.put(self.ss_cmd, self.es_cmd, self.out_ann, data)
|
|
90
|
+
|
|
91
|
+
def cmd_ann_list(self):
|
|
92
|
+
x, s = cmds[self.state][0], cmds[self.state][1]
|
|
93
|
+
return ['Command: %s (%s)' % (s, x), 'Command: %s' % s,
|
|
94
|
+
'Cmd: %s' % s, 'Cmd: %s' % x, x]
|
|
95
|
+
|
|
96
|
+
def emit_cmd_byte(self):
|
|
97
|
+
self.ss_cmd = self.ss
|
|
98
|
+
self.putx([Ann.FIELD, self.cmd_ann_list()])
|
|
99
|
+
|
|
100
|
+
def emit_addr_bytes(self, pdata):
|
|
101
|
+
if self.cmdstate == 2:
|
|
102
|
+
self.ss_field = self.ss
|
|
103
|
+
self.addr = chr(pdata)
|
|
104
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
105
|
+
'Addr high 0x%c' % pdata, 'Addr h 0x%c' % pdata]])
|
|
106
|
+
elif self.cmdstate == 3:
|
|
107
|
+
self.es_field = self.es
|
|
108
|
+
self.addr += chr(pdata)
|
|
109
|
+
self.addr = int(self.addr, 16)
|
|
110
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
111
|
+
'Addr low 0x%c' % pdata, 'Addr l 0x%c' % pdata]])
|
|
112
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
113
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
114
|
+
|
|
115
|
+
def emit_cmd_end(self, data):
|
|
116
|
+
self.es_cmd = self.es
|
|
117
|
+
self.putc(data)
|
|
118
|
+
self.state = None
|
|
119
|
+
|
|
120
|
+
def handle_read(self, data):
|
|
121
|
+
if self.cmdstate == 1:
|
|
122
|
+
self.emit_cmd_byte()
|
|
123
|
+
self.addr = 0
|
|
124
|
+
elif self.cmdstate == 2:
|
|
125
|
+
self.emit_addr_bytes(pdata)
|
|
126
|
+
elif self.cmdstate == 3:
|
|
127
|
+
self.emit_addr_bytes(pdata)
|
|
128
|
+
self.cmdstate += 1
|
|
129
|
+
|
|
130
|
+
def handle_set_common(self, pdata):
|
|
131
|
+
if self.cmdstate == 1:
|
|
132
|
+
self.addr = 0
|
|
133
|
+
self.emit_addr_bytes(pdata)
|
|
134
|
+
|
|
135
|
+
def emit_not_implemented(self, data):
|
|
136
|
+
self.es_cmd = self.es
|
|
137
|
+
self.putc([Ann.WARN, ['Command not decoded', 'Not decoded']])
|
|
138
|
+
self.emit_cmd_end(data)
|
|
139
|
+
|
|
140
|
+
def handle_string(self, pdata, ann_class):
|
|
141
|
+
# TODO: unicode / string modifiers...
|
|
142
|
+
self.handle_set_common(pdata)
|
|
143
|
+
if self.cmdstate == 4:
|
|
144
|
+
self.ss_field = self.ss
|
|
145
|
+
self.value = ''
|
|
146
|
+
if pdata == 0x00:
|
|
147
|
+
# Null terminated string ends.
|
|
148
|
+
self.es_field = self.es
|
|
149
|
+
self.putx([Ann.BIT, ['NULL']])
|
|
150
|
+
self.putf([Ann.FIELD, ['Value: %s' % self.value,
|
|
151
|
+
'Val: %s' % self.value, '%s' % self.value]])
|
|
152
|
+
self.emit_cmd_end([ann_class, self.cmd_ann_list()])
|
|
153
|
+
return
|
|
154
|
+
if self.cmdstate > 3:
|
|
155
|
+
self.value += chr(pdata)
|
|
156
|
+
self.putx([Ann.BIT, ['%c' % pdata]])
|
|
157
|
+
self.cmdstate += 1
|
|
158
|
+
|
|
159
|
+
# Command handlers
|
|
160
|
+
|
|
161
|
+
# Page change 0xA0, 0x02, index_high, index_low, checksum
|
|
162
|
+
def handle_page(self, pdata):
|
|
163
|
+
if self.cmdstate == 2:
|
|
164
|
+
if pdata == 0x02:
|
|
165
|
+
self.ss_field = self.ss_cmd
|
|
166
|
+
self.es_field = self.es
|
|
167
|
+
self.putf([Ann.FIELD, self.cmd_ann_list()])
|
|
168
|
+
self.checksum = 0xA0 + 0x02
|
|
169
|
+
else:
|
|
170
|
+
self.putx([Ann.WARN, ['Illegal second byte for page change',
|
|
171
|
+
'Illegal byte']])
|
|
172
|
+
self.state = None
|
|
173
|
+
elif self.cmdstate == 3:
|
|
174
|
+
self.ss_field = self.ss
|
|
175
|
+
self.checksum += pdata
|
|
176
|
+
self.page[0] = pdata
|
|
177
|
+
elif self.cmdstate == 4:
|
|
178
|
+
self.checksum += pdata
|
|
179
|
+
self.page[1] = pdata
|
|
180
|
+
self.es_field = self.es
|
|
181
|
+
if self.page[0] == self.page [1] == 0xFF:
|
|
182
|
+
# Soft reset trigger
|
|
183
|
+
self.putf(Ann.WARN, ['Soft reset', 'Reset'])
|
|
184
|
+
else:
|
|
185
|
+
page = chr(self.page[0]) + chr(self.page[1])
|
|
186
|
+
self.putf(Ann.FIELD, ['Page index: 0x%s' % page,
|
|
187
|
+
'Page: 0x%s' % page, '0x%s' % page])
|
|
188
|
+
elif self.cmdstate == 5:
|
|
189
|
+
self.checksum += pdata
|
|
190
|
+
if (self.checksum & 0xFF) != 0:
|
|
191
|
+
self.putx([Ann.WARN, ['Checksum error', 'Error', 'ERR']])
|
|
192
|
+
else:
|
|
193
|
+
self.putx([Ann.FIELD, ['Checksum OK', 'OK']])
|
|
194
|
+
self.emit_cmd_end(Ann.PAGE)
|
|
195
|
+
self.cmdstate += 1
|
|
196
|
+
|
|
197
|
+
# Value reads: command byte, address high nibble, address low nibble
|
|
198
|
+
|
|
199
|
+
# Get byte value
|
|
200
|
+
def handle_gbv(self, pdata):
|
|
201
|
+
self.handle_read(pdata)
|
|
202
|
+
self.emit_cmd_end([Ann.GBV, self.cmd_ann_list()])
|
|
203
|
+
|
|
204
|
+
# Get word value
|
|
205
|
+
def handle_gwv(self, pdata):
|
|
206
|
+
self.handle_read(pdata)
|
|
207
|
+
self.emit_cmd_end([Ann.GWV, self.cmd_ann_list()])
|
|
208
|
+
|
|
209
|
+
# Get string value
|
|
210
|
+
def handle_gsv(self, pdata):
|
|
211
|
+
self.handle_read(pdata)
|
|
212
|
+
self.emit_cmd_end([Ann.GSV, self.cmd_ann_list()])
|
|
213
|
+
|
|
214
|
+
# Get label value
|
|
215
|
+
def handle_glv(self, pdata):
|
|
216
|
+
self.handle_read(pdata)
|
|
217
|
+
self.emit_cmd_end([Ann.GLV, self.cmd_ann_list()])
|
|
218
|
+
|
|
219
|
+
# Get RPC buffer
|
|
220
|
+
def handle_grpc(self, pdata):
|
|
221
|
+
if self.cmdstate == 2:
|
|
222
|
+
self.ss_field = self.ss
|
|
223
|
+
self.flags = int(chr(pdata), 16) << 4
|
|
224
|
+
elif self.cmdstate == 3:
|
|
225
|
+
self.flags += int(chr(pdata), 16)
|
|
226
|
+
self.es_field = self.es
|
|
227
|
+
self.putf([Ann.FIELD, ['RPC flag: 0x%02X' % self.flags]])
|
|
228
|
+
self.emit_cmd_end([Ann.GRPC, self.cmd_ann_list()])
|
|
229
|
+
|
|
230
|
+
# Get byte value array
|
|
231
|
+
def handle_gbva(self, pdata):
|
|
232
|
+
self.handle_read(pdata)
|
|
233
|
+
self.emit_cmd_end([Ann.GBVA, self.cmd_ann_list()])
|
|
234
|
+
|
|
235
|
+
# Get word value array
|
|
236
|
+
def handle_gwva(self, pdata):
|
|
237
|
+
self.handle_read(pdata)
|
|
238
|
+
self.emit_cmd_end([Ann.GWVA, self.cmd_ann_list()])
|
|
239
|
+
|
|
240
|
+
# Get color variable
|
|
241
|
+
def handle_gcv(self, pdata):
|
|
242
|
+
self.handle_read(pdata)
|
|
243
|
+
self.emit_cmd_end([Ann.GCV, self.cmd_ann_list()])
|
|
244
|
+
|
|
245
|
+
# Value setters: command byte, address high nibble, address low nibble, data bytes
|
|
246
|
+
|
|
247
|
+
# Set byte value data = high nibble, low nibble
|
|
248
|
+
def handle_sbv(self, pdata):
|
|
249
|
+
self.handle_set_common(pdata)
|
|
250
|
+
if self.cmdstate == 4:
|
|
251
|
+
self.ss_field = self.ss
|
|
252
|
+
self.value = chr(pdata)
|
|
253
|
+
elif self.cmdstate == 5:
|
|
254
|
+
self.value += chr(pdata)
|
|
255
|
+
self.es_field = self.es
|
|
256
|
+
self.putf([Ann.FIELD, ['Value: 0x%s' % self.value,
|
|
257
|
+
'Val: 0x%s' % self.value, '0x%s' % self.value]])
|
|
258
|
+
self.emit_cmd_end([Ann.SBV, self.cmd_ann_list()])
|
|
259
|
+
self.cmdstate += 1
|
|
260
|
+
|
|
261
|
+
# Set word value, msb high, msb low, lsb high, lsb low
|
|
262
|
+
def handle_swv(self, pdata):
|
|
263
|
+
self.handle_set_common(pdata)
|
|
264
|
+
if self.cmdstate > 3:
|
|
265
|
+
nibble = self.cmdstate - 4
|
|
266
|
+
if nibble == 0:
|
|
267
|
+
self.ss_field = self.ss
|
|
268
|
+
self.value = 0
|
|
269
|
+
self.value += int(chr(pdata), 16) << 12 - (4 * nibble)
|
|
270
|
+
if nibble == 3:
|
|
271
|
+
self.es_field = self.es
|
|
272
|
+
self.putf([Ann.FIELD, ['Value: 0x%04x' % self.value,
|
|
273
|
+
'Val: 0x%04x' % self.value, '0x%04x' % self.value]])
|
|
274
|
+
self.emit_cmd_end([Ann.SWV, self.cmd_ann_list()])
|
|
275
|
+
return
|
|
276
|
+
self.cmdstate += 1
|
|
277
|
+
|
|
278
|
+
# Set string value, null terminated utf8 strings
|
|
279
|
+
def handle_ssv(self, pdata):
|
|
280
|
+
self.handle_string(pdata, Ann.SSV)
|
|
281
|
+
|
|
282
|
+
# Set byte value array
|
|
283
|
+
def handle_sbva(self, pdata):
|
|
284
|
+
nibble = (self.cmdstate - 3) % 2
|
|
285
|
+
if self.cmdstate == 2:
|
|
286
|
+
self.addr = int(chr(pdata), 16) << 4
|
|
287
|
+
self.ss_field = self.ss
|
|
288
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
289
|
+
'Addr high 0x%c' % pdata, '0x%c' % pdata]])
|
|
290
|
+
elif self.cmdstate == 3:
|
|
291
|
+
self.addr += int(chr(pdata), 16)
|
|
292
|
+
self.es_field = self.ss
|
|
293
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
294
|
+
'Addr low 0x%c' % pdata, '0x%c' % pdata]])
|
|
295
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
296
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
297
|
+
elif stage == 2:
|
|
298
|
+
if pdata == 0x00:
|
|
299
|
+
# Null terminated list
|
|
300
|
+
self.emit_cmd_end([Ann.SBVA, self.cmd_ann_list()])
|
|
301
|
+
return
|
|
302
|
+
self.value = int(chr(pdata), 16) << 4
|
|
303
|
+
else:
|
|
304
|
+
self.value += int(chr(pdata), 16)
|
|
305
|
+
self.es_field = self.es
|
|
306
|
+
self.putf([Ann.FIELD, ['Value 0x%02X' % self.value,
|
|
307
|
+
'0x%02X' % self.value]])
|
|
308
|
+
self.cmdstate += 1
|
|
309
|
+
|
|
310
|
+
# Set word value array
|
|
311
|
+
def handle_swva(self, pdata):
|
|
312
|
+
nibble = (self.cmdstate - 3) % 4
|
|
313
|
+
if self.cmdstate == 2:
|
|
314
|
+
self.addr = int(chr(pdata), 16) << 4
|
|
315
|
+
self.ss_field = self.ss
|
|
316
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
317
|
+
'Addr high 0x%c' % pdata, '0x%c' % pdata]])
|
|
318
|
+
elif self.cmdstate == 3:
|
|
319
|
+
self.addr += int(chr(pdata), 16)
|
|
320
|
+
self.es_field = self.ss
|
|
321
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
322
|
+
'Addr low 0x%c' % pdata, '0x%c' % pdata]])
|
|
323
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
324
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
325
|
+
self.value = 0
|
|
326
|
+
else:
|
|
327
|
+
self.value += int(chr(pdata), 16) << 12 - (4 * nibble)
|
|
328
|
+
if nibble == 0:
|
|
329
|
+
if pdata == 0x00:
|
|
330
|
+
# Null terminated list
|
|
331
|
+
self.emit_cmd_end([Ann.SWVA, self.cmd_ann_list()])
|
|
332
|
+
return
|
|
333
|
+
self.ss_field = self.ss
|
|
334
|
+
if nibble == 3:
|
|
335
|
+
self.es_field = self.es
|
|
336
|
+
self.putf([Ann.FIELD, ['Value 0x%04X' % self.value,
|
|
337
|
+
'0x%04X' % self.value]])
|
|
338
|
+
self.cmdstate += 1
|
|
339
|
+
|
|
340
|
+
# Set color variable
|
|
341
|
+
def handle_scv(self, pdata):
|
|
342
|
+
if self.cmdstate == 8:
|
|
343
|
+
self.emit_not_implemented([Ann.SCV, self.cmd_ann_list()])
|
|
344
|
+
self.cmdstate += 1
|
|
345
|
+
|
|
346
|
+
# RPC trigger
|
|
347
|
+
def handle_rpc(self, pdata):
|
|
348
|
+
self.handle_read(pdata)
|
|
349
|
+
self.emit_cmd_end([Ann.RPC, self.cmd_ann_list()])
|
|
350
|
+
|
|
351
|
+
# Drawing
|
|
352
|
+
|
|
353
|
+
# Decode pair of (x,y) 16bit coordinates
|
|
354
|
+
def decode_coords(self, pdata):
|
|
355
|
+
if self.cmdstate == 1:
|
|
356
|
+
self.coords[0] = 0
|
|
357
|
+
self.coords[1] = 0
|
|
358
|
+
self.coords[2] = 0
|
|
359
|
+
self.coords[3] = 0
|
|
360
|
+
if self.cmdstate < 18:
|
|
361
|
+
# Coordinates
|
|
362
|
+
nibble = (self.cmdstate - 1) % 4
|
|
363
|
+
i = (self.cmdstate - 1) / 4
|
|
364
|
+
self.coords[i] += int(chr(pdata), 16) << 12 - (4 * nibble)
|
|
365
|
+
if nibble == 0:
|
|
366
|
+
self.ss_field = self.ss
|
|
367
|
+
elif nibble == 3:
|
|
368
|
+
self.es_field = self.es
|
|
369
|
+
self.putf([Ann.FIELD, ['Coordinate 0x%04X' % self.coords[i]],
|
|
370
|
+
['0x%04X' % self.coords[i]]])
|
|
371
|
+
|
|
372
|
+
# TODO: There are actually two protocol revisions for drawing.
|
|
373
|
+
# Both use 4 bytes for 16bit x and y pairs for start and end.
|
|
374
|
+
# The older follows this by a pattern selector and then line weight.
|
|
375
|
+
# Newer version has 6 bytes for 8bit RGB color...
|
|
376
|
+
|
|
377
|
+
# Draw line
|
|
378
|
+
def handle_line(self, pdata):
|
|
379
|
+
decode_coords(pdata)
|
|
380
|
+
if self.cmdstate == 18:
|
|
381
|
+
self.es_cmd = self.es
|
|
382
|
+
self.putc([Ann.LINE, self.cmd_ann_list()])
|
|
383
|
+
self.putc([Ann.WARN, ['Line pattern / Color not implemented']])
|
|
384
|
+
self.state = None
|
|
385
|
+
self.cmdstate += 1
|
|
386
|
+
|
|
387
|
+
# Draw rectange
|
|
388
|
+
def handle_rect(self, pdata):
|
|
389
|
+
decode_coords(pdata)
|
|
390
|
+
if self.cmdstate == 18:
|
|
391
|
+
self.es_cmd = self.es
|
|
392
|
+
self.putc([Ann.RECT, self.cmd_ann_list()])
|
|
393
|
+
self.putc([Ann.WARN, ['Line pattern / Color not implemented']])
|
|
394
|
+
self.state = None
|
|
395
|
+
self.cmdstate += 1
|
|
396
|
+
|
|
397
|
+
# Draw filled rectangle
|
|
398
|
+
def handle_frect(self, pdata):
|
|
399
|
+
decode_coords(pdata)
|
|
400
|
+
if self.cmdstate == 18:
|
|
401
|
+
self.es_cmd = self.es
|
|
402
|
+
self.putc([Ann.FRECT, self.cmd_ann_list()])
|
|
403
|
+
self.putc([Ann.WARN, ['Fill pattern / Color not implemented']])
|
|
404
|
+
self.state = None
|
|
405
|
+
self.cmdstate += 1
|
|
406
|
+
|
|
407
|
+
# Draw pixel
|
|
408
|
+
def handle_pixel(self, pdata):
|
|
409
|
+
self.es_cmd = self.es
|
|
410
|
+
self.putc([Ann.WARN, ['Draw pixel documentation is missing.', 'Undocumented']])
|
|
411
|
+
self.state = None
|
|
412
|
+
|
|
413
|
+
# Replies
|
|
414
|
+
def handle_gbvr(self, pdata):
|
|
415
|
+
self.emit_add_bytes(pdata)
|
|
416
|
+
if self.cmdstate == 4:
|
|
417
|
+
self.ss_field = self.ss
|
|
418
|
+
self.value = int(chr(pdata), 16) << 4
|
|
419
|
+
self.putx([Ann.BIT, ['High nibble 0x%s' % pdata, '0x%s' % pdata]])
|
|
420
|
+
elif self.cmdstate == 5:
|
|
421
|
+
self.value += int(chr(pdata), 16)
|
|
422
|
+
self.putx([Ann.BIT, ['Low nibble 0x%s' % pdata, '0x%s' % pdata]])
|
|
423
|
+
self.es_field = self.es
|
|
424
|
+
self.putf([Ann.FIELD, ['Value: 0x%02X' % self.value,
|
|
425
|
+
'0x%02X' % self.value]])
|
|
426
|
+
self.emit_cmd_end([Ann.GBVR, self.cmd_ann_list()])
|
|
427
|
+
self.cmdstate += 1
|
|
428
|
+
|
|
429
|
+
def handle_gwvr(self, pdata):
|
|
430
|
+
self.emit_add_bytes(pdata)
|
|
431
|
+
if self.cmdstate > 3:
|
|
432
|
+
nibble = self.cmdstate - 3
|
|
433
|
+
if nibble == 0:
|
|
434
|
+
self.value = 0
|
|
435
|
+
self.ss_field = self.ss
|
|
436
|
+
self.value += int(chr(pdata), 16) << 12 - (4 * nibble)
|
|
437
|
+
self.putx([Ann.BIT, ['0x%s' % pdata]])
|
|
438
|
+
if nibble == 3:
|
|
439
|
+
self.putf([Ann.FIELD, ['Value: 0x%04x' % self.value,
|
|
440
|
+
'0x%04X' % self.value]])
|
|
441
|
+
self.es_cmd = self.ss
|
|
442
|
+
self.emit_cmd_end([Ann.GWVR, self.cmd_ann_list()])
|
|
443
|
+
self.cmdstate += 1
|
|
444
|
+
|
|
445
|
+
def handle_gsvr(self, pdata):
|
|
446
|
+
self.handle_string(pdata, Ann.GSVR)
|
|
447
|
+
|
|
448
|
+
def handle_glvr(self, pdata):
|
|
449
|
+
self.handle_string(pdata, Ann.GLVR)
|
|
450
|
+
|
|
451
|
+
def handle_grpcr(self, pdata):
|
|
452
|
+
self.handle_addr(pdata)
|
|
453
|
+
if self.cmdstate > 3:
|
|
454
|
+
nibble = (self.cmdstate - 3) % 2
|
|
455
|
+
if nibble == 0:
|
|
456
|
+
if pdata == 0x00:
|
|
457
|
+
self.emit_cmd_end([Ann.GRPCR, self.cmd_ann_list()])
|
|
458
|
+
return
|
|
459
|
+
self.value = int(chr(pdata), 16) << 4
|
|
460
|
+
self.ss_field = self.ss
|
|
461
|
+
self.putx([Ann.BIT, ['0x%s' % pdata]])
|
|
462
|
+
if nibble == 2:
|
|
463
|
+
self.value += int(chr(pdata), 16)
|
|
464
|
+
self.es_field = self.es
|
|
465
|
+
self.putx([Ann.BIT, ['0x%s' % pdata]])
|
|
466
|
+
self.putf([Ann.FIELD, ['0x%02X' % self.value]])
|
|
467
|
+
self.cmdstate += 1
|
|
468
|
+
|
|
469
|
+
def handle_sbvr(self, pdata):
|
|
470
|
+
self.handle_set_common(pdata)
|
|
471
|
+
if self.cmdstate == 4:
|
|
472
|
+
self.ss_field = self.ss
|
|
473
|
+
self.value = chr(pdata)
|
|
474
|
+
elif self.cmdstate == 5:
|
|
475
|
+
self.value += chr(pdata)
|
|
476
|
+
self.es_field = self.es
|
|
477
|
+
self.putf([Ann.FIELD, ['Value: 0x%s' % self.value,
|
|
478
|
+
'Val: 0x%s' % self.value, '0x%s' % self.value]])
|
|
479
|
+
self.emit_cmd_end([Ann.SBVR, self.cmd_ann_list()])
|
|
480
|
+
self.cmdstate += 1
|
|
481
|
+
|
|
482
|
+
def handle_swvr(self, pdata):
|
|
483
|
+
self.handle_set_common(pdata)
|
|
484
|
+
if self.cmdstate == 4:
|
|
485
|
+
self.ss_field = self.ss
|
|
486
|
+
self.value = (pdata - 0x30) << 4
|
|
487
|
+
elif self.cmdstate == 5:
|
|
488
|
+
self.value += (pdata - 0x30)
|
|
489
|
+
self.value = self.value << 8
|
|
490
|
+
elif self.cmdstate == 6:
|
|
491
|
+
self.value += (pdata - 0x30) << 4
|
|
492
|
+
elif self.cmdstate == 7:
|
|
493
|
+
self.value += (pdata - 0x30)
|
|
494
|
+
self.es_field = self.es
|
|
495
|
+
self.putf([Ann.FIELD, ['Value: 0x%04x' % self.value,
|
|
496
|
+
'Val: 0x%04x' % self.value, '0x%04x' % self.value]])
|
|
497
|
+
self.emit_cmd_end([Ann.SWVR, self.cmd_ann_list()])
|
|
498
|
+
self.state = None
|
|
499
|
+
self.cmdstate += 1
|
|
500
|
+
|
|
501
|
+
def handle_ssvr(self, pdata):
|
|
502
|
+
self.handle_string(pdata, Ann.SSVR)
|
|
503
|
+
|
|
504
|
+
def handle_rpcr(self, pdata):
|
|
505
|
+
self.handle_read(pdata)
|
|
506
|
+
self.emit_cmd_end([Ann.RPCR, self.cmd_ann_list()])
|
|
507
|
+
|
|
508
|
+
def handle_liner(self, pdata):
|
|
509
|
+
decode_coords(pdata)
|
|
510
|
+
if self.cmdstate == 18:
|
|
511
|
+
self.es_cmd = self.es
|
|
512
|
+
self.putc([Ann.LINER, self.cmd_ann_list()])
|
|
513
|
+
self.putc([Ann.WARN, ['Line pattern / Color not implemented']])
|
|
514
|
+
self.state = None
|
|
515
|
+
self.cmdstate += 1
|
|
516
|
+
|
|
517
|
+
def handle_rectr(self, pdata):
|
|
518
|
+
decode_coords(pdata)
|
|
519
|
+
if self.cmdstate == 18:
|
|
520
|
+
self.es_cmd = self.es
|
|
521
|
+
self.putc([Ann.RECTR, self.cmd_ann_list()])
|
|
522
|
+
self.putc([Ann.WARN, ['Line pattern / Color not implemented']])
|
|
523
|
+
self.state = None
|
|
524
|
+
self.cmdstate += 1
|
|
525
|
+
|
|
526
|
+
def handle_frectr(self, pdata):
|
|
527
|
+
decode_coords(pdata)
|
|
528
|
+
if self.cmdstate == 18:
|
|
529
|
+
self.es_cmd = self.es
|
|
530
|
+
self.putc([Ann.FRECTR, self.cmd_ann_list()])
|
|
531
|
+
self.putc([Ann.WARN, ['Line pattern / Color not implemented']])
|
|
532
|
+
self.state = None
|
|
533
|
+
self.cmdstate += 1
|
|
534
|
+
|
|
535
|
+
def handle_pixelr(self, pdata):
|
|
536
|
+
self.es_cmd = self.es
|
|
537
|
+
self.putc([Ann.WARN,['Draw pixel documentation is missing.', 'Undocumented']])
|
|
538
|
+
self.state = None
|
|
539
|
+
|
|
540
|
+
def handle_gbvar(self, pdata):
|
|
541
|
+
nibble = (self.cmdstate - 3) % 2
|
|
542
|
+
if self.cmdstate == 2:
|
|
543
|
+
self.addr = int(chr(pdata), 16) << 4
|
|
544
|
+
self.ss_field = self.ss
|
|
545
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
546
|
+
'Addr high 0x%c' % pdata, '0x%c' % pdata]])
|
|
547
|
+
elif self.cmdstate == 3:
|
|
548
|
+
self.addr += int(chr(pdata), 16)
|
|
549
|
+
self.es_field = self.ss
|
|
550
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
551
|
+
'Addr low 0x%c' % pdata, '0x%c' % pdata]])
|
|
552
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
553
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
554
|
+
elif stage == 2:
|
|
555
|
+
if pdata == 0x00:
|
|
556
|
+
# Null terminated list
|
|
557
|
+
self.emit_cmd_end([Ann.GBVAR, self.cmd_ann_list()])
|
|
558
|
+
return
|
|
559
|
+
self.value = int(chr(pdata), 16) << 4
|
|
560
|
+
else:
|
|
561
|
+
self.value += int(chr(pdata), 16)
|
|
562
|
+
self.es_field = self.es
|
|
563
|
+
self.putf([Ann.FIELD, ['Value 0x%02X' % self.value,
|
|
564
|
+
'0x%02X' % self.value]])
|
|
565
|
+
self.cmdstate += 1
|
|
566
|
+
|
|
567
|
+
def handle_gwvar(self, pdata):
|
|
568
|
+
nibble = (self.cmdstate - 3) % 4
|
|
569
|
+
if self.cmdstate == 2:
|
|
570
|
+
self.addr = int(chr(pdata), 16) << 4
|
|
571
|
+
self.ss_field = self.ss
|
|
572
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
573
|
+
'Addr high 0x%c' % pdata, '0x%c' % pdata]])
|
|
574
|
+
elif self.cmdstate == 3:
|
|
575
|
+
self.addr += int(chr(pdata), 16)
|
|
576
|
+
self.es_field = self.ss
|
|
577
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
578
|
+
'Addr low 0x%c' % pdata, '0x%c' % pdata]])
|
|
579
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
580
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
581
|
+
self.value = 0
|
|
582
|
+
else:
|
|
583
|
+
self.value += int(chr(pdata), 16) << 12 - (4 * nibble)
|
|
584
|
+
if nibble == 0:
|
|
585
|
+
if pdata == 0x00:
|
|
586
|
+
# Null terminated list
|
|
587
|
+
self.emit_cmd_end([Ann.GWVAR, self.cmd_ann_list()])
|
|
588
|
+
return
|
|
589
|
+
self.ss_field = self.ss
|
|
590
|
+
if nibble == 3:
|
|
591
|
+
self.es_field = self.es
|
|
592
|
+
self.putf([Ann.FIELD, ['Value 0x%04X' % self.value,
|
|
593
|
+
'0x%04X' % self.value]])
|
|
594
|
+
self.cmdstate += 1
|
|
595
|
+
|
|
596
|
+
# Get byte variable array reply
|
|
597
|
+
def handle_sbvar(self, pdata):
|
|
598
|
+
nibble = (self.cmdstate - 3) % 2
|
|
599
|
+
if self.cmdstate == 2:
|
|
600
|
+
self.addr = int(chr(pdata), 16) << 4
|
|
601
|
+
self.ss_field = self.ss
|
|
602
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
603
|
+
'Addr high 0x%c' % pdata, '0x%c' % pdata]])
|
|
604
|
+
elif self.cmdstate == 3:
|
|
605
|
+
self.addr += int(chr(pdata), 16)
|
|
606
|
+
self.es_field = self.ss
|
|
607
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
608
|
+
'Addr low 0x%c' % pdata, '0x%c' % pdata]])
|
|
609
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
610
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
611
|
+
elif stage == 2:
|
|
612
|
+
if pdata == 0x00:
|
|
613
|
+
# Null terminated list
|
|
614
|
+
self.emit_cmd_end([Ann.SBVAR, self.cmd_ann_list()])
|
|
615
|
+
return
|
|
616
|
+
self.value = int(chr(pdata), 16) << 4
|
|
617
|
+
else:
|
|
618
|
+
self.value += int(chr(pdata), 16)
|
|
619
|
+
self.es_field = self.es
|
|
620
|
+
self.putf([Ann.FIELD, ['Value 0x%02X' % self.value,
|
|
621
|
+
'0x%02X' % self.value]])
|
|
622
|
+
self.cmdstate += 1
|
|
623
|
+
|
|
624
|
+
# Set word variable array reply
|
|
625
|
+
def handle_swvar(self, pdata):
|
|
626
|
+
nibble = (self.cmdstate - 3) % 4
|
|
627
|
+
if self.cmdstate == 2:
|
|
628
|
+
self.addr = int(chr(pdata), 16) << 4
|
|
629
|
+
self.ss_field = self.ss
|
|
630
|
+
self.putx([Ann.BIT, ['Address high nibble: %c' % pdata,
|
|
631
|
+
'Addr high 0x%c' % pdata, '0x%c' % pdata]])
|
|
632
|
+
elif self.cmdstate == 3:
|
|
633
|
+
self.addr += int(chr(pdata), 16)
|
|
634
|
+
self.es_field = self.ss
|
|
635
|
+
self.putx([Ann.BIT, ['Address low nibble: %c' % pdata,
|
|
636
|
+
'Addr low 0x%c' % pdata, '0x%c' % pdata]])
|
|
637
|
+
self.putf([Ann.FIELD, ['Address: 0x%02X' % self.addr,
|
|
638
|
+
'Addr: 0x%02X' % self.addr, '0x%02X' % self.addr]])
|
|
639
|
+
self.value = 0
|
|
640
|
+
else:
|
|
641
|
+
self.value += int(chr(pdata), 16) << 12 - (4 * nibble)
|
|
642
|
+
if nibble == 0:
|
|
643
|
+
if pdata == 0x00:
|
|
644
|
+
# Null terminated list
|
|
645
|
+
self.emit_cmd_end([Ann.SWVAR, self.cmd_ann_list()])
|
|
646
|
+
return
|
|
647
|
+
self.ss_field = self.ss
|
|
648
|
+
if nibble == 3:
|
|
649
|
+
self.es_field = self.es
|
|
650
|
+
self.putf([Ann.FIELD, ['Value 0x%04X' % self.value,
|
|
651
|
+
'0x%04X' % self.value]])
|
|
652
|
+
self.cmdstate += 1
|
|
653
|
+
|
|
654
|
+
def handle_gcvr(self, pdata):
|
|
655
|
+
if self.cmdstate == 8:
|
|
656
|
+
self.emit_not_implemented([Ann.SCV, self.cmd_ann_list()])
|
|
657
|
+
self.cmdstate += 1
|
|
658
|
+
|
|
659
|
+
def handle_scvr(self, pdata):
|
|
660
|
+
if self.cmdstate == 8:
|
|
661
|
+
self.emit_not_implemented([Ann.SCV, self.cmd_ann_list()])
|
|
662
|
+
self.cmdstate += 1
|
|
663
|
+
|
|
664
|
+
# ACK & NACK
|
|
665
|
+
|
|
666
|
+
def handle_ack(self, pdata):
|
|
667
|
+
self.putx([Ann.ACK, self.cmd_ann_list()])
|
|
668
|
+
self.state = None
|
|
669
|
+
|
|
670
|
+
def handle_nack(self, pdata):
|
|
671
|
+
self.putx([Ann.NACK, self.cmd_ann_list()])
|
|
672
|
+
self.state = None
|
|
673
|
+
|
|
674
|
+
def decode(self, ss, es, data):
|
|
675
|
+
ptype, rxtx, pdata = data
|
|
676
|
+
|
|
677
|
+
self.ss, self.es = ss, es
|
|
678
|
+
|
|
679
|
+
if ptype != 'DATA':
|
|
680
|
+
return
|
|
681
|
+
|
|
682
|
+
# Handle commands.
|
|
683
|
+
try:
|
|
684
|
+
abort_current = (0xD0 <= pdata[0] <= 0xF7) and \
|
|
685
|
+
(not (self.state in cmds_with_high_bytes)) and \
|
|
686
|
+
self.state != None
|
|
687
|
+
if abort_current:
|
|
688
|
+
self.putx([Ann.WARN, ['Command aborted by invalid byte', 'Abort']])
|
|
689
|
+
self.state = pdata[0]
|
|
690
|
+
self.emit_cmd_byte()
|
|
691
|
+
self.cmdstate = 1
|
|
692
|
+
if self.state is None:
|
|
693
|
+
self.state = pdata[0]
|
|
694
|
+
self.emit_cmd_byte()
|
|
695
|
+
self.cmdstate = 1
|
|
696
|
+
self.cmd_handlers[self.state](pdata[0])
|
|
697
|
+
except KeyError:
|
|
698
|
+
self.putx([Ann.WARN, ['Unknown command: 0x%02x' % pdata[0]]])
|
|
699
|
+
self.state = None
|