PVD模板
void PVD_Init(void) { EXTI_InitTypeDef EXTI_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; //----------PVD Init---------- RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); PWR_PVDLevelConfig(PWR_PVDLevel_2V9); //----------EXTI Init---------- EXTI_StructInit(&EXTI_InitStructure); EXTI_InitStructure.EXTI_Line = EXTI_Line16; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); //----------NVIC Init---------- NVIC_InitStructure.NVIC_IRQChannel = PVD_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); //----------ENABLE---------- PWR_PVDCmd(ENABLE); } void PVD_IRQHandler(void) { EXTI_ClearITPendingBit(EXTI_Line16); }