Guest User

Untitled

a guest
Jan 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. /*Init the GPIO pin for interrupt control */
  2. void GPIO_Init(){
  3. LPC_IOCON-> =.. //Pin configuration register
  4. LPC_GPIO1->FIODIR = ... //GPIO Data direction register
  5. LPC_GPIO1->FIOMASK = .. //GPIO Data mask register - choose the right pin
  6. LPC_GPIO1->GPIOnIE = .. //Set up falling or rising edge
  7. NVIC_EnableIRQ(PIO_1); //Call API to enable interrupt in NVIC
  8. NVIC_SetPriority(PriorityN); //Set priority if needed
  9. }
  10.  
  11.  
  12. /*Must have the same name as listed in start-up file startup_LPC11xx.s */
  13. void PIOINT1_IRQHandler(void){
  14. //Do something here
  15. }
  16.  
  17. // in file mygpio.h or mygpio.c
  18.  
  19. #define MY_GPIO_IRQHandler PIOINT1_IRQHandler
Add Comment
Please, Sign In to add comment