#include <InterruptIn.h>
|
| InterruptIn (PinName pin) |
|
int | read () |
|
| operator int () |
|
void | rise (void(*fptr)(void)) |
|
template<typename T > |
void | rise (T *tptr, void(T::*mptr)(void)) |
|
void | fall (void(*fptr)(void)) |
|
template<typename T > |
void | fall (T *tptr, void(T::*mptr)(void)) |
|
void | mode (PinMode pull) |
|
void | enable_irq () |
|
void | disable_irq () |
|
|
static void | _irq_handler (uint32_t id, gpio_irq_event event) |
|
|
gpio_t | gpio |
|
gpio_irq_t | gpio_irq |
|
mbed::util::FunctionPointer | _rise |
|
mbed::util::FunctionPointer | _fall |
|
A digital interrupt input, used to call a function on a rising or falling edge
Example:
#include "mbed.h"
DigitalOut led(LED1);
void trigger() {
printf("triggered!\n");
}
int main() {
event.rise(&trigger);
while(1) {
led = !led;
wait(0.25);
}
}
mbed::InterruptIn::InterruptIn |
( |
PinName |
pin | ) |
|
Create an InterruptIn connected to the specified pin
- Parameters
-
pin | InterruptIn pin to connect to |
name | (optional) A string to identify the object |
void mbed::InterruptIn::disable_irq |
( |
| ) |
|
Disable IRQ. This method depends on hw implementation, might disable one port interrupts. For further information, check gpio_irq_disable().
void mbed::InterruptIn::enable_irq |
( |
| ) |
|
Enable IRQ. This method depends on hw implementation, might enable one port interrupts. For further information, check gpio_irq_enable().
void mbed::InterruptIn::fall |
( |
void(*)(void) |
fptr | ) |
|
Attach a function to call when a falling edge occurs on the input
- Parameters
-
fptr | A pointer to a void function, or 0 to set as none |
template<typename T >
void mbed::InterruptIn::fall |
( |
T * |
tptr, |
|
|
void(T::*)(void) |
mptr |
|
) |
| |
|
inline |
Attach a member function to call when a falling edge occurs on the input
- Parameters
-
tptr | pointer to the object to call the member function on |
mptr | pointer to the member function to be called |
void mbed::InterruptIn::mode |
( |
PinMode |
pull | ) |
|
Set the input pin mode
- Parameters
-
mode | PullUp, PullDown, PullNone |
void mbed::InterruptIn::rise |
( |
void(*)(void) |
fptr | ) |
|
Attach a function to call when a rising edge occurs on the input
- Parameters
-
fptr | A pointer to a void function, or 0 to set as none |
template<typename T >
void mbed::InterruptIn::rise |
( |
T * |
tptr, |
|
|
void(T::*)(void) |
mptr |
|
) |
| |
|
inline |
Attach a member function to call when a rising edge occurs on the input
- Parameters
-
tptr | pointer to the object to call the member function on |
mptr | pointer to the member function to be called |
The documentation for this class was generated from the following files: