mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Embed: (wiki syntax)

« Back to documentation index

InterruptManager Class Reference

InterruptManager Class Reference
[Drivers]

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

#include <InterruptManager.h>

Inherits NonCopyable< InterruptManager >, and NonCopyable< InterruptManager >.

Public Member Functions

 MBED_DEPRECATED_SINCE ("mbed-os-5.6","This class is not part of the ""public API of mbed-os and is being removed in the future.") static InterruptManager *get()
 Get the instance of InterruptManager Class.
 MBED_DEPRECATED_SINCE ("mbed-os-5.6","This class is not part of the ""public API of mbed-os and is being removed in the future.") static void destroy()
 Destroy the current instance of the interrupt manager.
 MBED_DEPRECATED_SINCE ("mbed-os-5.6","This class is not part of the ""public API of mbed-os and is being removed in the future.") pFunctionPointer_t add_handler(void(*function)(void)
 Add a handler for an interrupt at the end of the handler list.
 MBED_DEPRECATED_SINCE ("mbed-os-5.6","This class is not part of the ""public API of mbed-os and is being removed in the future.") static InterruptManager *get()
 Get the instance of InterruptManager Class.
 MBED_DEPRECATED_SINCE ("mbed-os-5.6","This class is not part of the ""public API of mbed-os and is being removed in the future.") static void destroy()
 Destroy the current instance of the interrupt manager.
 MBED_DEPRECATED_SINCE ("mbed-os-5.6","This class is not part of the ""public API of mbed-os and is being removed in the future.") pFunctionPointer_t add_handler(void(*function)(void)
 Add a handler for an interrupt at the end of the handler list.

Private Member Functions

 MBED_DEPRECATED ("Invalid copy construction of a NonCopyable resource.") NonCopyable(const NonCopyable &)
 NonCopyable copy constructor.
 MBED_DEPRECATED ("Invalid copy assignment of a NonCopyable resource.") NonCopyable &operator
 NonCopyable copy assignment operator.
 MBED_DEPRECATED ("Invalid copy construction of a NonCopyable resource.") NonCopyable(const NonCopyable &)
 NonCopyable copy constructor.
 MBED_DEPRECATED ("Invalid copy assignment of a NonCopyable resource.") NonCopyable &operator
 NonCopyable copy assignment operator.

Detailed Description

Use this singleton if you need to chain interrupt handlers.

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);
 }
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 59 of file cmsis/BUILD/mbed/drivers/InterruptManager.h.


Member Function Documentation

MBED_DEPRECATED_SINCE ( "mbed-os-5.6"  ,
"This class is not part of the ""public API of mbed-os and is being removed in the future."   
)

Get the instance of InterruptManager Class.

Returns:
the only instance of this class
MBED_DEPRECATED_SINCE ( "mbed-os-5.6"  ,
"This class is not part of the ""public API of mbed-os and is being removed in the future."   
)

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

Parameters:
functionthe handler to add
irqinterrupt number
Returns:
The function object created for 'function'
MBED_DEPRECATED_SINCE ( "mbed-os-5.6"  ,
"This class is not part of the ""public API of mbed-os and is being removed in the future."   
)

Destroy the current instance of the interrupt manager.

MBED_DEPRECATED_SINCE ( "mbed-os-5.6"  ,
"This class is not part of the ""public API of mbed-os and is being removed in the future."   
)

Get the instance of InterruptManager Class.

Returns:
the only instance of this class
MBED_DEPRECATED_SINCE ( "mbed-os-5.6"  ,
"This class is not part of the ""public API of mbed-os and is being removed in the future."   
)

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

Parameters:
functionthe handler to add
irqinterrupt number
Returns:
The function object created for 'function'
MBED_DEPRECATED_SINCE ( "mbed-os-5.6"  ,
"This class is not part of the ""public API of mbed-os and is being removed in the future."   
)

Destroy the current instance of the interrupt manager.