RTduino Source Code Reference Manual
Macros | Functions
Interrupts

Interrupt-related functions and definitions. More...

Macros

#define LOW   0x0
 Represents a low state (0V).
 
#define HIGH   0x1
 Represents a high state (usually 3.3V or 5V).
 
#define CHANGE   0x2
 Represents a change in state.
 
#define FALLING   0x3
 Represents a transition from high to low.
 
#define RISING   0x4
 Represents a transition from low to high.
 

Functions

void interrupts (void)
 Enables interrupts, allowing the execution of interrupt service routines. More...
 
void noInterrupts (void)
 Disables interrupts, preventing the execution of interrupt service routines. More...
 
uint8_t digitalPinToInterrupt (uint8_t pin)
 Converts a digital pin number to the corresponding interrupt number. More...
 
void attachInterrupt (uint8_t interruptNum, void(*userFunc)(void), int mode)
 Attaches an interrupt service routine to a specified interrupt. More...
 
void detachInterrupt (uint8_t interruptNum)
 Detaches an interrupt service routine from a specified interrupt. More...
 

Detailed Description

Interrupt-related functions and definitions.

Function Documentation

◆ attachInterrupt()

void attachInterrupt ( uint8_t  interruptNum,
void(*)(void)  userFunc,
int  mode 
)

Attaches an interrupt service routine to a specified interrupt.

Parameters
interruptNumThe interrupt number to attach the ISR to.
userFuncThe function to call when the interrupt occurs.
modeThe type of interrupt to attach the ISR to (e.g., CHANGE, FALLING, RISING).
See also
https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt

◆ detachInterrupt()

void detachInterrupt ( uint8_t  interruptNum)

Detaches an interrupt service routine from a specified interrupt.

Parameters
interruptNumThe interrupt number to detach the ISR from.
See also
https://www.arduino.cc/reference/en/language/functions/external-interrupts/detachinterrupt

◆ digitalPinToInterrupt()

uint8_t digitalPinToInterrupt ( uint8_t  pin)

Converts a digital pin number to the corresponding interrupt number.

Parameters
pinThe digital pin number.
Returns
The corresponding interrupt number, or NOT_AN_INTERRUPT if the pin does not support interrupts.
See also
https://www.arduino.cc/reference/en/language/functions/external-interrupts/digitalpintointerrupt

◆ interrupts()

void interrupts ( void  )

Enables interrupts, allowing the execution of interrupt service routines.

See also
https://www.arduino.cc/reference/en/language/functions/interrupts/interrupts

◆ noInterrupts()

void noInterrupts ( void  )

Disables interrupts, preventing the execution of interrupt service routines.

See also
https://www.arduino.cc/reference/en/language/functions/interrupts/nointerrupts