RobTillaart / MCP23S17

Arduino library for SPI based MCP23S17 16 channel port expander
MIT License
27 stars 11 forks source link

Using interrupts #40

Closed ryanaukes closed 6 months ago

ryanaukes commented 6 months ago

First of all, thank you for creating this library! It has been really useful to me.

I am wondering if you have any short term plans to implement the interrupt functions that the MCP23S17 supports? As far as I can tell the library currently does not support this.

Thanks in advance, Ryan

RobTillaart commented 6 months ago

Will look into it

RobTillaart commented 6 months ago

Should be

    if (mode == RISING)
    {
      intcon = mask;
      defval = ~mask;  //  RISING == compare to 0
    }
    else if (mode == FALLING)
    {
      intcon = mask;
      defval = mask;  //  FALLING == compare to 1
    }
RobTillaart commented 6 months ago

Adding some refactoring - register naming. Develop branched will be merged later today (if all builds stay OK).

RobTillaart commented 6 months ago

Thanks again for all your testing, if new problems pop up, please open a new issue.