Interrupts
Z-Uno uses hardware interrupts of Z-Wave chip as well as software generated interrupts provide users simple experience. Currently Z-Uno supports the following interrupts:- INT0 (pin 17)
- INT1 (pin 18)
- ZEROX (pin 3)
- GPT (General Purpose Timer)
- 1 milliseconds software timer
ZUNO_SETUP_ISR_*(my_handler_func)
macro, where my_handler_func is the name of the handler function.
The code in the user interrupt handler function should be as fast as possible and should not contain ANY function calls except few listed below. Also don't use local variables — use global variables instead!
Function allowed in interrupt handler | Limitations |
---|---|
digitalRead(pin) | pin: a constant or variable of type s_pin |
digitalWrite(pin, value) | pin: a constant or variable of type s_pin |
digitalToggle(pin) | pin: a constant or variable of type s_pin |
pinMode(pin, mode) | pin: a constant or variable of type s_pin |
zunoExtIntMode(int_num, mode) | constant int_num and mode |
zunoGPTEnable(mode) | mode: a constant |
zunoGPTSet(value) | - |
zunoFastPWMEnable(mode) | mode: a constant |
zunoFastPWMSet(a, b) | - |
millis() | (starting from 2.1.5) |
Interrupt name | Description | Macro |
---|---|---|
INT0 rise/fall/change | Rise, fall or change of voltage on INT0 pin (pin 17) | ZUNO_SETUP_ISR_INT0(my_handler_func) |
INT1 rise/fall/change | Rise, fall or change of voltage on INT1 pin (pin 18) | ZUNO_SETUP_ISR_INT1(my_handler_func) |
ZEROX rise/fall/change | Rise, fall or change of voltage on ZEROX pin (pin 3) | ZUNO_SETUP_ISR_ZEROX(my_handler_func) |
GPT | General purpose timer reached zero | ZUNO_SETUP_ISR_GPTIMER(my_handler_func) |
1 millisecond tick | Executed every 1 millisecond | ZUNO_SETUP_ISR_1MSTIMER(my_handler_func) |