|
FabGL
ESP32 Display Controller and Graphics Library
|
| void enableInterrupt | ( | int | gpio, |
| MCPIntTrigger | trigger, | ||
| bool | defaultValue = false, |
||
| uint8_t | hwAddr = 0 |
||
| ) |
Enables interrupt on the specific pin.
Interrupt flags are cleared reading GPIO or calling getPortIntCaptured().
| gpio | Input pin to setup as interrupt source (MCP_A0...MCP_A7 and MCP_B0...MCP_B7) |
| trigger | Type of interrupt trigger. MCPIntTrigger::DefaultChange, trigs interrupt if pin is different than defaultValue parameter. MCPIntTrigger::PreviousChange trigs interrupt if pin just changes its value. |
| defaultValue | Default value when trigger is MCPIntTrigger::DefaultChange. False = low, True = high |
| hwAddr | Optional hardware device address |
Example:
// INTA or INTB are high on interrupt io.setINTActiveHigh(true); // INTB is high whenever B1 changes its value io.enableInterrupt(MCP_B1, MCPIntTrigger::PreviousChange); // INTA is high whenever A2 is high io.enableInterrupt(MCP_A2, MCPIntTrigger::DefaultChange, false);
Definition at line 288 of file MCP23S17.cpp.