mirror of
https://github.com/esphome/esphome.git
synced 2025-10-02 01:52:21 +01:00
mcp23017: read output latch registers during setup (#3744)
This commit is contained in:
@@ -23,6 +23,10 @@ void MCP23S17::setup() {
|
||||
this->transfer_byte(0b00011000); // Enable HAEN pins for addressing
|
||||
this->disable();
|
||||
|
||||
// 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);
|
||||
|
Reference in New Issue
Block a user