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)   ( (p) < ESP_MAX_INTERRUPTS ? (p) : -1 )
 
#define cli()   noInterrupts()
 
#define sei()   interrupts()
 

Typedefs

typedef void(* InterruptCallback) (void)
 

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.
 
void interrupts ()
 Enable interrupts.
 

Variables

InterruptCallback _gpioInterruptsList [ESP_MAX_INTERRUPTS]
 
bool _gpioInterruptsInitialied
 

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
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
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