Expand description
§embedded-onewire
A no-std trait description of the 1-Wire protocol.
This crate provides a trait-based interface for 1-Wire communication, allowing you to implement the protocol on various platforms.
OneWire trait defines the basic operations required for 1-Wire communication, such as resetting the bus, writing and reading bytes, and writing and reading bits.
It also includes an asynchronous version of the trait, OneWireAsync, for use in async environments.
The crate also provides a search algorithm for discovering devices on the 1-Wire bus, implemented in the OneWireSearch and OneWireSearchAsync structs.
§Features
crc-table: Enables the use of a 256-byte lookup table for CRC calculation, which can improve performance at the cost of increased binary size.triplet-read: Enables theread_triplettrait method inOneWireandOneWireAsync. 1-Wire bus masters, e.g. the Analog Devices DS2484, implements this function to simplify the device enumeration algorithm. However, the current implementation of the search algorithm with the DS2484 device does not enumerate the devices correctly, so this feature is not recommended for use.
Structs§
- OneWire
Crc - Calculate CRC-8 used in 1-Wire communications.
- OneWire
Search - A structure for searching devices on a 1-Wire bus. This structure implements the search algorithm for discovering devices on the 1-Wire bus. It maintains the state of the search.
- OneWire
Search Async - A structure for asynchronous searching of devices on a 1-Wire bus. This structure implements the search algorithm for discovering devices on the 1-Wire bus. It maintains the state of the search.
Enums§
- OneWire
Error - One wire communication error type.
- OneWire
Search Kind - Type of search performed using
OneWireSearchorOneWireSearchAsync.
Constants§
- ONEWIRE_
CONDITIONAL_ SEARCH_ CMD - Command to search for devices in alarm state on the 1-Wire bus
- ONEWIRE_
MATCH_ ROM_ CMD - Command to match a specific ROM address in 1-Wire communication (non-overdrive mode)
- ONEWIRE_
MATCH_ ROM_ CMD_ OD - The Overdrive-Match ROM command followed by a 64-bit ROM sequence transmitted at overdrive speed allows the bus master to address a specific DS28EA00 on a multidrop bus and to simultaneously set it in over-drive mode. Only the DS28EA00 that exactly matches the 64-bit ROM sequence responds to the subsequent control function command. Slaves already in overdrive mode from a previous Overdrive-Skip ROM or successful Overdrive-Match ROM command remain in overdrive mode. All over-drivecapable slaves return to standard speed at the next reset pulse of minimum 480μs duration. The Overdrive-Match ROM command can be used with a single device or mul- tiple devices on the bus.
- ONEWIRE_
SEARCH_ CMD - Command to search for devices on the 1-Wire bus
- ONEWIRE_
SKIP_ ROM_ CMD - Command to skip ROM address in 1-Wire communication (non-overdrive mode)
- ONEWIRE_
SKIP_ ROM_ CMD_ OD - On a single-drop bus this command can save time by allowing the bus master to access the control functions without providing the 64-bit ROM code. Unlike the normal Skip ROM command, the Overdrive-Skip ROM sets the DS28EA00 in the overdrive mode (OD = 1). All communication following this command has to occur at overdrive speed until a reset pulse of minimum 480μs duration resets all devices on the bus to standard speed (OD = 0).
Traits§
- OneWire
- Trait for 1-Wire communication. This trait defines the basic operations required for 1-Wire communication, such as resetting the bus, writing and reading bytes, and writing and reading bits.
- OneWire
Async - Trait for 1-Wire communication. This trait defines the basic operations required for 1-Wire communication, such as resetting the bus, writing and reading bytes, and writing and reading bits.
- OneWire
Status - Trait describing the status of a 1-Wire bus. This trait is used to encapsulate the status of the bus after a reset operation.
Type Aliases§
- OneWire
Result - Error type for 1-Wire operations.