Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions | Static Public Member Functions
InterruptManager Class Reference

Use this singleton if you need to chain interrupt handlers. More...

#include <InterruptManager.h>

Inheritance diagram for InterruptManager:
NonCopyable< InterruptManager >

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. More...
 
pFunctionPointer_t add_handler_front (void(*function)(void), IRQn_Type irq)
 Add a handler for an interrupt at the beginning of the handler list. More...
 
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. More...
 
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. More...
 
bool remove_handler (pFunctionPointer_t handler, IRQn_Type irq)
 Remove a handler from an interrupt. More...
 

Static Public Member Functions

static InterruptManagerget ()
 Get the instance of InterruptManager Class. More...
 
static void destroy ()
 Destroy the current instance of the interrupt manager. More...
 

Detailed Description

Use this singleton if you need to chain interrupt handlers.

Deprecated:
Do not use this class. This class is not part of the public API of mbed-os and is being removed in the future.
Note
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 62 of file InterruptManager.h.

Member Function Documentation

pFunctionPointer_t add_handler ( void(*)(void)  function,
IRQn_Type  irq 
)

Add a handler for an interrupt at the end of the handler list.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
Parameters
functionthe handler to add
irqinterrupt number
Returns
The function object created for 'function'

Definition at line 95 of file InterruptManager.h.

pFunctionPointer_t add_handler ( T *  tptr,
void(T::*)(void)  mptr,
IRQn_Type  irq 
)

Add a handler for an interrupt at the end of the handler list.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
Parameters
tptrpointer to the object that has the handler function
mptrpointer to the actual handler function
irqinterrupt number
Returns
The function object created for 'tptr' and 'mptr'

Definition at line 133 of file InterruptManager.h.

pFunctionPointer_t add_handler_front ( void(*)(void)  function,
IRQn_Type  irq 
)

Add a handler for an interrupt at the beginning of the handler list.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
Parameters
functionthe handler to add
irqinterrupt number
Returns
The function object created for 'function'

Definition at line 113 of file InterruptManager.h.

pFunctionPointer_t add_handler_front ( T *  tptr,
void(T::*)(void)  mptr,
IRQn_Type  irq 
)

Add a handler for an interrupt at the beginning of the handler list.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
Parameters
tptrpointer to the object that has the handler function
mptrpointer to the actual handler function
irqinterrupt number
Returns
The function object created for 'tptr' and 'mptr'

Definition at line 153 of file InterruptManager.h.

static void destroy ( )
static

Destroy the current instance of the interrupt manager.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
static InterruptManager* get ( )
static

Get the instance of InterruptManager Class.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
Returns
the only instance of this class
bool remove_handler ( pFunctionPointer_t  handler,
IRQn_Type  irq 
)

Remove a handler from an interrupt.

Deprecated:
Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future.
Parameters
handlerthe function object for the handler to remove
irqthe interrupt number
Returns
true if the handler was found and removed, false otherwise
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.