mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 19:38:30 +02:00
MCP230xx open drain interrupt pins (#1243)
This commit is contained in:
committed by
Jesse Hills
parent
57b56010da
commit
65c7e27a43
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user