Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
InterruptManager Class Reference
[Drivers]
Use this singleton if you need to chain interrupt handlers. More...
#include <InterruptManager.h>
Public Member Functions | |
pFunctionPointer_t | add_handler (void(*function)(void), IRQn_Type irq) |
Add a handler for an interrupt at the end of the handler list. | |
pFunctionPointer_t | add_handler_front (void(*function)(void), IRQn_Type irq) |
Add a handler for an interrupt at the beginning of the handler list. | |
template<typename T > | |
pFunctionPointer_t | add_handler (T *tptr, void(T::*mptr)(void), IRQn_Type irq) |
Add a handler for an interrupt at the end of the handler list. | |
template<typename T > | |
pFunctionPointer_t | add_handler_front (T *tptr, void(T::*mptr)(void), IRQn_Type irq) |
Add a handler for an interrupt at the beginning of the handler list. | |
bool | remove_handler (pFunctionPointer_t handler, IRQn_Type irq) |
Remove a handler from an interrupt. | |
Static Public Member Functions | |
static InterruptManager * | get () |
Return the only instance of this class. | |
static void | destroy () |
Destroy the current instance of the interrupt manager. |
Detailed Description
Use this singleton if you need to chain interrupt handlers.
Synchronization level: Thread safe
Example (for LPC1768):
#include "InterruptManager.h" #include "mbed.h" Ticker flipper; DigitalOut led1(LED1); DigitalOut led2(LED2); void flip(void) { led1 = !led1; } void handler(void) { led2 = !led1; } int main() { led1 = led2 = 0; flipper.attach(&flip, 1.0); InterruptManager::get()->add_handler(handler, TIMER3_IRQn); }
Definition at line 56 of file InterruptManager.h.
Member Function Documentation
InterruptManager * get | ( | ) | [static] |
Return the only instance of this class.
Definition at line 31 of file InterruptManager.cpp.
Generated on Tue Jul 12 2022 11:00:19 by
