Provides interrupt functions.
More...
|
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...
|
|
Provides interrupt functions.
◆ cli
#define cli |
( |
| ) |
noInterrupts() |
◆ digitalPinToInterrupt
◆ sei
#define sei |
( |
| ) |
interrupts() |
◆ InterruptCallback
typedef void(* InterruptCallback) () |
◆ InterruptDelegate
◆ attachInterrupt() [1/4]
Attach a function to a GPIO interrupt.
- Parameters
-
pin | GPIO to configure |
callback | Function to call when interrupt occurs on GPIO |
type | Interrupt type |
- Note
- Traditional c-type callback function method
◆ attachInterrupt() [2/4]
Attach a function to a GPIO interrupt.
- Parameters
-
pin | GPIO to configure |
callback | Function to call when interrupt occurs on GPIO |
mode | Arduino 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]
Attach a function to a GPIO interrupt.
- Parameters
-
pin | GPIO to configure |
delegateFunction | Function to call when interrupt occurs on GPIO |
type | Interrupt 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
-
pin | GPIO to configure |
delegateFunction | Function to call when interrupt occurs on GPIO |
mode | Arduino 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()
Enable interrupts on GPIO pin.
- Parameters
-
pin | GPIO to enable interrupts for |
type | Interrupt type |
- Note
- Configure interrupt handler with attachInterrupt(pin, callback, type)
◆ ConvertArduinoInterruptMode()
Convert Arduino interrupt mode to Sming mode.
- Parameters
-
- Return values
-
GPIO_INT_TYPE | Sming interrupt type |
◆ detachInterrupt()
void detachInterrupt |
( |
uint8_t |
pin | ) |
|
Disable interrupts on GPIO pin.
- Parameters
-
pin | GPIO to disable interrupts for |
◆ interruptMode() [1/2]
Set interrupt mode.
- Parameters
-
pin | GPIO to configure |
type | Interrupt 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
-
pin | GPIO to configure |
mode | Interrupt mode |
- Note
- Use ConvertArduinoInterruptMode to get Sming interrupt type from an Arduino interrupt type
◆ ESP_MAX_INTERRUPTS
constexpr unsigned ESP_MAX_INTERRUPTS = 16 |