ESP32 Display Controller and Graphics Library

◆ enableInterrupt()

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().

gpioInput pin to setup as interrupt source (MCP_A0...MCP_A7 and MCP_B0...MCP_B7)
triggerType of interrupt trigger. MCPIntTrigger::DefaultChange, trigs interrupt if pin is different than defaultValue parameter. MCPIntTrigger::PreviousChange trigs interrupt if pin just changes its value.
defaultValueDefault value when trigger is MCPIntTrigger::DefaultChange. False = low, True = high
hwAddrOptional hardware device address


// INTA or INTB are high on interrupt

// 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 270 of file MCP23S17.cpp.