Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
Interrupt functions

Provides interrupt functions. More...

Macros

#define ESP_MAX_INTERRUPTS   16
 
#define digitalPinToInterrupt(pin)   ((pin) < ESP_MAX_INTERRUPTS ? (pin) : -1)
 
#define cli()   noInterrupts()
 
#define sei()   interrupts()
 

Typedefs

typedef void(* InterruptCallback) (void)
 
typedef Delegate< void()> InterruptDelegate
 

Functions

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

Detailed Description

Provides interrupt functions.

Function Documentation

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.
void attachInterrupt ( uint8_t  pin,
Delegate< void()>  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
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.
void attachInterrupt ( uint8_t  pin,
InterruptCallback  callback,
GPIO_INT_TYPE  mode 
)

Attach a function to a GPIO interrupt.

Parameters
pinGPIO to configure
callbackFunction to call when interrupt occurs on GPIO
modeInterrupt mode
Note
Traditional c-type callback function method
Todo:
Add GPIO_INT_TYPE documentation - is this in SDK?
void attachInterrupt ( uint8_t  pin,
Delegate< void()>  delegateFunction,
GPIO_INT_TYPE  mode 
)

Attach a function to a GPIO interrupt.

Parameters
pinGPIO to configure
delegateFunctionFunction to call when interrupt occurs on GPIO
modeInterrupt mode
Note
Delegate function method
void attachInterruptHandler ( uint8_t  pin,
GPIO_INT_TYPE  mode 
)

Enable interrupts on GPIO pin.

Parameters
pinGPIO to enable interrupts for
modeInterrupt mode
Note
Configure interrupt handler with attachInterrupt(pin, callback, mode)
GPIO_INT_TYPE ConvertArduinoInterruptMode ( uint8_t  mode)

Convert Arduino interrupt mode to Sming mode.

Parameters
modeArduino mode type
Return values
GPIO_INT_TYPESming interrupt mode type
void detachInterrupt ( uint8_t  pin)

Disable interrupts on GPIO pin.

Parameters
pinGPIO to disable interrupts for
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
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
void interrupts ( )

Enable interrupts.

void noInterrupts ( )

Disable interrupts.