Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| stm32:peripherals:pwr_stop [2016/10/13 12:45] – feur | stm32:peripherals:pwr_stop [2022/12/27 19:00] (current) – [STOP Mode] ruan | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| === Enter STOP mode === | === Enter STOP mode === | ||
| - | * WFI (wait for interrupt) | + | * WFI (wait for interrupt) |
| \\ | \\ | ||
| Line 16: | Line 16: | ||
| ===== Programming Example ===== | ===== Programming Example ===== | ||
| - | The code snippet bellow shows how to enter (and exit) SLEEP mode. | + | The code snippet bellow shows how to enter (and exit) STOP mode. |
| <code c> | <code c> | ||
| #include " | #include " | ||
| - | RCC->AHBENR[0] | + | RCC->AHB1ENR |
| - | RCC->APBENR[1] | + | RCC->APB2ENR |
| /* Configure wake up pin (PA.0). */ | /* Configure wake up pin (PA.0). */ | ||
| Line 31: | Line 31: | ||
| /* Configure interrupt. */ | /* Configure interrupt. */ | ||
| - | SYSCFG->EXTICR[0] | + | SYSCFG->EXTICR1 |
| EXTI-> | EXTI-> | ||
| EXTI-> | EXTI-> | ||
| - | NVIC->ISER[0] | + | NVIC->ISER0 |= (0x1 << 6u); /* Enable EXTI0 interrupt. */ |