Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
stm32:peripherals:pwr_stop [2016/10/13 12:45] feurstm32: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) instuction enters SLEEP mode.+  * WFI (wait for interrupt) instruction with SLEEPDEEP bit set enters STOP mode.
 \\ \\
  
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 "reg_stm32f4xx.h" #include "reg_stm32f4xx.h"
  
-RCC->AHBENR[0] |= (0x1 <<  0u);       /* Enable GPIOA clock */ +RCC->AHB1ENR |= (0x1 <<  0u);       /* Enable GPIOA clock */ 
-RCC->APBENR[1] |= (0x1 << 14u);       /* Enable SYSCFG clock */+RCC->APB2ENR |= (0x1 << 14u);       /* Enable SYSCFG clock */
  
 /* Configure wake up pin (PA.0). */ /* Configure wake up pin (PA.0). */
Line 31: Line 31:
  
 /* Configure interrupt. */ /* Configure interrupt. */
-SYSCFG->EXTICR[0] |= (0u << 0u);      /* Set EXTI0 to GPIOA. */+SYSCFG->EXTICR1 |= (0u << 0u);      /* Set EXTI0 to GPIOA. */
 EXTI->RTSR |= (0x1 << 0u);            /* Trigger on rising edge. */ EXTI->RTSR |= (0x1 << 0u);            /* Trigger on rising edge. */
 EXTI->IMR |= (0x1 << 0u);             /* Unmask interrupt line. */ EXTI->IMR |= (0x1 << 0u);             /* Unmask interrupt line. */
-NVIC->ISER[0] |= (0x1 << 6u);         /* Enable EXTI0 interrupt. */+NVIC->ISER0 |= (0x1 << 6u);         /* Enable EXTI0 interrupt. */
  
  
  • stm32/peripherals/pwr_stop.1476362752.txt.gz
  • Last modified: 2016/10/13 12:45
  • by feur