{"_id":"@calumk/easyport-node-d2xx","_rev":"3-eb9f22ca2b71972c3676813122289d5f","name":"@calumk/easyport-node-d2xx","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@calumk/easyport-node-d2xx","version":"0.0.1","description":"Cross Platform Library for using EasyPort in Node.js","main":"src/index.js","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Calum Knott"},"license":"CC-BY-4.0","dependencies":{"ftdi-d2xx":"^1.3.1"},"_id":"@calumk/easyport-node-d2xx@0.0.1","gitHead":"49fac5bb4bc1a6956a7dc854ab3bdf7223abfce9","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-A+s30B6oxjPKx49TfNltG2bCLidzj3wLax5e/sCAP/MFuPhcfX9R9piEdVbrx9b6p4Lk4nExQbrnozsF4FOI7g==","shasum":"28b4771bf22c6b1db62fe152c2fa8456087bee17","tarball":"https://registry.npmjs.org/@calumk/easyport-node-d2xx/-/easyport-node-d2xx-0.0.1.tgz","fileCount":7,"unpackedSize":422824,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsqqkdNcnxP0kubw1gW0s9Vi3iiUrh2nohlgWQSYYbUAiBn2q+/iqGs0dXZJ6Zy7T4qdSCozpyB+qVvQdzXB5nUJg=="}]},"_npmUser":{"name":"calumk","email":"calum@calumk.com"},"directories":{},"maintainers":[{"name":"calumk","email":"calum@calumk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easyport-node-d2xx_0.0.1_1711467394715_0.396295620942124"},"_hasShrinkwrap":false},"0.0.2":{"name":"@calumk/easyport-node-d2xx","version":"0.0.2","description":"Cross Platform Library for using EasyPort in Node.js","main":"src/index.js","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Calum Knott"},"license":"CC-BY-4.0","dependencies":{"ftdi-d2xx":"^1.3.1"},"_id":"@calumk/easyport-node-d2xx@0.0.2","gitHead":"ee1926fc8989295440a4f49068dd96d806f99e5a","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-notdfoeZcLnvdl18DEhPo+FXtQmt4TL7ugpWLrjSn9ajibPn0BiORPQYXE/iRc/m+vxlXxtz70qQL+RPh4V3wQ==","shasum":"d2b7793dfa302f3e8e45136a6d5c473c62d10296","tarball":"https://registry.npmjs.org/@calumk/easyport-node-d2xx/-/easyport-node-d2xx-0.0.2.tgz","fileCount":7,"unpackedSize":422823,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGx75EaUfzywaXufnBmq6498tIASuq1n3TArVJ/MBJFZAiBPPT8bzL5UUrGH435dJL52i3WYwR977RVE/olNQs0G0A=="}]},"_npmUser":{"name":"calumk","email":"calum@calumk.com"},"directories":{},"maintainers":[{"name":"calumk","email":"calum@calumk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easyport-node-d2xx_0.0.2_1711467682228_0.8579317839551555"},"_hasShrinkwrap":false},"0.0.3":{"name":"@calumk/easyport-node-d2xx","version":"0.0.3","description":"Cross Platform Library for using EasyPort in Node.js","main":"src/index.js","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Calum Knott"},"license":"CC-BY-4.0","dependencies":{"ftdi-d2xx":"^1.3.1"},"repository":{"type":"git","url":"git+https://github.com/calumk/easyport-node-d2xx.git"},"_id":"@calumk/easyport-node-d2xx@0.0.3","gitHead":"d8dbaf00232818633bdc405fd9c2447070225a8f","bugs":{"url":"https://github.com/calumk/easyport-node-d2xx/issues"},"homepage":"https://github.com/calumk/easyport-node-d2xx#readme","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-ZG5IQmeIQSAEhNPzu8ed7AMFhjMEtAbtNs5qXVJ8Bqgx5Wcw1TYOv865OzEChj/wa9XysgZDaaYCd+ErHTn4GQ==","shasum":"f1091faadf03b0ab30f54903b856b1a82fd36f18","tarball":"https://registry.npmjs.org/@calumk/easyport-node-d2xx/-/easyport-node-d2xx-0.0.3.tgz","fileCount":7,"unpackedSize":422927,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuskRsC//UPfsdjHiOGYA375wRkM7XcB+YdjjE+0WiOAiEA5Al4I6vWUYkhAR+edXkrcp484Usr6jjnQ4QIsJ45OcE="}]},"_npmUser":{"name":"calumk","email":"calum@calumk.com"},"directories":{},"maintainers":[{"name":"calumk","email":"calum@calumk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easyport-node-d2xx_0.0.3_1711467760063_0.5432886701386213"},"_hasShrinkwrap":false},"0.0.4":{"name":"@calumk/easyport-node-d2xx","version":"0.0.4","description":"Cross Platform Library for using EasyPort in Node.js","main":"src/index.js","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Calum Knott"},"license":"CC-BY-4.0","dependencies":{"ftdi-d2xx":"^1.3.1"},"repository":{"type":"git","url":"git+https://github.com/calumk/easyport-node-d2xx.git"},"_id":"@calumk/easyport-node-d2xx@0.0.4","gitHead":"167c34d30512b0fa810eb7aeebf1f4cf89cde8db","bugs":{"url":"https://github.com/calumk/easyport-node-d2xx/issues"},"homepage":"https://github.com/calumk/easyport-node-d2xx#readme","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-+izKUQpmr2hU5GBoFI7gfCC2ZpxdhrWEOv5ZFUh2cnOpQTLxjeq3R6Ic7491X+gl/NaqfafjIN4z46/uoRU2yA==","shasum":"0aacd0054eb4766f88a316b383994b82f08f5ed9","tarball":"https://registry.npmjs.org/@calumk/easyport-node-d2xx/-/easyport-node-d2xx-0.0.4.tgz","fileCount":7,"unpackedSize":423178,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDChZtbVFyLT9zxqR2J0FMAk0wuQdiDw6pBsJugQ8uGKwIhAIolc0skfkuzNCnz6thnwyC6jHHq5DCfD7sFLw/Nw5tU"}]},"_npmUser":{"name":"calumk","email":"calum@calumk.com"},"directories":{},"maintainers":[{"name":"calumk","email":"calum@calumk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easyport-node-d2xx_0.0.4_1711539114728_0.39774262758973666"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-26T15:36:34.592Z","0.0.1":"2024-03-26T15:36:34.844Z","modified":"2024-03-27T11:31:55.354Z","0.0.2":"2024-03-26T15:41:22.481Z","0.0.3":"2024-03-26T15:42:40.217Z","0.0.4":"2024-03-27T11:31:54.933Z"},"maintainers":[{"name":"calumk","email":"calum@calumk.com"}],"description":"Cross Platform Library for using EasyPort in Node.js","author":{"name":"Calum Knott"},"license":"CC-BY-4.0","readme":"# easyport-node-d2xx\nCross Platform Library for using EasyPort in Node.js\n\nhttps://ip.festo-didactic.com/InfoPortal/MPS/EasyPort/EN/index.html\n\n## Description\n\nEasyPort is a GPIO device designed and manufactured by Festo Didactic, for connection to Festo Products using Syslink or Sub-D Connectors.\n\nThis library is designed to be cross-platform (osx/windows/linux) way to read & write data from the Easyport.\n\nIt will also form the basis for another project -> @calumk/easyport-webusb\n\n> [!NOTE]\n> This specific library uses [FTDI-D2XX](https://github.com/motla/ftdi-d2xx) library.\n> \n> This Library does **NOT** require the ActiveX Driver from Festo Didactic - This is a \"standalone\" re-implemmentation\n\n\n> [!IMPORTANT]\n> This library is designed for educational purposes, and should not be used for saftey-critical systems. \n\n\n> [!TIP]\n> At the moment, Only Digital is supported.\n> Analog will be supported soon.\n\n\n\n---\n\n\n## Simple Use\n\nThis outlines simple use of the library\n\n### Setup\n```js\nimport { EasyPort } from \"@calumk/easyport-node-d2xx\";\n\nlet easyport = new EasyPort({\n    timeouts : {\n        tx : 100,\n        rx : 100\n    }\n});\n\n// List all Devices\nlet devices = easyport.getDevices()\nconsole.log(devices)\n\nawait easyport.openDevice(0);\n\n```\n\n### Reading Bits / Bytes / Words\n```js\n// Read A single Bit (defaults to 0)\nlet example1 = await easyport.read_input_bit()\nconsole.log(example1);\n\n// Read A single Bit (Bit 4)\nlet example2 = await easyport.read_input_bit({\n  bit : 4\n})\nconsole.log(example2);\n\n\n// Read A single Byte (defaults to 0) = (Port 0)\nlet example3 = await easyport.read_input_byte()\nconsole.log(example3);\n\n// Read A single Byte (Byte 1) =  (Port 1)\nlet example4 = await easyport.read_input_byte({\n  byte : 1\n})\nconsole.log(example4);\n\n// Read the input word (There are multiple, but only 1 worth reading because this is Port 1 + Port 2)\nlet respons3 = await easyport.read_input_word()\nconsole.log(respons3);\n```\n\n\n###  Writing Bits / Bytes / Words \n```js\n// Turn on the first bit\nawait easyport.write_output_bit({\n  bit : 0\n  value : 1\n})\n\n// Turn on Bits 1 + 2 + 3 = 7 (Binary)\nawait easyport.write_output_byte({\n  byte : 0,\n  value : 7\n})\n\n// Turn on all bits (Binary)\nawait easyport.write_output_byte({\n  value : 65535\n})\n```\n\n\n## Advanced Use [BETA]\n\nIt is possible to enable monitoring mode, this is useful if you **MAINLY** want to read data, very quickly. < (25ms)\n\nIn monitoring mode, if you want to \"WRITE\" data again, you currently need to stop the monitoring mode\nThis is to prevent data collision, as otherwise you can end up reading data from the monitor mode instead of the response to your own command.\n\nTo accomplish this, the library will automatically disable monitoring mode, and then re-enable it once the write is complete, but this means that it takes time (50ms) to switch modes. \nSo if you want to read + write data fast - its probably easier to just do it cyclicly with a setInterval for now.\n\nThis is not very performant, and it is possible that it is unnessesary - more work to consider.\n\n\n```js\n\n// Enable the Monitoring Mode\neasyport.enableMonitoringMode()\n\n// disable Monitoring Mode\neasyport.disableMonitoringMode()\n\n// this will tell you when the monitoring mode has changed\n// This is useful, because if you try to write data while monitoring mode is on, it will be automatically disabled, and then re-endabled.\neasyport.registerNewMonitoringModeEnabledListener((data) => {\n    console.log(\"Monitoring Mode: \", data)\n});\n\n// This will log all monitored data (the value of the whole word 0)\neasyport.registerNewMonitoringModeListener((data) => {\n    console.log(data)\n});\n\n\n\n\n## Requirements\n* ftdi-d2xx\n\n* \n","readmeFilename":"README.md","homepage":"https://github.com/calumk/easyport-node-d2xx#readme","repository":{"type":"git","url":"git+https://github.com/calumk/easyport-node-d2xx.git"},"bugs":{"url":"https://github.com/calumk/easyport-node-d2xx/issues"}}