Skip to content

Commit

Permalink
Add support for specifying the ECC address
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed May 16, 2021
1 parent 261c41e commit 0a75eca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ecc508.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-include_lib("public_key/include/public_key.hrl").

%% API exports
-export([start_link/0, start_link/1, stop/1,
-export([start_link/0, start_link/1, start_link/2, stop/1,
wake/1, idle/1, sleep/1, reset/1,
serial_num/1,
lock/2, lock/3,
Expand Down Expand Up @@ -66,6 +66,12 @@ start_link() ->
start_link(DevName) ->
i2c:start_link(DevName, 16#60, ?CMDGRP_COUNT_MAX).

%% @doc Start and link the ecc process with a given devname i2c bus, a
%% given address and the default max count.
- spec start_link(string(), number()) -> {ok, pid()} | {error, term()}.
start_link(DevName, Address) ->
i2c:start_link(DevName, Address, ?CMDGRP_COUNT_MAX).

%% @doc Stops the given ecc process.
stop(Pid) ->
i2c:stop(Pid).
Expand Down

0 comments on commit 0a75eca

Please sign in to comment.