- void EINT_INIT(void)
- {
- P2_MFP = (P2_MFP & (~(P20|P21|P22))) | GP234_INT;
- // IPRSTC2 |= GPIO_RST;
- // IPRSTC2 &= ~GPIO_RST;
- P2_PMD = (P2_PMD & (~(Px0_PMD|Px1_PMD|Px2_PMD))) |Px0_IN|Px1_IN|Px2_IN;
- //P2_PMD = (P2_PMD & (~(Px0_PMD|Px1_PMD|Px2_PMD))) |Px0_OUT|Px1_OUT|Px2_OUT;
-
- DBNCECON &= ~ICLK_ON;
- DBNCECON &= DBCLK_HCLK;
- DBNCECON |= SMP_1024CK;
- P2_DBEN |= DBEN0|DBEN1|DBEN2;
- P2_IMD &= (IMD0_EDG|IMD1_EDG|IMD2_EDG);
- // P2_IMD = 0;
- P2_IEN |= IR_EN0|IR_EN1|IR_EN2;
- NVIC_ISER = GP234_INT;
- }
复制代码
|
|