2 unstable releases
new 0.2.0 | Mar 7, 2025 |
---|---|
0.1.0 | Mar 6, 2025 |
#775 in Embedded development
60 downloads per month
34KB
626 lines
OneCable
onecable
implements (parts of) the 1-Wire protocol,
with a specific focus on the DS18B20
temperature sensor.
onecable
is no-std
, enabling it to run on any hardware for which the
embedded_hal traits are implemented.
1-Wire
For further information on the 1-Wire protocol, look at the Book of iButton® Standards. For additional information on the DS18B20 sensor, have a look at its datasheet.
License
see LICENSE
lib.rs
:
OneCable
onecable
is an implementation of the 1-Wire protocol,
and is currently focussed of supporting the DS18B20
temperature sensor.
How to use?
First, create a OneWire instance with OneWire::new
,
then you can discover the ROM codes of the connected devices with e.g. OneWire::search_rom_iter
.
If you have only one device connected to the OneWire bus, you can also use
OneWire::read_rom
to read the ROM code of that device.
Once you have a valid ROM code, you can convert it to a DS18B20 sensor instance with
ds18b20::DS18B20::try_from
.
Dependencies
~4MB
~78K SLoC