Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Init the GPIO pin for interrupt control */
- void GPIO_Init(){
- LPC_IOCON-> =.. //Pin configuration register
- LPC_GPIO1->FIODIR = ... //GPIO Data direction register
- LPC_GPIO1->FIOMASK = .. //GPIO Data mask register - choose the right pin
- LPC_GPIO1->GPIOnIE = .. //Set up falling or rising edge
- NVIC_EnableIRQ(PIO_1); //Call API to enable interrupt in NVIC
- NVIC_SetPriority(PriorityN); //Set priority if needed
- }
- /*Must have the same name as listed in start-up file startup_LPC11xx.s */
- void PIOINT1_IRQHandler(void){
- //Do something here
- }
- // in file mygpio.h or mygpio.c
- #define MY_GPIO_IRQHandler PIOINT1_IRQHandler
Add Comment
Please, Sign In to add comment