@@ -46,9 +46,19 @@ bool Inkplate::begin()
4646 return false ;
4747 }
4848
49+ // Set SPI Pins for microSD card to input pull down to reduce power consumption.
50+ pinMode (12 , INPUT_PULLDOWN );
51+ pinMode (13 , INPUT_PULLDOWN );
52+ pinMode (14 , INPUT_PULLDOWN );
53+ pinMode (15 , INPUT_PULLDOWN );
54+
4955 // Init TwoWire and GPIO expander
5056 setIOExpanderForLowPower ();
5157
58+ // Disable the microSD card pin for now.
59+ pinModeInternal (IO_INT_ADDR , ioRegsInt, SD_PMOS_PIN , OUTPUT );
60+ digitalWriteInternal (IO_INT_ADDR , ioRegsInt, SD_PMOS_PIN , HIGH );
61+
5262 // Set the default text color
5363 setTextColor (INKPLATE7_BLACK );
5464
@@ -58,7 +68,6 @@ bool Inkplate::begin()
5868 _beginDone = 1 ;
5969 }
6070
61-
6271 // Wake the ePaper and initialize everything
6372 // If it fails, return false
6473 if (!setPanelDeepSleep (false ))
@@ -345,15 +354,11 @@ void Inkplate::setIOExpanderForLowPower()
345354 memset (ioRegsInt, 0 , 22 );
346355 ioBegin (IO_INT_ADDR , ioRegsInt);
347356
348- // TOUCHPAD PINS
349- pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B2 , INPUT );
350- pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B3 , INPUT );
351- pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B4 , INPUT );
352-
353357 // Battery voltage Switch MOSFET
354358 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B1 , OUTPUT );
359+ digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B1 , LOW );
355360
356- // Rest of pins go to OUTPUT LOW state because in deepSleep mode they are
361+ // Rest of pins go to low because in deepSleep mode they are
357362 // using least amount of power
358363 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_A0 , OUTPUT );
359364 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_A1 , OUTPUT );
@@ -364,6 +369,8 @@ void Inkplate::setIOExpanderForLowPower()
364369 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_A6 , OUTPUT );
365370 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_A7 , OUTPUT );
366371 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B0 , OUTPUT );
372+ pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B3 , OUTPUT );
373+ pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B4 , OUTPUT );
367374 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B5 , OUTPUT );
368375 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B6 , OUTPUT );
369376 pinModeInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B7 , OUTPUT );
@@ -377,6 +384,8 @@ void Inkplate::setIOExpanderForLowPower()
377384 digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_A6 , LOW );
378385 digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_A7 , LOW );
379386 digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B0 , LOW );
387+ digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B3 , LOW );
388+ digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B4 , LOW );
380389 digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B5 , LOW );
381390 digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B6 , LOW );
382391 digitalWriteInternal (IO_INT_ADDR , ioRegsInt, IO_PIN_B7 , LOW );
0 commit comments