FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
General API for handling External Interrupt pins. More...
#include "boards/board_traits.h"
#include <avr/interrupt.h>
#include "interrupts.h"
#include "utilities.h"
Go to the source code of this file.
Classes | |
class | interrupt::INTSignal< EXTPIN_ > |
Handler of an External Interrupt. More... | |
Namespaces | |
namespace | board |
Defines all types and constants specific to support a specific MCU target. | |
namespace | interrupt |
Defines API to handle AVR interruptions. | |
Macros | |
#define | REGISTER_INT_ISR_METHOD(INT_NUM, PIN, HANDLER, CALLBACK) |
Register the necessary ISR (Interrupt Service Routine) for an External Interrupt pin. More... | |
#define | REGISTER_INT_ISR_FUNCTION(INT_NUM, PIN, CALLBACK) |
Register the necessary ISR (Interrupt Service Routine) for an External Interrupt pin. More... | |
#define | REGISTER_INT_ISR_EMPTY(INT_NUM, PIN) |
Register an empty ISR (Interrupt Service Routine) for an External Interrupt pin. More... | |
#define | DECL_INT_ISR_HANDLERS_FRIEND |
This macro shall be used in a class containing a private callback method, registered by REGISTER_INT_ISR_METHOD . More... | |
Enumerations | |
enum class | interrupt::InterruptTrigger : uint8_t { interrupt::LOW_LEVEL = 0x00 , interrupt::ANY_CHANGE = 0x55 , interrupt::FALLING_EDGE = 0xAA , interrupt::RISING_EDGE = 0xFF } |
Kind of change that will trigger an External Interrupt for a given pin. More... | |
Functions | |
template<ExternalInterruptPin EXT> | |
constexpr DigitalPin | board::EXT_PIN () |
Convert an ExternalInterruptPin to the matching DigitalPin . More... | |
General API for handling External Interrupt pins.
Definition in file int.h.
#define REGISTER_INT_ISR_METHOD | ( | INT_NUM, | |
PIN, | |||
HANDLER, | |||
CALLBACK | |||
) |
Register the necessary ISR (Interrupt Service Routine) for an External Interrupt pin.
INT_NUM | the number of the INT vector for this PIN |
PIN | the board::ExternalInterruptPin for INT_NUM ; if PIN and INT_NUM do not match, compilation will fail. |
HANDLER | the class holding the callback method |
CALLBACK | the method of HANDLER that will be called when the interrupt is triggered; this must be a proper PTMF (pointer to member function). |
#define REGISTER_INT_ISR_FUNCTION | ( | INT_NUM, | |
PIN, | |||
CALLBACK | |||
) |
Register the necessary ISR (Interrupt Service Routine) for an External Interrupt pin.
INT_NUM | the number of the INT vector for this PIN |
PIN | the board::ExternalInterruptPin for INT_NUM ; if PIN and INT_NUM do not match, compilation will fail. |
CALLBACK | the function that will be called when the interrupt is triggered |
#define REGISTER_INT_ISR_EMPTY | ( | INT_NUM, | |
PIN | |||
) |
Register an empty ISR (Interrupt Service Routine) for an External Interrupt pin.
This can be useful if you just need to wake up the MCU from an external signal, but do not need to perform any sepcific stuff with a callback.
INT_NUM | the number of the INT vector for this PIN |
PIN | the board::ExternalInterruptPin for INT_NUM ; if PIN and INT_NUM do not match, compilation will fail. |
#define DECL_INT_ISR_HANDLERS_FRIEND |
This macro shall be used in a class containing a private callback method, registered by REGISTER_INT_ISR_METHOD
.
It declares the class where it is used as a friend of all necessary functions so that the private callback method can be called properly.