mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[ion] In device, create a method to init clocks in standby
Change-Id: If536a7b943095c87b51a85dc1fb5c1ea9229088b
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -11,6 +11,7 @@ void initFPU();
|
||||
void initPeripherals();
|
||||
void shutdownPeripherals(bool persistingLED);
|
||||
void initClocks();
|
||||
void initStandbyClock();
|
||||
void shutdownClocks();
|
||||
|
||||
/* Pin | Role | Mode | Function
|
||||
|
||||
Reference in New Issue
Block a user