Skip to content

Commit 2f9dc52

Browse files
committed
Fixed deep sleep current on Inkplate5.
Enabled pull down resistors on Internal I/O expander on unused GPIO pins.
1 parent c751d2e commit 2f9dc52

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/boards/Inkplate5.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,14 @@ bool Inkplate::begin(void)
7171
delay(1);
7272
WAKEUP_CLEAR;
7373

74-
// Set all pins of seconds I/O expander to outputs, low.
75-
// For some reason, it draw more current in deep sleep when pins are set as
76-
// inputs...
77-
78-
for (int i = 0; i < 15; i++)
79-
{
80-
pinModeInternal(IO_EXT_ADDR, ioRegsEx, i, OUTPUT);
81-
digitalWriteInternal(IO_EXT_ADDR, ioRegsEx, i, LOW);
82-
}
83-
84-
// For same reason, unused pins of first I/O expander have to be also set as
85-
// outputs, low.
86-
pinModeInternal(IO_INT_ADDR, ioRegsInt, 14, OUTPUT);
87-
pinModeInternal(IO_INT_ADDR, ioRegsInt, 15, OUTPUT);
88-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, 14, LOW);
89-
digitalWriteInternal(IO_INT_ADDR, ioRegsInt, 15, LOW);
74+
// To reduce power consumption in deep sleep, unused pins of
75+
// first I/O expander have to be also set as inputs with pull down
76+
// resistors.
77+
pinModeInternal(IO_INT_ADDR, ioRegsInt, 11, INPUT_PULLDOWN);
78+
pinModeInternal(IO_INT_ADDR, ioRegsInt, 12, INPUT_PULLDOWN);
79+
pinModeInternal(IO_INT_ADDR, ioRegsInt, 13, INPUT_PULLDOWN);
80+
pinModeInternal(IO_INT_ADDR, ioRegsInt, 14, INPUT_PULLDOWN);
81+
pinModeInternal(IO_INT_ADDR, ioRegsInt, 15, INPUT_PULLDOWN);
9082

9183
// Set SPI pins to input to reduce power consumption in deep sleep
9284
pinMode(12, INPUT);

0 commit comments

Comments
 (0)