外部中断设置:
*pFIO_INEN |= BIT( PF0_P ); //to U601 EPIC6,Flag Input Enable Register[0xFFC00740]
*pFIO_DIR &= ~BIT( PF0_P ); //设置PF0的方向是输入,0-input,1-output,Peripheral Flag Direction Register[0xFFC00730]
*pFIO_POLAR &= ~BIT( PF0_P ); //设置标志源的极性,0-高电平和上升沿有效,1-低电平和下降沿有效,Flag Source Polarity Register[0xFFC00734]
*pFIO_EDGE |= BIT( PF0_P ); //0-电平,1-沿,Flag Source Sensitivity Register[0xFFC00738]
*pFIO_MASKA_D |= BIT( PF0_P ); //使能PF0的中断,Flag Mask Interrupt A Register (set directly)[0xFFC00710]
register_handler( ik_ivg12, FlagA_ISR ); //FlagA_ISR[0xffa10e64]是可编程中断服务的入口地址
*pSIC_IMASK |= SIC_MASK( 0x13 );//中断使能PF Interrupt A,0-中断屏蔽,1-中断使能,Interrupt Mask Register[0xFFC0010C]
}
文章评论(0条评论)
登录后参与讨论