Hi
Eg of configuring an interrupt on PTA19 (falling edge sensitive with pull-up enabled on input).
1. Install the address of the handling interrupt routine at the PORT A vector
2. Enable the interrupt in the NVIC (for the K64 this means) - set the priority to 0xP0000000 of the NVIC piority register IRQ56_59_PRIORITY and enable the interrupt with a write of 0x08000000 to IRQ32_64_SER.
3. Enable the port interrupt (falling edeg with pull-up enabled) by writing 0x000a0103 to PORTA_PCR19
4. Make sure that global interrupts are also enabled [asm("cpsie i")]
Handle theinterrupt in the handling routine entered in 1) and clear the edge sensitive interrupt source by writing 0x00080000 to PORTA_ISFR.
Regards
Mark
P.S: Taken from the port interrupt interface in the uTasker project which is configured using:
INTERRUPT_SETUP interrupt_setup; // interrupt configuration parameters
interrupt_setup.int_type = PORT_INTERRUPT; // identifier to configure port interrupt
interrupt_setup.int_handler = test_irq; // handling function
interrupt_setup.int_priority = PRIORITY_PORT_A_INT; // interrupt priority level
interrupt_setup.int_port = PORTA; // the port that the interrupt input is on
interrupt_setup.int_port_bits = PORTA_BIT19; // the IRQ input connected
interrupt_setup.int_port_sense = (IRQ_FALLING_EDGE | PULLUP_ON); // interrupt is to be falling edge sensitive
fnConfigureInterrupt((void *)&interrupt_setup); // configure interrupt