STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
WInterrupts.cpp File Reference

External interrupt functions: attachInterrupt() and detachInterrupt(). More...

#include "Arduino.h"
#include "PinAF_STM32F1.h"
#include "interrupt.h"

Functions

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.
 

Detailed Description

External interrupt functions: attachInterrupt() and detachInterrupt().

Function Documentation

◆ 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
pinThe pin to attach the interrupt to.
callbackFunction called when the interrupt fires. It takes no arguments.
modeTrigger 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
interruptNumberPin to attach the interrupt to.
callbackFunction called when the interrupt fires.
modeTrigger mode: CHANGE, RISING, FALLING, LOW or HIGH.

◆ detachInterrupt()

void detachInterrupt ( pin_size_t  interruptNumber)

Disable the external interrupt attached to a pin.

Parameters
interruptNumberPin whose interrupt is disabled.