Microchip® Advanced Software Framework

ext_int_megarf.h File Reference

External Interrupt for megaRF.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "ioport.h"

Macros

#define CLEAR_INT_FLAG(pin)   EIFR |= (1 << (pin & EXT_INT_PORT_MASK))
 Clears the int flag. More...
 
#define CLEAR_PCINT_FLAG0()   PCIFR |= (1 << PCIF0)
 
#define CLEAR_PCINT_FLAG1()   PCIFR |= (1 << PCIF1)
 
#define EXT_INT_PORT_MASK   0x07
 
#define INT_PIN_MASK(pin)   (1 << (pin & EXT_INT_PORT_MASK))
 Masks the required interrupt pin. More...
 

Typedefs

typedef void(* ext_int_callback_t )(void)
 Interrupt event callback function type. More...
 

Enumerations

enum  ext_int_pins {
  EXT_INT0_PIN = IOPORT_CREATE_PIN(PORTD,0),
  EXT_INT1_PIN = IOPORT_CREATE_PIN(PORTD,1),
  EXT_INT2_PIN = IOPORT_CREATE_PIN(PORTD,2),
  EXT_INT3_PIN = IOPORT_CREATE_PIN(PORTD,3),
  EXT_INT4_PIN = IOPORT_CREATE_PIN(PORTE,4),
  EXT_INT5_PIN = IOPORT_CREATE_PIN(PORTE,5),
  EXT_INT6_PIN = IOPORT_CREATE_PIN(PORTE,6),
  EXT_INT7_PIN = IOPORT_CREATE_PIN(PORTE,7)
}
 
enum  ext_pcint_pins {
  PC_INT0_PIN = IOPORT_CREATE_PIN(PORTB,0),
  PC_INT1_PIN = IOPORT_CREATE_PIN(PORTB,1),
  PC_INT2_PIN = IOPORT_CREATE_PIN(PORTB,2),
  PC_INT3_PIN = IOPORT_CREATE_PIN(PORTB,3),
  PC_INT4_PIN = IOPORT_CREATE_PIN(PORTB,4),
  PC_INT5_PIN = IOPORT_CREATE_PIN(PORTB,5),
  PC_INT6_PIN = IOPORT_CREATE_PIN(PORTB,6),
  PC_INT7_PIN = IOPORT_CREATE_PIN(PORTB,7),
  PC_INT8_PIN = IOPORT_CREATE_PIN(PORTE,0)
}
 

Functions

void ext_int_clear_flag (ioport_pin_t pin)
 Clear ext Interrupt flag. More...
 
void ext_int_disable (ioport_pin_t pin)
 Disable ext Interrupt. More...
 
void ext_int_enable (ioport_pin_t pin)
 Enable ext Interrupt. More...
 
void ext_int_init (ioport_pin_t pin, enum ioport_sense trigmode)
 Initializes ext Interrupt for the required interrupt Pin and trigger level Configures the interrupt pin as input pin, enables the pull of the pin, set the trigger mode clears the interrupt flag before enabling and enables the interrupt. More...
 
void ext_int_pcint_clear_flag (ioport_pin_t pin)
 Clear ext Interrupt flag. More...
 
void ext_int_pcint_disable (ioport_pin_t pin)
 Disable ext PC Interrupt. More...
 
void ext_int_pcint_enable (ioport_pin_t pin)
 Enable ext PC Interrupt. More...
 
void ext_int_pcint_init (ioport_pin_t pin)
 Initializes ext pin change Interrupt for the required interrupt Pin Configures the interrupt pin as input pin, enables the pull of the pin, clears the interrupt flag before enabling and enables the interrupt. More...
 
void ext_int_set_interrupt_callback (ioport_pin_t ext_int, ext_int_callback_t callback)
 Set external interrupt callback function. More...