You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/gpio.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,17 +67,18 @@ Read digital GPIO pin value.
67
67
Establish or clear a callback function to run on interrupt for a GPIO.
68
68
69
69
#### Syntax
70
-
`gpio.trig(pin, type [, callback])`
70
+
`gpio.trig(pin [, type [, callback]])`
71
71
72
72
#### Parameters
73
73
-`pin`, see [GPIO Overview](#gpio-overview)
74
74
-`type` trigger type, one of
75
+
-`gpio.INTR_DISABLE` or `nil` to disable interrupts on this pin (in which case `callback` is ignored and should be `nil` or omitted)
75
76
-`gpio.INTR_UP` for trigger on rising edge
76
77
-`gpio.INTR_DOWN` for trigger on falling edge
77
78
-`gpio.INTR_UP_DOWN` for trigger on both edges
78
79
-`gpio.INTR_LOW` for trigger on low level
79
80
-`gpio.INTR_HIGH` for trigger on high level
80
-
-`callback` optional function to be called when trigger fires, trigger is disabled when omitted. Parameters are:
81
+
-`callback` optional function to be called when trigger fires. If `nil` or omitted (and `type`is not `gpio.INTR_DISABLE`) then any previously-set callback will continue to be used. Parameters are:
0 commit comments