The official mbed C/C SDK provides the software platform and libraries to build your applications.
Fork of mbed by
InterruptIn Class Reference
A digital interrupt input, used to call a function on a rising or falling edge. More...
#include <InterruptIn.h>
Public Member Functions | |
InterruptIn (PinName pin) | |
Create an InterruptIn connected to the specified pin. | |
void | rise (void(*fptr)(void)) |
Attach a function to call when a rising edge occurs on the input. | |
template<typename T > | |
void | rise (T *tptr, void(T::*mptr)(void)) |
Attach a member function to call when a rising edge occurs on the input. | |
void | fall (void(*fptr)(void)) |
Attach a function to call when a falling edge occurs on the input. | |
template<typename T > | |
void | fall (T *tptr, void(T::*mptr)(void)) |
Attach a member function to call when a falling edge occurs on the input. | |
void | mode (PinMode pull) |
Set the input pin mode. |
Detailed Description
A digital interrupt input, used to call a function on a rising or falling edge.
Example:
// Flash an LED while waiting for events #include "mbed.h" InterruptIn event(p16); DigitalOut led(LED1); void trigger() { printf("triggered!\n"); } int main() { event.rise(&trigger); while(1) { led = !led; wait(0.25); } }
Definition at line 54 of file InterruptIn.h.
Constructor & Destructor Documentation
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
Member Function Documentation
void 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
void fall | ( | T * | tptr, |
void(T::*)(void) | mptr | ||
) |
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
Definition at line 101 of file InterruptIn.h.
void mode | ( | PinMode | pull ) |
Set the input pin mode.
- Parameters:
-
mode PullUp, PullDown, PullNone
void 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
void rise | ( | T * | tptr, |
void(T::*)(void) | mptr | ||
) |
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
Definition at line 84 of file InterruptIn.h.
Generated on Tue Jul 12 2022 21:08:34 by 1.7.2