CH32V203F8U6的PA0喚醒問題
void?wakeup_init(void)
{
????GPIO_InitTypeDef?GPIO_InitStructure;
????EXTI_InitTypeDef?EXTI_InitStructure;
????NVIC_InitTypeDef?NVIC_InitStructure;
????//?使能GPIOA時鐘
????RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO?|RCC_APB2Periph_GPIOA,?ENABLE);
????
????//?配置PA0為輸入模式
????GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_0;
????GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPU;
????GPIO_Init(GPIOA,?&GPIO_InitStructure);
????
????//?配置EXTI?Line0
????GPIO_EXTILineConfig(GPIO_PortSourceGPIOA,?GPIO_PinSource0);
????EXTI_InitStructure.EXTI_Line?=?EXTI_Line0;
????EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Event;
????EXTI_InitStructure.EXTI_Trigger?=?EXTI_Trigger_Falling;
????EXTI_InitStructure.EXTI_LineCmd?=?ENABLE;
????EXTI_Init(&EXTI_InitStructure);
}
void?off_sta(void)
{
????GPIO_InitTypeDef?GPIO_InitStructure?=?{0};
????
????/*?To?reduce?power?consumption,?unused?GPIOs?need?to?be?set?as?pull-down?inputs?*/
????RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|
???????????????????????????RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD|RCC_APB2Periph_GPIOE,?ENABLE);
????GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_All;
????GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPD;
????
????GPIO_Init(GPIOA,?&GPIO_InitStructure);
????GPIO_Init(GPIOB,?&GPIO_InitStructure);
????GPIO_Init(GPIOC,?&GPIO_InitStructure);
????GPIO_Init(GPIOD,?&GPIO_InitStructure);
????GPIO_Init(GPIOE,?&GPIO_InitStructure);
????
????wakeup_init();
????
????SystemCoreClockUpdate();
????
????RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,?ENABLE);
????PWR_WakeUpPinCmd(ENABLE);
????PWR_EnterSTANDBYMode_RAM();
}

用PA0配置喚醒standby模式的時候,剛進(jìn)入就被自動喚醒了,是什么原因啊

您好,PA0引腳本身就是WKUP引腳,不需要配置,按照下圖注釋掉試一下

image.png


只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频