#include <InterruptManager.h>
|
pFunctionPointer_t | add_handler (void(*function)(void), IRQn_Type irq) |
|
pFunctionPointer_t | add_handler_front (void(*function)(void), IRQn_Type irq) |
|
template<typename T > |
pFunctionPointer_t | add_handler (T *tptr, void(T::*mptr)(void), IRQn_Type irq) |
|
template<typename T > |
pFunctionPointer_t | add_handler_front (T *tptr, void(T::*mptr)(void), IRQn_Type irq) |
|
bool | remove_handler (pFunctionPointer_t handler, IRQn_Type irq) |
|
Use this singleton if you need to chain interrupt handlers.
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);
}
pFunctionPointer_t mbed::InterruptManager::add_handler |
( |
void(*)(void) |
function, |
|
|
IRQn_Type |
irq |
|
) |
| |
|
inline |
Add a handler for an interrupt at the end of the handler list
- Parameters
-
function | the handler to add |
irq | interrupt number |
- Returns
- The function object created for 'function'
template<typename T >
pFunctionPointer_t mbed::InterruptManager::add_handler |
( |
T * |
tptr, |
|
|
void(T::*)(void) |
mptr, |
|
|
IRQn_Type |
irq |
|
) |
| |
|
inline |
Add a handler for an interrupt at the end of the handler list
- Parameters
-
tptr | pointer to the object that has the handler function |
mptr | pointer to the actual handler function |
irq | interrupt number |
- Returns
- The function object created for 'tptr' and 'mptr'
pFunctionPointer_t mbed::InterruptManager::add_handler_front |
( |
void(*)(void) |
function, |
|
|
IRQn_Type |
irq |
|
) |
| |
|
inline |
Add a handler for an interrupt at the beginning of the handler list
- Parameters
-
function | the handler to add |
irq | interrupt number |
- Returns
- The function object created for 'function'
template<typename T >
pFunctionPointer_t mbed::InterruptManager::add_handler_front |
( |
T * |
tptr, |
|
|
void(T::*)(void) |
mptr, |
|
|
IRQn_Type |
irq |
|
) |
| |
|
inline |
Add a handler for an interrupt at the beginning of the handler list
- Parameters
-
tptr | pointer to the object that has the handler function |
mptr | pointer to the actual handler function |
irq | interrupt number |
- Returns
- The function object created for 'tptr' and 'mptr'
void mbed::InterruptManager::destroy |
( |
| ) |
|
|
static |
Destroy the current instance of the interrupt manager
Return the only instance of this class
bool mbed::InterruptManager::remove_handler |
( |
pFunctionPointer_t |
handler, |
|
|
IRQn_Type |
irq |
|
) |
| |
Remove a handler from an interrupt
- Parameters
-
handler | the function object for the handler to remove |
irq | the interrupt number |
- Returns
- true if the handler was found and removed, false otherwise
The documentation for this class was generated from the following files: