{"id":17855608,"url":"https://github.com/nebrius/raspi-i2c","last_synced_at":"2025-09-20T22:33:02.141Z","repository":{"id":23903708,"uuid":"27283659","full_name":"nebrius/raspi-i2c","owner":"nebrius","description":"Provides access to I2C on the Raspberry Pi from Node.js ","archived":false,"fork":false,"pushed_at":"2019-10-29T16:01:59.000Z","size":158,"stargazers_count":30,"open_issues_count":4,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-25T07:41:58.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nebrius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-28T22:07:31.000Z","updated_at":"2023-06-18T22:44:40.000Z","dependencies_parsed_at":"2022-07-25T13:52:00.709Z","dependency_job_id":null,"html_url":"https://github.com/nebrius/raspi-i2c","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fraspi-i2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fraspi-i2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fraspi-i2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fraspi-i2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nebrius","download_url":"https://codeload.github.com/nebrius/raspi-i2c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233682445,"owners_count":18713552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T02:23:47.197Z","updated_at":"2025-09-20T22:32:56.857Z","avatar_url":"https://github.com/nebrius.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Raspi I2C\n=========\n\n**NOTE: This project is in maintenance mode and no longer actively maintained.**\n\nRaspi I2C is part of the [Raspi.js suite](https://github.com/nebrius/raspi) that provides access to the hardware I2C on pins 3 (SDA0) and 5 (SCL0).\n\nIf you have a bug report, feature request, or wish to contribute code, please be sure to check out the [Raspi IO Contributing Guide](https://github.com/nebrius/raspi-io/blob/master/CONTRIBUTING.md).\n\n## System Requirements\n\n- Raspberry Pi Model B Rev 1 or newer (sorry Model A users)\n- Raspbian Jessie or newer\n  - [Node-RED](http://nodered.org/) works, but can be finicky and difficult to debug.\n  - See https://github.com/nebrius/raspi-io/issues/24 for more info about support for other OSes\n- Node 6.0.0 or newer\n\nDetailed instructions for getting a Raspberry Pi ready for NodeBots, including how to install Node.js, can be found in the [wiki](https://github.com/nebrius/raspi-io/wiki/Getting-a-Raspberry-Pi-ready-for-NodeBots)\n\n## Installation\n\nFirst, be sure that you have installed [raspi](https://github.com/nebrius/raspi).\n\nInstall with npm:\n\n```Shell\nnpm install raspi-i2c\n```\n\n**Note:** this project is written in [TypeScript](http://www.typescriptlang.org/) and includes type definitions in the package.json file. This means that if you want to use it from TypeScript, you don't need to install a separate @types module.\n\n## Example Usage\n\nIn TypeScript/ES6:\n\n```TypeScript\nimport { init } from 'raspi';\nimport { I2C } from 'raspi-i2c';\n\ninit(() =\u003e {\n  const i2c = new I2C();\n  console.log(i2c.readByteSync(0x18)); // Read one byte from the device at address 18\n});\n```\n\nIn JavaScript:\n\n```JavaScript\nconst raspi = require('raspi');\nconst I2C = require('raspi-i2c').I2C;\n\nraspi.init(() =\u003e {\n  const i2c = new I2C();\n  console.log(i2c.readByteSync(0x18)); // Read one byte from the device at address 18\n});\n```\n\n## Notes and Limitations\n\nThere are a few limitations and extra steps to be aware of when using I2C on the Raspberry Pi.\n\nFirst and foremost, be aware that once you use an I2C pin for GPIO, you _cannot_ use it for I2C again until you _reboot_ your Raspberry Pi! If you run the following [Johnny-Five](http://johnny-five.io/) code which leverages this library under the hood, you will get an exception stating \"I2C pins not in I2C mode.\"\n\n```JavaScript\nconst Raspi = require('raspi-io');\nconst five = require('johnny-five');\nconst board = new five.Board({\n  io: new Raspi()\n});\n\nboard.on('ready', () =\u003e {\n  new five.Pin('SDA');\n  board.io.i2cWrite(0x18, 0x5, 'hello');\n});\n```\n\nAlso note that you will need to edit ```/boot/config.txt``` in order to change the I2C baud rate from the default, if you need to. If you notice that behavior is unstable while trying to communicate with another microcontroller, try setting the baudrate to 10000 from the default 100000. This instability has been observed on the Arduino Nano before.\n\nAfter you install Raspi IO for the first time, you _must_ reboot your Raspberry Pi. I2C support is not enabled by default, and this module runs a script to enable it automatically and adjust a few I2C settings. These settings will not take effect until you reboot your Pi.\n\nFinally, if you try to access a device that doesn't exist, you will get an error stating ```EIO, i/o error``` (sorry it's not very descriptive).\n\n## API\n\n### Module Constants\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eConstant\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emodule\u003c/td\u003e\n    \u003ctd\u003eAn easily consumable object for indirectly passing this module around. Intended specifically for use by Core IO (details coming soon)\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ctable\u003e\n      \u003cthead\u003e\n        \u003ctr\u003e\n          \u003cth\u003eProperty\u003c/th\u003e\n          \u003cth\u003eType\u003c/th\u003e\n          \u003cth\u003eDescription\u003c/th\u003e\n        \u003c/tr\u003e\n      \u003c/thead\u003e\n      \u003ctr\u003e\n        \u003ctd\u003ecreateI2C()\u003c/td\u003e\n        \u003ctr\u003eFunction\u003c/tr\u003e\n        \u003ctd\u003ePass through for the \u003ca href=\"#new-i2c\"\u003eI2C constructor\u003c/a\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/table\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### new I2C(pins)\n\nInstantiates a new I2C instance on the given pins. Note that I2C is limited to only 1 pair of pins on all current models of the Raspberry Pi. Check the [wiring information wiki](https://github.com/nebrius/raspi-io/wiki) for more information.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epins (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber[] | Object\u003c/td\u003e\n    \u003ctd\u003eThe configuration of the I2C port. If the config is an array of numbers or strings, it is assumed to be the SDA and SCL pins for the peripheral. If it is an object, the following properties are supported:\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eProperty\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003epins\u003c/td\u003e\n          \u003ctd\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Instance Methods\n\n#### read(address, register, length, cb)\n\nReads data from the peripheral at _address_ from the optional _register_ and calls the callback once _length_ bytes have been read.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003elength\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be between 0 and 0xff.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecb\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eThe callback to call once the read is complete\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eArgument\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003eerr\u003c/td\u003e\n          \u003ctd\u003eString | null\u003c/td\u003e\n          \u003ctd\u003eThe error, if one occurred, else null\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n          \u003ctd\u003edata\u003c/td\u003e\n          \u003ctd\u003enull | Buffer\u003c/td\u003e\n          \u003ctd\u003eIf no error occurred, the read data\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### readSync(address, register, length)\n\nSynchronous version of ```read```.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003elength\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be between 0 and 0xff.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: A buffer containing the read data\n\n#### readByte(address, register, cb)\n\nReads a single byte from the peripheral at _address_ from the optional _register_ and calls the callback.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecb\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eThe callback to call once the read is complete\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eArgument\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003eerr\u003c/td\u003e\n          \u003ctd\u003eString | null\u003c/td\u003e\n          \u003ctd\u003eThe error, if one occurred, else null\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n          \u003ctd\u003edata\u003c/td\u003e\n          \u003ctd\u003enull | Number\u003c/td\u003e\n          \u003ctd\u003eIf no error occurred, the read byte\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### readByteSync(address, register)\n\nSynchronous version of ```readByte```.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: The byte in the form of a number.\n\n#### readWord(address, register, cb)\n\nReads a single word from the peripheral at _address_ from the optional _register_ and calls the callback.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecb\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eThe callback to call once the read is complete\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eArgument\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003eerr\u003c/td\u003e\n          \u003ctd\u003eString | null\u003c/td\u003e\n          \u003ctd\u003eThe error, if one occurred, else null\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n          \u003ctd\u003edata\u003c/td\u003e\n          \u003ctd\u003enull | Number\u003c/td\u003e\n          \u003ctd\u003eIf no error occurred, the read byte\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### readWordSync(address, register)\n\nSynchronous version of ```readWord```.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: The word in the form of a number.\n\n#### write(address, register, buffer, cb)\n\nWrites the data in _buffer_ to the peripheral at _address_ to the optional _register_ and calls the callback once the write has completed.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebuffer\u003c/td\u003e\n    \u003ctd\u003eBuffer\u003c/td\u003e\n    \u003ctd\u003eThe data to write to the peripheral.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecb\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eThe callback to call once the write is complete\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eArgument\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003eerr\u003c/td\u003e\n          \u003ctd\u003eString | null\u003c/td\u003e\n          \u003ctd\u003eThe error, if one occurred, else null\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### writeSync(address, register, buffer)\n\nSynchronous version of ```write```.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to read from. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebuffer\u003c/td\u003e\n    \u003ctd\u003eBuffer\u003c/td\u003e\n    \u003ctd\u003eThe data to write to the peripheral.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### writeByte(address, register, byte, cb)\n\nWrites _byte_ to peripheral at _address_ to the optional _register_ and calls the callback.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to write to. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebyte\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe byte to write. The value is coerced to an unsigned 8-bit integer.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecb\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eThe callback to call once the write is complete\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eArgument\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003eerr\u003c/td\u003e\n          \u003ctd\u003eString | null\u003c/td\u003e\n          \u003ctd\u003eThe error, if one occurred, else null\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### writeByteSync(address, register, byte)\n\nSynchronous version of ```writeByte```.\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to write to. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebyte\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe byte to write. The value is coerced to an unsigned 8-bit integer.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### writeWord(address, register, word, cb)\n\nWrites _word_ to peripheral at _address_ to the optional _register_ and calls the callback.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to write to. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eword\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe word to write. The value is coerced to an unsigned 16-bit integer.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecb\u003c/td\u003e\n    \u003ctd\u003eFunction\u003c/td\u003e\n    \u003ctd\u003eThe callback to call once the write is complete\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd colspan=\"2\"\u003e\n      \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eArgument\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/thead\u003e\n        \u003ctr\u003e\n          \u003ctd\u003eerr\u003c/td\u003e\n          \u003ctd\u003eString | null\u003c/td\u003e\n          \u003ctd\u003eThe error, if one occurred, else null\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c/table\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\n#### writeWordSync(address, register, word)\n\nSynchronous version of ```writeWord```.\n\n_Arguments_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaddress\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe address of the peripheral to read from. Must be 0 or greater and less than 0x80.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eregister (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe register to write to. Must be between 0 and 0x7f.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eword\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe word to write. The value is coerced to an unsigned 16-bit integer.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Returns_: None\n\nLicense\n=======\n\nThe MIT License (MIT)\n\nCopyright (c) Bryan Hughes \u003cbryan@nebri.us\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebrius%2Fraspi-i2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebrius%2Fraspi-i2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebrius%2Fraspi-i2c/lists"}