[ion/device] Enable powering the LCD controller from a GPIO

Change-Id: I9d5000cda527d04b3505afb3ecfc0ec07f2f1281
This commit is contained in:
Romain Goyet
2017-02-14 11:22:00 +01:00
parent 61e48981ef
commit 5a0ecfc1bc
2 changed files with 9 additions and 0 deletions

View File

@@ -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() {

View File

@@ -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;