##### Synopsis

    #include <ctl_api.h>
    void ctl_set_isr(unsigned int vector,
                     unsigned int priority,
                     CTL_ISR_TRIGGER_t trigger,
                     CTL_ISR_FN_t isr,
                     CTL_ISR_FN_t *oldisr);

##### Description

The function ctl_set_isr takes the interrupt vector number and priority as arguments. These number will vary from system to system - check the data sheet of the system you are using for information. The trigger defines the type of interrupt that will trigger the interrupt service routine.

- CTL_ISR_TRIGGER_FIXED — the trigger type is not programmable.
- CTL_ISR_TRIGGER_LOW_LEVEL — generates an interrupt when the signal is low.
- CTL_ISR_TRIGGER_HIGH_LEVEL — generates an interrupt when the signal is high.
- CTL_ISR_TRIGGER_NEGATIVE_EDGE — generates an interrupt on a falling edge.
- CTL_ISR_TRIGGER_POSITIVE_EDGE — generates an interrupt on a rising edge.
- CTL_ISR_TRIGGER_DUAL_EDGE — generates an interrupt on either a falling or a rising edge.

On many systems the interrupt controller lacks a programmable trigger type—use CTL_ISR_TRIGGER_FIXED on these systems.

The isr parameter is the C function to call on interrupt and if oldisr is non zero then the existing interrupt handler is returned in *oldisr.

##### Portability

The ctl_set_isr function is provided on systems that have programmable interrupt controller hardware.

###### See Also

Programmable interrupt handling