FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Defines API to handle AVR interruptions. More...
Classes | |
class | INTSignal |
Handler of an External Interrupt. More... | |
class | PCISignal |
Handler of a Pin Change Interrupt vector. More... | |
struct | PCIType |
Helper class that easily converts a PIN into the right PCISignal . More... | |
Typedefs | |
template<board::InterruptPin PIN> | |
using | PCI_SIGNAL = typename PCIType< PIN >::TYPE |
Useful alias type to the PCISignal type matching a given board::InterruptPin . More... | |
template<board::Port PORT> | |
using | PCI_PORT_SIGNAL = PCISignal< board_traits::Port_trait< PORT >::PCINT > |
Convert a board::PORT to the matching PCISignal . More... | |
Enumerations | |
enum class | InterruptTrigger : uint8_t { LOW_LEVEL = 0x00 , ANY_CHANGE = 0x55 , FALLING_EDGE = 0xAA , RISING_EDGE = 0xFF } |
Kind of change that will trigger an External Interrupt for a given pin. More... | |
Functions | |
template<typename Handler > | |
void | register_handler (Handler &handler) |
Register a class instance containing methods that shall be called back by an ISR. More... | |
template<typename Handler > | |
void | unregister_handler (Handler &handler) |
Unregister a class instance that was previously registered with interrupt::register_handler . More... | |
Defines API to handle AVR interruptions.
In particular, the following API are provided:
using interrupt::PCI_SIGNAL = typedef typename PCIType<PIN>::TYPE |
Useful alias type to the PCISignal
type matching a given board::InterruptPin
.
The following snippet demonstrates usage of PCI_SIGNAL
to declare a PCISignal
instance for later use in a function:
using interrupt::PCI_PORT_SIGNAL = typedef PCISignal<board_traits::Port_trait<PORT>::PCINT> |
|
strong |
Kind of change that will trigger an External Interrupt for a given pin.
Actual uint8_t
value matches the related mask for EICR, for up to 4 EXT pins (2 bits per pin), hence the 2-bits value is repeated 4 times.
void interrupt::register_handler | ( | Handler & | handler | ) |
Register a class instance containing methods that shall be called back by an ISR.
The class and member function shall be passed to one of REGISTER_XXXX_ISR_METHOD()
macros proposed by various FastArduino API, e.g. REGISTER_WATCHDOG_ISR_METHOD()
. The same class may have different methods to handle different ISR callbacks.
Handler | the class containing callback methods |
handler | the Handler instance which methods will be called back by registered ISR. |
Definition at line 185 of file interrupts.h.
void interrupt::unregister_handler | ( | Handler & | handler | ) |
Unregister a class instance that was previously registered with interrupt::register_handler
.
handler
is the current value held for Handler
type.future::Future
callbacks for which lifetime may not be as long as for an ISR.Handler | the class containing callback methods |
handler | the Handler instance to be deregistered. |
Definition at line 207 of file interrupts.h.