/i2c-bus-mcp2221

A I2CBus implementation over mcp2221 I²C interface

Primary LanguageTypeScriptMIT LicenseMIT

I²C Bus MCP2221

An I²C interface I2CBus implementation over MCP2221

npm Version GitHub package.json version CI GitHub Downloads Per Month GitHub last commit

import { MCP2221 } from '@johntalton/mcp2221'
import { I2CBusMCP2221 } from '@johntalton/i2c-bus-mcp2221'

const hidDevice = /* navigator.hid.request ... */
const source = new WebHIDStreamSource(hidDevice) // or NodeHIDStreamSource
const device = MCP2221.from(source)
const bus = I2CBusMCP2221.from(device)

// bus.readI2CBlock(...) and friends