MCP230xx open drain interrupt pins (#1243)

This commit is contained in:
Keith Burzinski
2021-02-13 03:07:11 -06:00
committed by Jesse Hills
parent 57b56010da
commit 65c7e27a43
8 changed files with 24 additions and 7 deletions
+4 -2
View File
@@ -14,8 +14,10 @@ void MCP23008::setup() {
return;
}
// all pins input
this->write_reg_(MCP23008_IODIR, 0xFF);
if (this->open_drain_ints_) {
// enable open-drain interrupt pins, 3.3V-safe
this->write_reg_(MCP23008_IOCON, 0x04);
}
}
bool MCP23008::digital_read(uint8_t pin) {
uint8_t bit = pin % 8;