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
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,30 @@ Read digital GPIO pin value.
63
63
0 = low, 1 = high
64
64
65
65
66
+
## gpio.set_drive()
67
+
Set the drive strength of a given GPIO pin. The higher the drive strength, the more current can be sourced/sunk from the pin. The exact maximum depends on the power domain of the pin and how much current other pins in that domain are consuming.
68
+
69
+
#### Syntax
70
+
`gpio.set_drive(pin, strength)`
71
+
72
+
#### Parameters
73
+
-`pin`, a valid GPIO pin number.
74
+
-`strength` the drive strength to set, one of
75
+
-`gpio.DRIVE_0` weakest drive strength
76
+
-`gpio.DRIVE_1` stronger drive strength
77
+
-`gpio.DRIVE_2` default drive strength
78
+
-`gpio.DRIVE_DEFAULT` default drive strength (same as `DRIVE_2`)
79
+
-`gpio.DRIVE_3` maximum drive strength
80
+
81
+
#### Returns
82
+
`nil`
83
+
84
+
#### Example
85
+
```lua
86
+
gpio.set_drive(4, gpio.DRIVE_3)
87
+
```
88
+
89
+
66
90
## gpio.trig()
67
91
Establish or clear a callback function to run on interrupt for a GPIO.
0 commit comments