[][src]Struct one_wire_bus::OneWire

pub struct OneWire<T> { /* fields omitted */ }

Methods

impl<T, E> OneWire<T> where
    T: InputPin<Error = E>,
    T: OutputPin<Error = E>, 
[src]

pub fn new(pin: T) -> OneWireResult<OneWire<T>, E>[src]

pub fn into_inner(self) -> T[src]

pub fn release_bus(&mut self) -> OneWireResult<(), E>[src]

Disconnects the bus, letting another device (or the pull-up resistor) set the bus value

pub fn set_bus_low(&mut self) -> OneWireResult<(), E>[src]

Drives the bus low

pub fn is_bus_high(&self) -> OneWireResult<bool, E>[src]

pub fn is_bus_low(&self) -> OneWireResult<bool, E>[src]

pub fn reset(&mut self, delay: &mut impl DelayUs<u16>) -> OneWireResult<bool, E>[src]

Sends a reset pulse, then returns true if a device is present

pub fn read_bit(
    &mut self,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<bool, E>
[src]

pub fn read_byte(
    &mut self,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<u8, E>
[src]

pub fn read_bytes(
    &mut self,
    output: &mut [u8],
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

pub fn write_1_bit(
    &mut self,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

pub fn write_0_bit(
    &mut self,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

pub fn write_bit(
    &mut self,
    value: bool,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

pub fn write_byte(
    &mut self,
    value: u8,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

pub fn write_bytes(
    &mut self,
    bytes: &[u8],
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

pub fn match_address(
    &mut self,
    address: &Address,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

Address a specific device. All others will wait for a reset pulse. This should only be called after a reset, and should be immediately followed by another command

pub fn skip_address(
    &mut self,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

Address all devices on the bus simultaneously. This should only be called after a reset, and should be immediately followed by another command

pub fn send_command(
    &mut self,
    command: u8,
    address: Option<&Address>,
    delay: &mut impl DelayUs<u16>
) -> OneWireResult<(), E>
[src]

Sends a reset, followed with either a SKIP_ROM or MATCH_ROM (with an address), and then the supplied command This should be followed by any reading/writing, if needed by the command used

Important traits for DeviceSearch<'a, 'b, T, D>
pub fn devices<'a, 'b, D>(
    &'a mut self,
    only_alarming: bool,
    delay: &'b mut D
) -> DeviceSearch<'a, 'b, T, D> where
    D: DelayUs<u16>, 
[src]

Returns an iterator that iterates over all device addresses on the bus They can be filtered to only alarming devices if needed There is no requirement to immediately finish iterating all devices, but if devices are added / removed / change alarm state, the search may return an error or fail to find a device Device addresses will always be returned in the same order (lowest to highest, Little Endian)

Search for device addresses on the bus They can be filtered to only alarming devices if needed Start the first search with a search_state of None, then use the returned state for subsequent searches There is no time limit for continuing a search, but if devices are added / removed / change alarm state, the search may return an error or fail to find a device Device addresses will always be returned in the same order (lowest to highest, Little Endian)

Auto Trait Implementations

impl<T> Send for OneWire<T> where
    T: Send

impl<T> Sync for OneWire<T> where
    T: Sync

impl<T> Unpin for OneWire<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.