[11U68]fix P0_11 to use GPIO
Fork of mbed-src 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. | |
void | enable_irq () |
Enable IRQ. | |
void | disable_irq () |
Disable IRQ. |
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 53 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
Definition at line 22 of file InterruptIn.cpp.
Member Function Documentation
void disable_irq | ( | ) |
Disable IRQ.
This method depends on hw implementation, might disable one port interrupts. For further information, check gpio_irq_disable().
Definition at line 73 of file InterruptIn.cpp.
void enable_irq | ( | ) |
Enable IRQ.
This method depends on hw implementation, might enable one port interrupts. For further information, check gpio_irq_enable().
Definition at line 69 of file InterruptIn.cpp.
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
Definition at line 51 of file InterruptIn.cpp.
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 100 of file InterruptIn.h.
void mode | ( | PinMode | pull ) |
Set the input pin mode.
- Parameters:
-
mode PullUp, PullDown, PullNone
Definition at line 38 of file InterruptIn.cpp.
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
Definition at line 42 of file InterruptIn.cpp.
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 83 of file InterruptIn.h.
Generated on Tue Jul 12 2022 21:24:12 by 1.7.2