Coder Social home page Coder Social logo

mcp23017-rpi-lib's Introduction

MCP23017-RPI-Lib

Original source code: https://bitbucket.org/dewoodruff/mcp23017-python-3-library-with-interrupts.


New in this repo

Resolve bug where multiple pins on the same bank cause an interrupt. The original code assumed that only one pin is high of the INTCAP register. More details of the chip can be found here: http://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf.


This library implements a python 3 library for the MCP23017 port expander chip. It is intended to be used on a Raspberry Pi in conjunction with the built in GPIO pins.

Requirements:

  • python 3 port of Adafruit's I2C library, which is included in this repo
  • python 3 smbus module. See wiki for instructions to install on a Raspberry Pi.

Features:

  • Simple digital input and output via all pins
  • Input interrupts
  • Interrupt port mirroring is configurable โ€“ either INTA and INTB can trigger independently for their respective GPIO port banks, or both INTA and INTB can trigger at the same time regardless of what GPIO pin causes the interrupt
  • Configurable interrupt polarity โ€“ INT could pull the pin high or push it low
  • Each GPIO pin can be configured for interrupts independently to either compare against the previous value or against a default pin value
  • A utility method cleanupInterrupts that can be called periodically to clear the interrupt if it somehow gets stuck on.

mcp23017-rpi-lib's People

Contributors

gillesc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sadspirit jturpin

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.