-
KF32A156参考例程将PE0配置PWM捕获,引脚有方波但不进中断
#define PE0_CCP19_CH4_PIN GPIOE_SFR, GPIO_PIN_MASK_0 #define PE0_CCP19_CH4_AF9 GPIOE_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_t ccpIntConfig; 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)) { /* Clear interrupt flag */ CCP_Clear_Channel_INT_Flag(CCP19_SFR, CCP_CHANNEL_4); } }
5010浏览量 1回复量 关注量