External interrupt functions: attachInterrupt() and detachInterrupt().
More...
#include "Arduino.h"
#include "PinAF_STM32F1.h"
#include "interrupt.h"
|
| void | attachInterrupt (pin_size_t interruptNumber, callback_function_t callback, PinStatus mode) |
| | Attach a callback function to an external interrupt on a pin.
|
| |
| void | attachInterrupt (pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode) |
| | Attach a function to an external interrupt on a pin, using a plain function pointer.
|
| |
| void | detachInterrupt (pin_size_t interruptNumber) |
| | Disable the external interrupt attached to a pin.
|
| |
External interrupt functions: attachInterrupt() and detachInterrupt().
◆ attachInterrupt() [1/2]
| void attachInterrupt |
( |
pin_size_t |
pin, |
|
|
callback_function_t |
callback, |
|
|
PinStatus |
mode |
|
) |
| |
Attach a callback function to an external interrupt on a pin.
- Note
- LOW and HIGH level triggers are only available on series supporting level interrupts, otherwise they fall back to FALLING and RISING respectively.
- Parameters
-
| pin | The pin to attach the interrupt to. |
| callback | Function called when the interrupt fires. It takes no arguments. |
| mode | Trigger mode: CHANGE, RISING, FALLING, LOW or HIGH. |
◆ attachInterrupt() [2/2]
| void attachInterrupt |
( |
pin_size_t |
interruptNumber, |
|
|
voidFuncPtr |
callback, |
|
|
PinStatus |
mode |
|
) |
| |
Attach a function to an external interrupt on a pin, using a plain function pointer.
- Parameters
-
| interruptNumber | Pin to attach the interrupt to. |
| callback | Function called when the interrupt fires. |
| mode | Trigger mode: CHANGE, RISING, FALLING, LOW or HIGH. |
◆ detachInterrupt()
| void detachInterrupt |
( |
pin_size_t |
interruptNumber | ) |
|
Disable the external interrupt attached to a pin.
- Parameters
-
| interruptNumber | Pin whose interrupt is disabled. |