[ion] In device, create a method to init clocks in standby

Change-Id: If536a7b943095c87b51a85dc1fb5c1ea9229088b
This commit is contained in:
Émilie Feral
2017-04-11 16:28:40 +02:00
parent 6c7a70e046
commit 9467e6a23f
2 changed files with 21 additions and 1 deletions

View File

@@ -216,8 +216,27 @@ void initClocks() {
RCC.AHB3ENR()->setFSMCEN(true);
}
void shutdownClocks() {
void initStandbyClock () {
// AHB1 bus
class RCC::AHB1ENR ahb1enr(0); // Reset value
ahb1enr.setGPIOAEN(true);
ahb1enr.setGPIOBEN(true);
ahb1enr.setGPIOCEN(true);
ahb1enr.setGPIOEEN(true);
RCC.AHB1ENR()->set(ahb1enr);
// APB1 bus
// We're using TIM3
RCC.APB1ENR()->setTIM3EN(true);
RCC.APB1ENR()->setPWREN(true);
// APB2 bus
class RCC::APB2ENR apb2enr(0x00008000); // Reset value
apb2enr.setSYSCFGEN(true);
RCC.APB2ENR()->set(apb2enr);
}
void shutdownClocks() {
// Reset values, everything off
RCC.APB2ENR()->set(0x00008000);
RCC.APB1ENR()->set(0x00000400);

View File

@@ -11,6 +11,7 @@ void initFPU();
void initPeripherals();
void shutdownPeripherals(bool persistingLED);
void initClocks();
void initStandbyClock();
void shutdownClocks();
/* Pin | Role | Mode | Function