STM32F0库函数初始化系列:进入STOP模式,外部中断唤醒

SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0);
  
          EXTI_InitStructure.EXTI_Line=EXTI_Line0;
          EXTI_InitStructure.EXTI_LineCmd=ENABLE;
          EXTI_InitStructure.EXTI_Mode=EXTI_Mode_Interrupt;
          EXTI_InitStructure.EXTI_Trigger=EXTI_Trigger_Falling;
          EXTI_Init(&EXTI_InitStructure);
          
          
          NVIC_InitStructure.NVIC_IRQChannel = EXTI0_1_IRQn;
          NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
          NVIC_InitStructure.NVIC_IRQChannelPriority=0;
          NVIC_Init(&NVIC_InitStructure);
        

        PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);   //进入STOP模式

     //PWR_EnterSTANDBYMode(); 进入待机模式
//进入待机模式,不需要配置中断,不进入中断 void EXTI0_1_IRQHandler() { NVIC_SystemReset(); EXTI_ClearITPendingBit(EXTI_Line0); }

 

posted @ 2019-07-29 17:25  penuel  阅读(1634)  评论(0)    收藏  举报