mirror of
https://github.com/esphome/esphome.git
synced 2025-01-03 18:38:07 +01:00
Fix mcp23s17 addressing beyond 3 (#3797)
This commit is contained in:
parent
7a91ca9809
commit
f6e5a8cb2a
@ -23,6 +23,13 @@ void MCP23S17::setup() {
|
|||||||
this->transfer_byte(0b00011000); // Enable HAEN pins for addressing
|
this->transfer_byte(0b00011000); // Enable HAEN pins for addressing
|
||||||
this->disable();
|
this->disable();
|
||||||
|
|
||||||
|
this->enable();
|
||||||
|
cmd = 0b01001000;
|
||||||
|
this->transfer_byte(cmd);
|
||||||
|
this->transfer_byte(mcp23x17_base::MCP23X17_IOCONA);
|
||||||
|
this->transfer_byte(0b00011000); // Enable HAEN pins for addressing
|
||||||
|
this->disable();
|
||||||
|
|
||||||
// Read current output register state
|
// Read current output register state
|
||||||
this->read_reg(mcp23x17_base::MCP23X17_OLATA, &this->olat_a_);
|
this->read_reg(mcp23x17_base::MCP23X17_OLATA, &this->olat_a_);
|
||||||
this->read_reg(mcp23x17_base::MCP23X17_OLATB, &this->olat_b_);
|
this->read_reg(mcp23x17_base::MCP23X17_OLATB, &this->olat_b_);
|
||||||
|
Loading…
Reference in New Issue
Block a user