keil_examples/EXTINT/extint.c
/*****************************************************************************
** Function name:		EINTInit
**
** Descriptions:		Initialize external interrupt pin and
**						install interrupt handler
**
** parameters:			None
** Returned value:		true or false, return false if the interrupt
**						handler can't be installed to the VIC table.
** 
*****************************************************************************/
Function name:         EINTInit
Descriptions:          Initialize external interrupt pin and
install interrupt handler

None
Returned value:                true or false, return false if the interrupt
handler can't be installed to the VIC table.
Function name : EINTInit Descriptions : Initialize external interrupt pin and install interrupt handler None Returned value : true or false return false if the interrupt handler can ' t be installed to the VIC table .
uint32_t EINTInit( void )
{
  LPC_PINCON->PINSEL4 = 0x00100000;	
  LPC_GPIO2->FIODIR = 0x000000FF;	
  LPC_GPIO2->FIOCLR = 0x000000FF;	
  LPC_GPIOINT->IO2IntEnF = 0x200;	
  LPC_SC->EXTMODE = EINT0_EDGE;		
  LPC_SC->EXTPOLAR = 0;				
  NVIC_EnableIRQ(EINT0_IRQn);
  return( TRUE );
}
uint32_t EINTInit ( void ) { LPC_PINCON -> PINSEL4 = 0x00100000 ; LPC_GPIO2 -> FIODIR = 0x000000FF ; LPC_GPIO2 -> FIOCLR = 0x000000FF ; LPC_GPIOINT -> IO2IntEnF = 0x200 ; LPC_SC -> EXTMODE = EINT0_EDGE ; LPC_SC -> EXTPOLAR = 0 ; NVIC_EnableIRQ ( EINT0_IRQn ) ; return ( TRUE ) ; }
Function name:         EINTInit
Descriptions:          Initialize external interrupt pin and
install interrupt handler
Function name : EINTInit Descriptions : Initialize external interrupt pin and install interrupt handler
/* set P2.10 as EINT0 and
									P2.0~7 GPIO output */ /* port 2, bit 0~7 only */ /* turn off LEDs */ /* Port2.10 is falling edge. */ /* INT0 edge trigger */ /* INT0 is falling edge by default */