Interrupt functions

Provides interrupt functions. More...

Macros

#define cli()   noInterrupts()
 
#define sei()   interrupts()
 

Typedefs

using InterruptCallback = void(*)()
 
using InterruptDelegate = Delegate< void()>
 

Functions

GPIO_INT_TYPE ConvertArduinoInterruptMode (uint8_t mode)
 Convert Arduino interrupt mode to Sming mode. More...
 
void attachInterrupt (uint8_t pin, InterruptCallback callback, GPIO_INT_TYPE type)
 Attach a function to a GPIO interrupt. More...
 
void attachInterrupt (uint8_t pin, InterruptCallback callback, uint8_t mode)
 Attach a function to a GPIO interrupt. More...
 
void attachInterrupt (uint8_t pin, InterruptDelegate delegateFunction, GPIO_INT_TYPE type)
 Attach a function to a GPIO interrupt. More...
 
void attachInterrupt (uint8_t pin, InterruptDelegate delegateFunction, uint8_t mode)
 Attach a function to a GPIO interrupt. More...
 
void attachInterruptHandler (uint8_t pin, GPIO_INT_TYPE type)
 Enable interrupts on GPIO pin. More...
 
void detachInterrupt (uint8_t pin)
 Disable interrupts on GPIO pin. More...
 
void interruptMode (uint8_t pin, GPIO_INT_TYPE type)
 Set interrupt mode. More...
 
void interruptMode (uint8_t pin, uint8_t mode)
 Set interrupt mode. More...
 

Detailed Description

Provides interrupt functions.

Macro Definition Documentation

◆ cli

#define cli ( )    noInterrupts()

◆ sei

#define sei ( )    interrupts()

Typedef Documentation

◆ InterruptCallback

using InterruptCallback = void (*)()

◆ InterruptDelegate

using InterruptDelegate = Delegate<void()>

Function Documentation

◆ attachInterrupt() [1/4]

void attachInterrupt ( uint8_t  pin,
InterruptCallback  callback,
GPIO_INT_TYPE  type 
)

Attach a function to a GPIO interrupt.

Parameters
pinGPIO to configure
callbackFunction to call when interrupt occurs on GPIO
typeInterrupt type
Note
Traditional c-type callback function method

◆ attachInterrupt() [2/4]

void attachInterrupt ( uint8_t  pin,
InterruptCallback  callback,
uint8_t  mode 
)

Attach a function to a GPIO interrupt.

Parameters
pinGPIO to configure
callbackFunction to call when interrupt occurs on GPIO
modeArduino type interrupt mode
Note
Traditional c-type callback function method, MUST use IRAM_ATTR Use this type of interrupt handler for timing-sensitive applications.

◆ attachInterrupt() [3/4]

void attachInterrupt ( uint8_t  pin,
InterruptDelegate  delegateFunction,
GPIO_INT_TYPE  type 
)

Attach a function to a GPIO interrupt.

Parameters
pinGPIO to configure
delegateFunctionFunction to call when interrupt occurs on GPIO
typeInterrupt type
Note
Delegate function method

◆ attachInterrupt() [4/4]

void attachInterrupt ( uint8_t  pin,
InterruptDelegate  delegateFunction,
uint8_t  mode 
)

Attach a function to a GPIO interrupt.

Parameters
pinGPIO to configure
delegateFunctionFunction to call when interrupt occurs on GPIO
modeArduino type interrupt mode (LOW, HIGH, CHANGE, RISING, FALLING)
Note
Delegate function method, can be a regular function, method, etc. The delegate function is called via the system task queue so does not need any special consideration. Note that this type of interrupt handler is not suitable for timing-sensitive applications.

◆ attachInterruptHandler()

void attachInterruptHandler ( uint8_t  pin,
GPIO_INT_TYPE  type 
)

Enable interrupts on GPIO pin.

Parameters
pinGPIO to enable interrupts for
typeInterrupt type
Note
Configure interrupt handler with attachInterrupt(pin, callback, type)

◆ ConvertArduinoInterruptMode()

GPIO_INT_TYPE ConvertArduinoInterruptMode ( uint8_t  mode)

Convert Arduino interrupt mode to Sming mode.

Parameters
modeArduino mode type
Return values
GPIO_INT_TYPESming interrupt type

◆ detachInterrupt()

void detachInterrupt ( uint8_t  pin)

Disable interrupts on GPIO pin.

Parameters
pinGPIO to disable interrupts for

◆ interruptMode() [1/2]

void interruptMode ( uint8_t  pin,
GPIO_INT_TYPE  type 
)

Set interrupt mode.

Parameters
pinGPIO to configure
typeInterrupt type
Note
Use ConvertArduinoInterruptMode to get Sming interrupt type from an Arduino interrupt type

◆ interruptMode() [2/2]

void interruptMode ( uint8_t  pin,
uint8_t  mode 
)

Set interrupt mode.

Parameters
pinGPIO to configure
modeInterrupt mode
Note
Use ConvertArduinoInterruptMode to get Sming interrupt type from an Arduino interrupt type