fivdi / i2c-bus

I2C serial bus access with Node.js
MIT License
348 stars 57 forks source link

Interrupt based callback? #16

Closed crosofg closed 8 years ago

crosofg commented 8 years ago

I am trying to use this for MCP23017. How do I set a interrupt based callback. I need to get the onchange callback .

fivdi commented 8 years ago

If I'm not mistaken, the interrupt-on-change interrupts can be detected on the INTA/INTB pins of the MCP23017. Is this correct? If so, these pins could be wired to GPIO pins configured as inputs on the Raspberry Pi / BeagleBone, or whatever the system happend to be. The onoff package can then be used to detect these interrupts. onoff can be used for low latency interrupt detection (without polling.)

fivdi commented 8 years ago

Please let me know whether or not I've interpreted the requirement correctly here.

crosofg commented 8 years ago

Yes, you are correct. Interrupt are detected on INTA / B. I think onff package can work

fivdi commented 8 years ago

Ok, give it a try and let us know how it goes :)

fivdi commented 8 years ago

@crosofg was it possible to resolve the issue with onoff?

crosofg commented 8 years ago

@fivdi yes that worked. Thanks

fivdi commented 8 years ago

Excellent, thanks for the feedback.