Skip to content

Commit 710e767

Browse files
committed
Correct ICON Register init
ICON.ORD is set as 0 which denotes active driver rather than open-drain. Added extra unimplemented bit comment to avoid confusion around how the 7 used bits map to the byte.
1 parent 4c1c99b commit 710e767

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/MCP23017.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ void MCP23017::init()
1414
//SEQOP = 1 : sequential operation disabled, address pointer does not increment
1515
//DISSLW = 0 : slew rate enabled
1616
//HAEN = 0 : hardware address pin is always enabled on 23017
17-
//ODR = 0 : open drain output
17+
//ODR = 0 : active driver output (INTPOL bit sets the polarity.)
18+
1819
//INTPOL = 0 : interrupt active low
20+
//UNIMPLMENTED 0 : unimplemented: Read as ‘0’
21+
1922
writeRegister(MCP23017Register::IOCON, 0b00100000);
2023

2124
//enable all pull up resistors (will be effective for input pins only)

0 commit comments

Comments
 (0)