View Source stk500 (stk500 v0.2.2)
Link to this section Summary
Functions
Read a hex file generated by the Arduino IDE
Load the hex file
Connect to the Arduino using the default serial device at 19200 baud
Connect to the Arduino using the specified serial device at 19200 baud
Connect to the Arduino using the specified serial device and settings
Reset the Arduino
Try to discover the serial device
Get version
Link to this section Functions
-spec dtrrts(serctl:fd(), 0 | 1 | boolean()) -> ok.
-spec hex_file(file:name_all()) -> [byte()].
Read a hex file generated by the Arduino IDE
hex_file/1 returns a list of binaries as read from the % file (16 bytes). It's faster to use 128 bytes chunks.-spec hex_file(intel, file:name_all()) -> ok.
-spec load(serctl:fd(), [byte()]) -> ok.
-spec load(serctl:fd(), [byte()], proplists:proplist()) -> ok.
-spec open() -> {ok, serctl:fd()} | {error, file:posix()}.
-spec open(serctl:dev()) -> {ok, serctl:fd()} | {error, file:posix()}.
-spec open(serctl:dev(), proplists:proplist()) -> {ok, serctl:fd()} | {error, file:posix()}.
Connect to the Arduino using the specified serial device and settings
% The Diecimila uses 19200
{ok,FD} = stk500:open("/dev/ttyUSB0", [{speed, 19200}]).
-spec reset(serctl:fd()) -> ok.
Try to discover the serial device
Lookup the serial device in an environment variable: STK500_SERIAL_PORT
Defaults to: /dev/ttyUSB0-spec sync(serctl:fd()) -> ok | {error, file:posix()}.
-spec version(serctl:fd()) -> {byte(), byte()}.