Crate embedded_onewire

Crate embedded_onewire 

Source
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 the read_triplet trait method in OneWire and OneWireAsync. 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.

Modules§

consts
Command constants for 1-Wire communication. These constants are intended to be used by hardware that implements the 1-Wire protocol HAL (traits), e.g. the ds2484 crate.

Structs§

OneWireCrc
Calculate CRC-8 used in 1-Wire communications.
OneWireSearch
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.
OneWireSearchAsync
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§

OneWireError
One wire communication error type.
OneWireSearchKind
Type of search performed using OneWireSearch or OneWireSearchAsync.

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.
OneWireAsync
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.
OneWireStatus
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§

OneWireResult
Error type for 1-Wire operations.