1 unstable release
Uses old Rust 2015
0.1.0 | Jun 26, 2018 |
---|
#71 in #hid
9KB
107 lines
Hardkernel ODROID Smart Power - Rust Implementation
This Rust crate provides an interface for managing an ODROID Smart Power device. It is roughly based on the hosp C library.
Dependencies
You need an ODROID Smart Power device with a USB connection.
You will also need the hidapi library.
On Ubuntu 14.04 LTS and newer, just install libhidapi-dev
.
We use the hidapi-rs crate.
Usage
Add hosp
as a dependency in Cargo.toml
:
[dependencies]
hosp = "0.1"
Project Source
Find this and related project sources at the energymon organization on GitHub.
This project originates at: https://github.com/energymon/hosp-rs
Bug reports and pull requests for bug fixes and enhancements are welcome.
lib.rs
:
This crate provides an API for managing an ODROID Smart Power over USB.
Usage
This crate is on crates.io and can be
used by adding hosp
to the dependencies in your project's Cargo.toml
.
[dependencies]
hosp = "0.1"
Getter functions return Result
errors when I/O fails.
Assuming no I/O errors, an Option
type is returned from getter functions.
None
is a normal return value when the device replies to a read request
without providing any real data.
Users implement their own retry policy waiting for a Some
return value.
ODROID Smart Power devices normally refresh at 10 Hz.
Dependencies
~470KB
~10K SLoC