Git Product home page Git Product logo

mcp2221-rs's Introduction

MCP2221-rs

This library allows your code to control an MCP2221 or MCP2221A over USB for the purposes of talking I2C or using the GPIO pins. It doesn't support the UART feature of the MCP2221 although PRs are welcome.

I2C traits from the embedded-hal are used, allowing relatively easy switching between this I2C interface and something like linux-embedded-hal for devices that are supported directly by the kernel.

This library has only been tested on Linux, but it uses rusb to access the USB bus and that supports other platforms, so there's a moderate chance it will work on more than just Linux.

Example

See examples/scan_bus.rs.

Granting access to the device

In order to allow access to the USB device, it's recommended to create a udev rule. e.g. create /etc/udev/rules.d/71-mcp.rules with the following content:

SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", GROUP="plugdev", TAG+="uaccess"

This rule allows access to the device by the user physically logged into the computer (uaccess) and to anyone in the plugdev group.

Contributing

See docs/contributing.md.

Disclaimer

This is not an officially supported Google product.

License

This project is licensed under either of

at your option.

mcp2221-rs's People

Contributors

aelray avatar davidlattimore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mcp2221-rs's Issues

support embedded_hal pin traits

Currently no way to access/control a pin other than reconfiguring gpio, afaik. Would be nice to provide the implementations for using them easily

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.