????GPIO_InitTypeDef?GPIO_InitStructure?=?{0}; ????EXTI_InitTypeDef?EXTI_InitStructure?=?{0}; ????NVIC_InitTypeDef?NVIC_InitStructure?=?{0}; ????RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO?|?RCC_APB2Periph_GPIOA?|?RCC_APB2Periph_GPIOC?|?RCC_APB2Periph_GPIOD,?ENABLE); ????/*?GPIOA?---->?EXTI_Line0?低水位??使用上升沿*/ ????GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_2; ????GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPU; ????GPIO_Init(GPIOA,?&GPIO_InitStructure); ????GPIO_EXTILineConfig(GPIO_PortSourceGPIOA,?GPIO_PinSource2); ????EXTI_InitStructure.EXTI_Line?=?EXTI_Line2; ????EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Interrupt; ????EXTI_InitStructure.EXTI_Trigger?=?EXTI_Trigger_Falling; ????EXTI_InitStructure.EXTI_LineCmd?=?ENABLE; ????EXTI_Init(&EXTI_InitStructure); ????/*?GPIOC?---->?EXTI_Line1?高水位?使用下降沿*/ ????GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_0; ????GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPU; ????GPIO_Init(GPIOC,?&GPIO_InitStructure); ????GPIO_EXTILineConfig(GPIO_PortSourceGPIOC,?GPIO_PinSource0); ????EXTI_InitStructure.EXTI_Line?=?EXTI_Line0; ????EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Interrupt; ????EXTI_InitStructure.EXTI_Trigger?=?EXTI_Trigger_Falling; ????EXTI_InitStructure.EXTI_LineCmd?=?ENABLE; ????EXTI_Init(&EXTI_InitStructure); ????/*?GPIOD?---->?EXTI_Line0?低水位??使用上升沿*/ ????GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_0; ????GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPD; ????GPIO_Init(GPIOD,?&GPIO_InitStructure); ????/*GPIO_EXTILineConfig(GPIO_PortSourceGPIOD,?GPIO_PinSource0); ????EXTI_InitStructure.EXTI_Line?=?EXTI_Line0; ????EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Interrupt; ????EXTI_InitStructure.EXTI_Trigger?=?EXTI_Trigger_Rising; ????EXTI_InitStructure.EXTI_LineCmd?=?ENABLE; ????EXTI_Init(&EXTI_InitStructure);*/ ????NVIC_InitStructure.NVIC_IRQChannel?=?EXTI7_0_IRQn; ????NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority?=?0; ????NVIC_InitStructure.NVIC_IRQChannelSubPriority?=?1; ????NVIC_InitStructure.NVIC_IRQChannelCmd?=?ENABLE; ????NVIC_Init(&NVIC_InitStructure);
我用三個(gè)GPIO腳做中斷,有幾個(gè)問(wèn)題想要了解清楚,
第一、上面三個(gè)GPIO,GPIOA2 和 GPIOD0是可以有中斷反應(yīng)的,但是GPIOC0一直沒(méi)有,這是哪里出錯(cuò)了?
第二、關(guān)于EXTI_Linex,x是如何去定義的?是不是根據(jù)GPIO_EXTILineConfig里面參數(shù) GPIO_PinSourceX里面X去定?
上面兩個(gè)問(wèn)題我在你們官網(wǎng)上面和網(wǎng)絡(luò)上面搜不到合適的結(jié)果,希望能指導(dǎo)指導(dǎo)