20 void hard_fault_handler(
void){
23 rcc_periph_clock_enable(RCC_BKP);
24 rcc_periph_clock_enable(RCC_PWR);
36 pwr_disable_backup_domain_write_protect();
38 pwr_enable_backup_domain_write_protect();
55 SCB_SCR |= SCB_SCR_SLEEPONEXIT;
62 SCB_SCR &= ~SCB_SCR_SLEEPONEXIT;
67 rcc_periph_clock_enable(RCC_PWR);
68 PWR_CR |= PWR_CR_CWUF;
69 SCB_SCR |= SCB_SCR_SLEEPDEEP;
70 PWR_CR |= PWR_CR_PDDS;
71 PWR_CSR &= ~PWR_CSR_WUF;
77 rcc_periph_clock_enable(RCC_PWR);
78 SCB_SCR |= SCB_SCR_SLEEPDEEP;
79 PWR_CR &= ~PWR_CR_PDDS;
80 PWR_CR |= PWR_CR_LPDS;
86 rcc_periph_clock_enable(RCC_PWR);
88 if((PWR_CSR & PWR_CSR_WUF) || (PWR_CSR & PWR_CSR_SBF)){
91 PWR_CR |= PWR_CR_CWUF;
92 PWR_CR |= PWR_CR_CSBF;
101 rcc_periph_clock_enable(RCC_PWR);
103 if(PWR_CSR & PWR_CSR_WUF){
106 PWR_CR |= PWR_CR_CWUF;
107 PWR_CR |= PWR_CR_CSBF;
void POWER_noSleep(void)
Disable sleep mode.
uint8_t POWER_fromStandby(void)
Check if the system is restarting from standby mode.
void POWER_standby(void)
Put the device into standby mode.
void USB_disconnect(void)
Dissconnect the USB device from the HOST.
void POWER_reset(void)
Resets the system.
uint8_t POWER_fromStop(void)
Check if MCU was in stop mode and reset flags.
void POWER_stop(void)
Put the device into stop mode.
void POWER_sleep(void)
Put the system in sleep mode.
Header file for stm32f103cb Power.