4.5.2 Interrupts with Priority Levels

4.5.2.1 Introduction

The Interrupt Manager handles and prioritizes the interrupt requests from the different peripheral modules. It also provides APIs for users to control how global, peripheral, and external interrupts will be serviced. This interrupt module supports priority interrupts, enabling users to customize which interrupts are serviced first or interrupt other low-priority interrupts.

4.5.2.2 Supported Device Families

PIC18F-K20PIC18F-K22PIC18F-K50
PIC18F-K80 PIC18F-K90

4.5.2.3 Required header files

#include "mcc_generated_files/system/interrupt.h"

4.5.2.4 Module Documentation

4.5.2.4.1 INTERRUPT

This file contains API prototypes and other data types for the Interrupt Manager driver.

Module description

This file contains API prototypes and other data types for the Interrupt Manager driver.

Version: Interrupt Manager Driver Version 1.0.0
Definitions
  • #define INTERRUPT_GlobalInterruptHighEnable() (0 = 1)

    Enables high-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptHighDisable() (0 = 0)

    Disables high-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptHighStatus() (0)

    Returns the Global Interrupt Enable High bit status.

  • #define INTERRUPT_GlobalInterruptLowEnable() (0 = 1)

    Enables low-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptLowDisable() (0 = 0)

    Disables low-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptLowStatus() (0)

    Returns the Global Interrupt Enable Low bit status.

  • #define INTERRUPT_PeripheralInterruptEnable() (INTCONbits.PEIE = 1)

    Enables peripheral interrupts.

  • #define INTERRUPT_PeripheralInterruptDisable() (INTCONbits.PEIE = 0)

    Disables peripheral interrupts.

  • #define EXT_INT0_InterruptFlagClear() (INTCONbits.INT0IF = 0)

    Clears the Interrupt flag for the external interrupt, INT0.

  • #define EXT_INT0_InterruptDisable() (INTCONbits.INT0IE = 0)

    Clears the interrupt enable for the external interrupt, INT0. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

  • #define EXT_INT0_InterruptEnable() (INTCONbits.INT0IE = 1)

    Sets the interrupt enable for the external interrupt, INT0. This way, the external interrupts on this pin will be serviced by the interrupt handler.

  • #define EXT_INT0_risingEdgeSet() (INTCON2bits.INTEDG0 = 1)

    Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

  • #define EXT_INT0_fallingEdgeSet() (INTCON2bits.INTEDG0 = 0)

    Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

  • #define EXT_INT1_InterruptFlagClear() (INTCON3bits.INT1IF = 0)

    Clears the Interrupt flag for the external interrupt, INT1.

  • #define EXT_INT1_InterruptDisable() (INTCON3bits.INT1IE = 0)

    Clears the interrupt enable for the external interrupt, INT1. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

  • #define EXT_INT1_InterruptEnable() (INTCON3bits.INT1IE = 1)

    Sets the interrupt enable for the external interrupt, INT1. This way, the external interrupts on this pin will be serviced by the interrupt handler.

  • #define EXT_INT1_risingEdgeSet() (INTCON2bits.INTEDG1 = 1)

    Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

  • #define EXT_INT1_fallingEdgeSet() (INTCON2bits.INTEDG1 = 0)

    Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

  • #define EXT_INT2_InterruptFlagClear() (INTCON3bits.INT2IF = 0)

    Clears the Interrupt flag for the external interrupt, INT2.

  • #define EXT_INT2_InterruptDisable() (INTCON3bits.INT2IE = 0)

    Clears the interrupt enable for the external interrupt, INT2. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

  • #define EXT_INT2_InterruptEnable() (INTCON3bits.INT2IE = 1)

    Sets the interrupt enable for the external interrupt, INT2. This way, the external interrupts on this pin will be serviced by the interrupt handler.

  • #define EXT_INT2_risingEdgeSet() (INTCON2bits.INTEDG2 = 1)

    Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

  • #define EXT_INT2_fallingEdgeSet() (INTCON2bits.INTEDG2 = 0)

    Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

Functions
  • void __interrupt ()

    Services the Interrupt Service Routines (ISR) of high-priority enabled interrupts and is called every time a high-priority interrupt is triggered.

  • void INTERRUPT_Initialize (void)

    Initializes peripheral interrupt priorities, enables or disables priority vectors and initializes the external interrupt.

  • void INT0_ISR (void)

    Executes the ISR whenever the signal on the INT0 pin transitions to the preconfigured state.

  • void INT0_CallBack (void)

    Allows for a specific callback function to be called in the INT0 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT0_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT0 - INT0 at application run time.

  • void INT0_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

  • void INT1_ISR (void)

    Executes the ISR whenever the signal on the INT1 pin transitions to the preconfigured state.

  • void INT1_CallBack (void)

    Allows for a specific callback function to be called in the INT1 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT1_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT1 - INT1 at application run time.

  • void INT1_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

  • void INT2_ISR (void)

    Executes the ISR whenever the signal on the INT2 pin transitions to the preconfigured state.

  • void INT2_CallBack (void)

    Allows for a specific callback function to be called in the INT2 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT2_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT2 - INT2 at application run time.

  • void INT2_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Variables
  • void(* INT0_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

  • void(* INT1_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

  • void(* INT2_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Definition Documentation

EXT_INT0_fallingEdgeSet

#define EXT_INT0_fallingEdgeSet( ) (INTCON2bits.INTEDG0 = 0)

Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

Parameters:
None.
Returns:

None.

EXT_INT0_InterruptDisable

#define EXT_INT0_InterruptDisable( ) (INTCONbits.INT0IE = 0)

Clears the interrupt enable for the external interrupt, INT0. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

Parameters:
None.
Returns:

None.

EXT_INT0_InterruptEnable

#define EXT_INT0_InterruptEnable( ) (INTCONbits.INT0IE = 1)

Sets the interrupt enable for the external interrupt, INT0. This way, the external interrupts on this pin will be serviced by the interrupt handler.

Parameters:
None.
Returns:

None.

EXT_INT0_InterruptFlagClear

#define EXT_INT0_InterruptFlagClear( ) (INTCONbits.INT0IF = 0)

Clears the Interrupt flag for the external interrupt, INT0.

Parameters:
None.
Returns:

None.

EXT_INT0_risingEdgeSet

#define EXT_INT0_risingEdgeSet( ) (INTCON2bits.INTEDG0 = 1)

Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

Parameters:
None.
Returns:

None.

EXT_INT1_fallingEdgeSet

#define EXT_INT1_fallingEdgeSet( ) (INTCON2bits.INTEDG1 = 0)

Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

Parameters:
None.
Returns:

None.

EXT_INT1_InterruptDisable

#define EXT_INT1_InterruptDisable( ) (INTCON3bits.INT1IE = 0)

Clears the interrupt enable for the external interrupt, INT1. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

Parameters:
None.
Returns:

None.

EXT_INT1_InterruptEnable

#define EXT_INT1_InterruptEnable( ) (INTCON3bits.INT1IE = 1)

Sets the interrupt enable for the external interrupt, INT1. This way, the external interrupts on this pin will be serviced by the interrupt handler.

Parameters:
None.
Returns:

None.

EXT_INT1_InterruptFlagClear

#define EXT_INT1_InterruptFlagClear( ) (INTCON3bits.INT1IF = 0)

Clears the Interrupt flag for the external interrupt, INT1.

Parameters:
None.
Returns:

None.

EXT_INT1_risingEdgeSet

#define EXT_INT1_risingEdgeSet( ) (INTCON2bits.INTEDG1 = 1)

Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

Parameters:
None.
Returns:

None.

EXT_INT2_fallingEdgeSet

#define EXT_INT2_fallingEdgeSet( ) (INTCON2bits.INTEDG2 = 0)

Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

Parameters:
None.
Returns:

None.

EXT_INT2_InterruptDisable

#define EXT_INT2_InterruptDisable( ) (INTCON3bits.INT2IE = 0)

Clears the interrupt enable for the external interrupt, INT2. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

Parameters:
None.
Returns:

None.

EXT_INT2_InterruptEnable

#define EXT_INT2_InterruptEnable( ) (INTCON3bits.INT2IE = 1)

Sets the interrupt enable for the external interrupt, INT2. This way, the external interrupts on this pin will be serviced by the interrupt handler.

Parameters:
None.
Returns:

None.

EXT_INT2_InterruptFlagClear

#define EXT_INT2_InterruptFlagClear( ) (INTCON3bits.INT2IF = 0)

Clears the Interrupt flag for the external interrupt, INT2.

Parameters:
None.
Returns:

None.

EXT_INT2_risingEdgeSet

#define EXT_INT2_risingEdgeSet( ) (INTCON2bits.INTEDG2 = 1)

Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

Parameters:
None.
Returns:

None.

INTERRUPT_GlobalInterruptHighDisable

#define INTERRUPT_GlobalInterruptHighDisable( ) (0 = 0)

Disables high-priority global interrupts.

Parameters:
None.
Returns:

None.

INTERRUPT_GlobalInterruptHighEnable

#define INTERRUPT_GlobalInterruptHighEnable( ) (0 = 1)

Enables high-priority global interrupts.

Parameters:
None.
Returns:

None.

INTERRUPT_GlobalInterruptHighStatus

#define INTERRUPT_GlobalInterruptHighStatus( ) (0)

Returns the Global Interrupt Enable High bit status.

Parameters:
None.
Return values:
0

- Global interrupt disabled.

1

- Global interrupt enabled.

INTERRUPT_GlobalInterruptLowDisable

#define INTERRUPT_GlobalInterruptLowDisable( ) (0 = 0)

Disables low-priority global interrupts.

Parameters:
None.
Returns:

None.

INTERRUPT_GlobalInterruptLowEnable

#define INTERRUPT_GlobalInterruptLowEnable( ) (0 = 1)

Enables low-priority global interrupts.

Parameters:
None.
Returns:

None.

INTERRUPT_GlobalInterruptLowStatus

#define INTERRUPT_GlobalInterruptLowStatus( ) (0)

Returns the Global Interrupt Enable Low bit status.

Parameters:
None.
Return values:
0

- Global interrupt disabled.

1

- Global interrupt enabled.

INTERRUPT_PeripheralInterruptDisable

#define INTERRUPT_PeripheralInterruptDisable( ) (INTCONbits.PEIE = 0)

Disables peripheral interrupts.

Parameters:
None.
Returns:

None.

INTERRUPT_PeripheralInterruptEnable

#define INTERRUPT_PeripheralInterruptEnable( ) (INTCONbits.PEIE = 1)

Enables peripheral interrupts.

Parameters:
None.
Returns:

None.

Function Documentation

__interrupt()

void __interrupt ( )

Services the Interrupt Service Routines (ISR) of high-priority enabled interrupts and is called every time a high-priority interrupt is triggered.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT0_CallBack()

void INT0_CallBack (void )

Allows for a specific callback function to be called in the INT0 ISR and for a nonspecific interrupt handler to be called at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT0_DefaultInterruptHandler()

void INT0_DefaultInterruptHandler (void )

Default interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT0_ISR()

void INT0_ISR (void )

Executes the ISR whenever the signal on the INT0 pin transitions to the preconfigured state.

Section: External Interrupt Handlers

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT0_SetInterruptHandler()

void INT0_SetInterruptHandler (void(*)(void) InterruptHandler)

Allows selecting an interrupt handler for EXT_INT0 - INT0 at application run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
(*InterruptHandler)(void)

- InterruptHandler function pointer.

Returns:

None.

INT1_CallBack()

void INT1_CallBack (void )

Allows for a specific callback function to be called in the INT1 ISR and for a nonspecific interrupt handler to be called at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT1_DefaultInterruptHandler()

void INT1_DefaultInterruptHandler (void )

Default interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT1_ISR()

void INT1_ISR (void )

Executes the ISR whenever the signal on the INT1 pin transitions to the preconfigured state.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT1_SetInterruptHandler()

void INT1_SetInterruptHandler (void(*)(void) InterruptHandler)

Allows selecting an interrupt handler for EXT_INT1 - INT1 at application run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
(*InterruptHandler)(void)

- InterruptHandler function pointer.

Returns:

None.

INT2_CallBack()

void INT2_CallBack (void )

Allows for a specific callback function to be called in the INT2 ISR and for a nonspecific interrupt handler to be called at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT2_DefaultInterruptHandler()

void INT2_DefaultInterruptHandler (void )

Default interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT2_ISR()

void INT2_ISR (void )

Executes the ISR whenever the signal on the INT2 pin transitions to the preconfigured state.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT2_SetInterruptHandler()

void INT2_SetInterruptHandler (void(*)(void) InterruptHandler)

Allows selecting an interrupt handler for EXT_INT2 - INT2 at application run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
(*InterruptHandler)(void)

- InterruptHandler function pointer.

Returns:

None.

INTERRUPT_Initialize()

void INTERRUPT_Initialize (void )

Initializes peripheral interrupt priorities, enables or disables priority vectors and initializes the external interrupt.

Parameters:
None.
Returns:

None.

Variable Documentation

INT0_InterruptHandler

void(* INT0_InterruptHandler) (void)

Dynamic interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT1_InterruptHandler

void(* INT1_InterruptHandler) (void)

Dynamic interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

INT2_InterruptHandler

void(* INT2_InterruptHandler) (void)

Dynamic interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Precondition:

Interrupt Manager is initialized.

Parameters:
None.
Returns:

None.

4.5.2.5 File Documentation

4.5.2.5.1 source/interrupt.c File Reference

This file contains the API implementation for the Interrupt Manager driver.

#include "../../system/interrupt.h"
#include "../../system/system.h"
#include "../pins.h"

Functions

  • void INTERRUPT_Initialize (void)

    Initializes peripheral interrupt priorities, enables or disables priority vectors and initializes the external interrupt.

  • void __interrupt ()

    Services the Interrupt Service Routines (ISR) of high-priority enabled interrupts and is called every time a high-priority interrupt is triggered.

  • void INT0_ISR (void)

    Executes the ISR whenever the signal on the INT0 pin transitions to the preconfigured state.

  • void INT0_CallBack (void)

    Allows for a specific callback function to be called in the INT0 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT0_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT0 - INT0 at application run time.

  • void INT0_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

  • void INT1_ISR (void)

    Executes the ISR whenever the signal on the INT1 pin transitions to the preconfigured state.

  • void INT1_CallBack (void)

    Allows for a specific callback function to be called in the INT1 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT1_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT1 - INT1 at application run time.

  • void INT1_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

  • void INT2_ISR (void)

    Executes the ISR whenever the signal on the INT2 pin transitions to the preconfigured state.

  • void INT2_CallBack (void)

    Allows for a specific callback function to be called in the INT2 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT2_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT2 - INT2 at application run time.

  • void INT2_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Variables

  • void(* INT0_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

  • void(* INT1_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

  • void(* INT2_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Detailed Description

This file contains the API implementation for the Interrupt Manager driver.

Interrupt Manager Generated Driver File

Version: Interrupt Manager Driver Version 1.0.0

4.5.2.5.2 source/interrupt.h File Reference

Functions

  • void INTERRUPT_Initialize (void)

    Initializes peripheral interrupt priorities, enables or disables priority vectors and initializes the external interrupt.

  • void INT0_ISR (void)

    Executes the ISR whenever the signal on the INT0 pin transitions to the preconfigured state.

  • void INT0_CallBack (void)

    Allows for a specific callback function to be called in the INT0 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT0_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT0 - INT0 at application run time.

  • void INT0_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

  • void INT1_ISR (void)

    Executes the ISR whenever the signal on the INT1 pin transitions to the preconfigured state.

  • void INT1_CallBack (void)

    Allows for a specific callback function to be called in the INT1 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT1_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT1 - INT1 at application run time.

  • void INT1_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

  • void INT2_ISR (void)

    Executes the ISR whenever the signal on the INT2 pin transitions to the preconfigured state.

  • void INT2_CallBack (void)

    Allows for a specific callback function to be called in the INT2 ISR and for a nonspecific interrupt handler to be called at run time.

  • void INT2_SetInterruptHandler (void(*InterruptHandler)(void))

    Allows selecting an interrupt handler for EXT_INT2 - INT2 at application run time.

  • void INT2_DefaultInterruptHandler (void)

    Default interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Macros

  • #define INTERRUPT_GlobalInterruptHighEnable() (0 = 1)

    Enables high-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptHighDisable() (0 = 0)

    Disables high-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptHighStatus() (0)

    Returns the Global Interrupt Enable High bit status.

  • #define INTERRUPT_GlobalInterruptLowEnable() (0 = 1)

    Enables low-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptLowDisable() (0 = 0)

    Disables low-priority global interrupts.

  • #define INTERRUPT_GlobalInterruptLowStatus() (0)

    Returns the Global Interrupt Enable Low bit status.

  • #define INTERRUPT_PeripheralInterruptEnable() (INTCONbits.PEIE = 1)

    Enables peripheral interrupts.

  • #define INTERRUPT_PeripheralInterruptDisable() (INTCONbits.PEIE = 0)

    Disables peripheral interrupts.

  • #define EXT_INT0_InterruptFlagClear() (INTCONbits.INT0IF = 0)

    Clears the Interrupt flag for the external interrupt, INT0.

  • #define EXT_INT0_InterruptDisable() (INTCONbits.INT0IE = 0)

    Clears the interrupt enable for the external interrupt, INT0. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

  • #define EXT_INT0_InterruptEnable() (INTCONbits.INT0IE = 1)

    Sets the interrupt enable for the external interrupt, INT0. This way, the external interrupts on this pin will be serviced by the interrupt handler.

  • #define EXT_INT0_risingEdgeSet() (INTCON2bits.INTEDG0 = 1)

    Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

  • #define EXT_INT0_fallingEdgeSet() (INTCON2bits.INTEDG0 = 0)

    Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

  • #define EXT_INT1_InterruptFlagClear() (INTCON3bits.INT1IF = 0)

    Clears the Interrupt flag for the external interrupt, INT1.

  • #define EXT_INT1_InterruptDisable() (INTCON3bits.INT1IE = 0)

    Clears the interrupt enable for the external interrupt, INT1. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

  • #define EXT_INT1_InterruptEnable() (INTCON3bits.INT1IE = 1)

    Sets the interrupt enable for the external interrupt, INT1. This way, the external interrupts on this pin will be serviced by the interrupt handler.

  • #define EXT_INT1_risingEdgeSet() (INTCON2bits.INTEDG1 = 1)

    Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

  • #define EXT_INT1_fallingEdgeSet() (INTCON2bits.INTEDG1 = 0)

    Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

  • #define EXT_INT2_InterruptFlagClear() (INTCON3bits.INT2IF = 0)

    Clears the Interrupt flag for the external interrupt, INT2.

  • #define EXT_INT2_InterruptDisable() (INTCON3bits.INT2IE = 0)

    Clears the interrupt enable for the external interrupt, INT2. This way, the external interrupts on this pin will not be serviced by the interrupt handler.

  • #define EXT_INT2_InterruptEnable() (INTCON3bits.INT2IE = 1)

    Sets the interrupt enable for the external interrupt, INT2. This way, the external interrupts on this pin will be serviced by the interrupt handler.

  • #define EXT_INT2_risingEdgeSet() (INTCON2bits.INTEDG2 = 1)

    Sets the edge detect of the external interrupt to positive edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from low to high.

  • #define EXT_INT2_fallingEdgeSet() (INTCON2bits.INTEDG2 = 0)

    Sets the edge detect of the external interrupt to negative edge. This way, the Interrupt flag will be set when the external interrupt pin level transitions from high to low.

Variables

  • void(* INT0_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT0 ISR is executed. It allows any function to be registered at run time.

  • void(* INT1_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT1 ISR is executed. It allows any function to be registered at run time.

  • void(* INT2_InterruptHandler )(void)

    Dynamic interrupt handler to be called every time the INT2 ISR is executed. It allows any function to be registered at run time.

Detailed Description

Interrupt Manager Generated Driver API Header File