void EXTIX_Init(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD
, ENABLE);//ê1ÄüGPIOA-GPIOGμÄê±Öó
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 ;//
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;//
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100M
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;/
GPIO_Init(GPIOD, &GPIO_InitStructure);//
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);//
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOD, EXTI_PinSource9);//
EXTI_InitStructure.EXTI_Line = EXTI_Line9;//
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 = EXTI9_5_IRQn;//
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;//
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;//
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;//
NVIC_Init(&NVIC_InitStructure);//
}
void EXTI9_5_IRQnHandler(void)
{
u32 i=0;
for(i=0;i<6;i++)
{
Ads8556Conver= SPI2_ReadWriteByte(0xe200);
//delay_us(10);
}
EXTI_ClearITPendingBit(EXTI_Line9); //
}
如上设置,我用一个IO输出PWM百分之50的方波去触发PD9,为什么一直不进入中断???
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>