-
KF32A156参考例程将PE0配置PWM捕获,引脚有方波但不进中断
#definePE0_CCP19_CH4_PINGPIOE_SFR,GPIO_PIN_MASK_0#definePE0_CCP19_CH4_AF9GPIOE_SFR,GPIO_Pin_Num_0,GPIO_RMP_AF9{GPIO_Write_Mode_Bits(PE0_CCP19_CH4_PIN,GPIO_MODE_RMP);GPIO_Pin_RMP_Config(PE0_CCP19_CH4_AF9);Ccp_IntConfig_tccpIntConfig;ccpIntConfig.ccpInterrupt=CCP_INT_CAPTURE_CH4;ccpIntConfig.intIndex=INT_T19;ccpIntConfig.newState=TRUE;ccpIntConfig.preemption=4;ccpIntConfig.subPriority=0;CCP_Capture_Mode_Init(CCP19_SFR,CCP_CHANNEL_4,CCP_CAP_RISING_EDGE);CCP_INT_Config(CCP19_SFR,&ccpIntConfig);INT_All_Enable(TRUE);}void__attribute__((interrupt))_T19_exception(void){if(0U!=CCP_Get_Channel_Trigger_INT_Flag(CCP19_SFR,CCP_CHANNEL_4)){/*Clearinterruptflag*/CCP_Clear_Channel_INT_Flag(CCP19_SFR,CCP_CHANNEL_4);}}
2024-04-26 1