Skip to content

Commit 260efb1

Browse files
committed
Update gpio doc references to use port
Updates doc section pid references to use port, which were not updated when the gpio() type was updted to use port(). Signed-off-by: Winford <[email protected]>
1 parent a91348b commit 260efb1

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

libs/eavmlib/src/gpio.erl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
]).
5959

6060
-type gpio() :: port().
61-
%% This is the pid returned by `gpio:start/0'.
61+
%% This is the port returned by `gpio:start/0'.
6262
-type pin() :: non_neg_integer() | pin_tuple().
6363
%% The pin definition for ESP32 and PR2040 is a non-negative integer. A tuple is used on the STM32 platform and for the extra "WL" pins on the Pico-W.
6464
-type pin_tuple() :: {gpio_bank(), 0..15}.
@@ -82,13 +82,13 @@
8282
%% Event type that will trigger a `gpio_interrupt'. STM32 only supports `rising', `falling', or `both'.
8383

8484
%%-----------------------------------------------------------------------------
85-
%% @returns Pid | error | {error, Reason}
85+
%% @returns Port | error | {error, Reason}
8686
%% @doc Start the GPIO driver port
8787
%%
88-
%% Returns the pid of the active GPIO port driver, otherwise the GPIO
88+
%% Returns the port of the active GPIO port driver, otherwise the GPIO
8989
%% port driver will be stared and registered as `gpio'. The use of
9090
%% `gpio:open/0' or `gpio:start/0' is required before using any functions
91-
%% that require a GPIO pid as a parameter.
91+
%% that require a GPIO port as a parameter.
9292
%%
9393
%% Not currently available on rp2040 (Pico) port, use nif functions.
9494
%% @end
@@ -103,14 +103,14 @@ start() ->
103103
end.
104104

105105
%%-----------------------------------------------------------------------------
106-
%% @returns Pid | error | {error, Reason}
106+
%% @returns Port | error | {error, Reason}
107107
%% @doc Start the GPIO driver port
108108
%%
109109
%% The GPIO port driver will be stared and registered as `gpio'. If the
110110
%% port has already been started through the `gpio:open/0' or
111111
%% `gpio:start/0' the command will fail. The use of `gpio:open/0' or
112112
%% `gpio:start/0' is required before using any functions that require a
113-
%% GPIO pid as a parameter.
113+
%% GPIO port as a parameter.
114114
%%
115115
%% Not currently available on rp2040 (Pico) port, use nif functions.
116116
%% @end
@@ -120,7 +120,7 @@ open() ->
120120
open_port({spawn, "gpio"}, []).
121121

122122
%%-----------------------------------------------------------------------------
123-
%% @param GPIO pid that was returned from gpio:start/0
123+
%% @param GPIO port that was returned from gpio:start/0
124124
%% @returns ok | error | {error, Reason}
125125
%% @doc Stop the GPIO interrupt port
126126
%%
@@ -154,7 +154,7 @@ stop() ->
154154
end.
155155

156156
%%-----------------------------------------------------------------------------
157-
%% @param GPIO pid that was returned from gpio:start/0
157+
%% @param GPIO port that was returned from gpio:start/0
158158
%% @param Pin number of the pin to read
159159
%% @returns high | low | error | {error, Reason}
160160
%% @doc Read the digital state of a GPIO pin
@@ -171,7 +171,7 @@ read(GPIO, Pin) ->
171171
port:call(GPIO, {read, Pin}).
172172

173173
%%-----------------------------------------------------------------------------
174-
%% @param GPIO pid that was returned from `gpio:start/0'
174+
%% @param GPIO port that was returned from `gpio:start/0'
175175
%% @param Pin number of the pin to configure
176176
%% @param Direction is `input', `output', or `output_od'
177177
%% @returns ok | error | {error, Reason}
@@ -201,7 +201,7 @@ set_direction(GPIO, Pin, Direction) ->
201201
port:call(GPIO, {set_direction, Pin, Direction}).
202202

203203
%%-----------------------------------------------------------------------------
204-
%% @param GPIO pid that was returned from `gpio:start/0'
204+
%% @param GPIO port that was returned from `gpio:start/0'
205205
%% @param Pin number of the pin to write
206206
%% @param Level the desired output level to set
207207
%% @returns ok | error | {error, Reason}
@@ -235,7 +235,7 @@ set_level(GPIO, Pin, Level) ->
235235
port:call(GPIO, {set_level, Pin, Level}).
236236

237237
%%-----------------------------------------------------------------------------
238-
%% @param GPIO pid that was returned from `gpio:start/0'
238+
%% @param GPIO port that was returned from `gpio:start/0'
239239
%% @param Pin number of the pin to set the interrupt on
240240
%% @param Trigger is the state that will trigger an interrupt
241241
%% @returns ok | error | {error, Reason}
@@ -258,7 +258,7 @@ set_int(GPIO, Pin, Trigger) ->
258258
port:call(GPIO, {set_int, Pin, Trigger}).
259259

260260
%%-----------------------------------------------------------------------------
261-
%% @param GPIO pid that was returned from `gpio:start/0'
261+
%% @param GPIO port that was returned from `gpio:start/0'
262262
%% @param Pin number of the pin to set the interrupt on
263263
%% @param Trigger is the state that will trigger an interrupt
264264
%% @param Pid is the process that will receive the interrupt message
@@ -283,7 +283,7 @@ set_int(GPIO, Pin, Trigger, Pid) ->
283283
port:call(GPIO, {set_int, Pin, Trigger, Pid}).
284284

285285
%%-----------------------------------------------------------------------------
286-
%% @param GPIO pid that was returned from `gpio:start/0'
286+
%% @param GPIO port that was returned from `gpio:start/0'
287287
%% @param Pin number of the pin to remove the interrupt
288288
%% @returns ok | error | {error, Reason}
289289
%% @doc Remove a GPIO interrupt

0 commit comments

Comments
 (0)