Skip to content

Silicon Labs CP2102 user-space USB driver for Node.js

License

Notifications You must be signed in to change notification settings

kmalinich/cp2102

 
 

Repository files navigation

CP2102

Silicon Labs CP2102 user-space USB to serial adapter driver for Node.js

Usage

const CP2102 = require('cp2102');

const opts = {
    baudRate : 115200
};

const connection = new CP2102(vendorId, productId, opts);

connection.on('data', (res) => {
  console.log('Data:', res);
  connection.close(() => {});
});

connection.on('ready', () => {
  connection.write([0x01, 0x02, 0x02], (err) => {
    if (err) {
      console.log('Error sending command:', err);
    }
  });
});

Thanks

Thanks to Seiya Nuta who posted a WebUSB version as a GitHub gist.

About

Silicon Labs CP2102 user-space USB driver for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%