在GPIOInit( )中进行配置; void GPIOInit( void ) { /* Enable AHB clock to the GPIO domain. */ LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);
#ifdef __JTAG_DISABLED
LPC_IOCON->JTAG_TDO_PIO1_1 &= ~0x07; LPC_IOCON->JTAG_TDO_PIO1_1 |= 0x01;
LPC_IOCON->JTAG_TMS_PIO1_0 |= 0x01; LPC_IOCON->JTAG_nTRST_PIO1_2 |= 0x01; LPC_IOCON->ARM_SWDIO_PIO1_3 |= 0x01; LPC_IOCON->JTAG_TCK_PIO0_10 |= 0x01; LPC_IOCON->JTAG_TDI_PIO0_11 |= 0x01;
#endif
/* Set up NVIC when I/O pins are configured as external interrupts. */ NVIC_EnableIRQ(EINT0_IRQn); NVIC_EnableIRQ(EINT1_IRQn); NVIC_EnableIRQ(EINT2_IRQn); NVIC_EnableIRQ(EINT3_IRQn); return; } |