mcp23017: read output latch registers during setup (#3744)

This commit is contained in:
andyboeh
2022-08-31 00:07:40 +02:00
committed by GitHub
parent 84bac8356a
commit b2199d5464
5 changed files with 18 additions and 0 deletions
+4
View File
@@ -14,6 +14,10 @@ void MCP23017::setup() {
return;
}
// Read current output register state
this->read_reg(mcp23x17_base::MCP23X17_OLATA, &this->olat_a_);
this->read_reg(mcp23x17_base::MCP23X17_OLATB, &this->olat_b_);
if (this->open_drain_ints_) {
// enable open-drain interrupt pins, 3.3V-safe
this->write_reg(mcp23x17_base::MCP23X17_IOCONA, 0x04);