This repo contains the libraries of Mbed for LPC1549 with following changes: - IAP commands. - EEPROM write and read. - UART write and read (public) - CAN can_s -> LPC_C_CAN0_Type *can
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
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().
void enable_irq | ( | ) |
Enable IRQ.
This method depends on hw implementation, might enable one port interrupts. For further information, check gpio_irq_enable().
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 100 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 83 of file InterruptIn.h.
Generated on Wed Jul 13 2022 17:09:46 by 1.7.2