diff --git a/ion/src/device/display.cpp b/ion/src/device/display.cpp index defb93b0f..c3a4e3385 100644 --- a/ion/src/device/display.cpp +++ b/ion/src/device/display.cpp @@ -61,6 +61,10 @@ void initGPIO() { g.group().AFR()->setAlternateFunction(g.pin(), GPIO::AFR::AlternateFunction::AF12); } + // Turn on the power + PowerPin.group().MODER()->setMode(PowerPin.pin(), GPIO::MODER::Mode::Output); + PowerPin.group().ODR()->set(PowerPin.pin(), true); + // Turn on the reset pin ResetPin.group().MODER()->setMode(ResetPin.pin(), GPIO::MODER::Mode::Output); ResetPin.group().ODR()->set(ResetPin.pin(), true); @@ -79,6 +83,9 @@ void shutdownGPIO() { // Set to true : sleep consumption = 154 uA // Set to false : sleep consumption = 92 uA ResetPin.group().ODR()->set(ResetPin.pin(), false); + + PowerPin.group().MODER()->setMode(PowerPin.pin(), GPIO::MODER::Mode::Analog); + PowerPin.group().PUPDR()->setPull(PowerPin.pin(), GPIO::PUPDR::Pull::None); } void initFSMC() { diff --git a/ion/src/device/display.h b/ion/src/device/display.h index c6e97aa4f..63b31d2c2 100644 --- a/ion/src/device/display.h +++ b/ion/src/device/display.h @@ -18,6 +18,7 @@ namespace Device { * PA3 | LCD D5 | Alternate Function 12 | FSMC_D5 | * PA4 | LCD D6 | Alternate Function 12 | FSMC_D6 | * PB12 | LCD D13 | Alternate Function 12 | FSMC_D13 | + * PB14 | LCD power | Output | | LCD controller is powered directly from GPIO * PD0 | LCD D2 | Alternate Function 12 | FSMC_D2 | * PD1 | LCD D3 | Alternate Function 12 | FSMC_D3 | * PD4 | LCD read signal | Alternate Function 12 | FSMC_NOE | @@ -76,6 +77,7 @@ constexpr static GPIOPin FSMCPins[] = { GPIOPin(GPIOE, 15) }; +constexpr static GPIOPin PowerPin = GPIOPin(GPIOB, 14); constexpr static GPIOPin ResetPin = GPIOPin(GPIOE, 9); constexpr static int FSMCMemoryBank = 1;