Skip to content

Add disableInterruptPin() #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Adafruit_MCP23017.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,17 @@ void Adafruit_MCP23017::setupInterruptPin(uint8_t pin, uint8_t mode) {
updateRegisterBit(pin, HIGH, MCP23017_GPINTENA, MCP23017_GPINTENB);
}

/**
* Disable a pin for interrupt.
*
* @param pin Pin to set
*
*/
void Adafruit_MCP23017::disableInterruptPin(uint8_t pin) {
// disable the pin for interrupt
updateRegisterBit(pin, LOW, MCP23017_GPINTENA, MCP23017_GPINTENB);
}

/*!
* @brief Gets the last interrupt pin
* @return Returns the last interrupt pin
Expand Down
3 changes: 2 additions & 1 deletion Adafruit_MCP23017.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class Adafruit_MCP23017 {
uint8_t readGPIO(uint8_t b);

void setupInterrupts(uint8_t mirroring, uint8_t open, uint8_t polarity);
void setupInterruptPin(uint8_t p, uint8_t mode);
void setupInterruptPin(uint8_t pin, uint8_t mode);
void disableInterruptPin(uint8_t pin);
uint8_t getLastInterruptPin();
uint8_t getLastInterruptPinValue();

Expand Down