/**
******************************************************************************
* @file bsp_exti.c
* @author fire
* @version V1.0
* @date 2013-xx-xx
* @brief I/OÏßÖжÏÓ¦ÓÃbsp
******************************************************************************
* @attention
*
* ʵÑéƽ̨:±ü»ð F103-Ö¸ÄÏÕß STM32 ¿ª·¢°å
* ÂÛ̳ :http://www.firebbs.cn
* ÌÔ±¦ :http://firestm32.taobao.com
*
******************************************************************************
*/
#include "./pvd/bsp_pvd.h"
/**
* @brief ÅäÖÃ PVD
* @param ÎÞ
* @retval ÎÞ
*/
void PVD_Config(void)
{
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/*¿ªÆ&ocircWR*/
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE);
/* ÅäÖÃNVICΪÓÅÏȼ¶×é1 */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
/* ÅäÖÃÖжÏÔ´£º°´¼ü1 */
NVIC_InitStructure.NVIC_IRQChannel = PVD_IRQn;
/* ÅäÖÃÇÀÕ¼ÓÅÏȼ¶ */
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
/* ÅäÖÃ×ÓÓÅÏȼ¶ */
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
/* ʹÄÜÖжÏͨµÀ */
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/* Ñ¡ÔñEXTIµÄÐźÅÔ´ */
EXTI_InitStructure.EXTI_Line = EXTI_Line16;
/* EXTIΪÖжÏģʽ */
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
/* ÉÏÉýÑØÖÐ¶Ï */
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
/* ʹÄÜÖÐ¶Ï */
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
//3.3VÒý½Å µÄµçѹµÍÓÚ2.6V£¬»á²úÉúÖжϣ¬ÆäÖÐ3.3VÒý½ÅÓëSTM32µÄVDDÖ±½ÓÏàÁ¬
PWR_PVDLevelConfig(PWR_PVDLevel_2V6);
PWR_PVDCmd(ENABLE);
}
/*********************************************END OF FILE**********************/ |