Hello! I am newbie, I am using nordic nrf51822a board. Can anyone give me hardware interrupt example code and tell me how to enable it?
Hi,
Interrupts are essentially enabled by using two steps:
I'm attaching a small example on how to setup the ADC w/ISR.
Best regards Håkon
Hi,
The interrupt handler is located in the file startup_nrf51.s under the comment "; External Interrupts". These should be declared in your source file (let's say main.c) in this fashion: "void PERIPHERALX_IRQHandler(void){ .. }"
When enabling the IRQ, using NVIC-functions, they take in the type "IRQn_Type". This is declared in nrf51.h, line 82.