Skip to main content

DeviceStatus

Struct DeviceStatus 

Source
pub struct DeviceStatus(/* private fields */);
Expand description

Status register for DS2484 The read-only Status register is the general means for the DS2484 to report bit-type data from the 1-Wire side, 1-Wire busy status, and its own reset status to the host processor (Table 3). All 1-Wire communication commands and the Device Reset command position the read pointer at the Status register for the host processor to read with minimal protocol overhead. Status information is updated during the execution of certain commands only. Bit details are given in the following descriptions.

Implementations§

Source§

impl DeviceStatus

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: u8) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> u8

Convert into bits.

Source

pub const fn logic_level(&self) -> bool

The LL bit reports the logic state of the active 1-Wire line without initiating any 1-Wire communication. The 1-Wire line is sampled for this purpose every time the Status register is read. The sampling and updating of the LL bit takes place when the host processor has addressed the DS2484 in read mode (during the acknowledge cycle), provided that the read pointer is positioned at the Status register.

Bits: 3..4

Source

pub const fn device_reset(&self) -> bool

If the RST bit is 1, the DS2484 has performed an internal reset cycle, either caused by a power-on reset or from executing the Device Reset command. The RST bit is cleared automatically when the DS2484 executes a Write Device Configuration command to restore the selection of the desired 1-Wire features.

Bits: 4..5

Trait Implementations§

Source§

impl Clone for DeviceStatus

Source§

fn clone(&self) -> DeviceStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeviceStatus

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<DeviceStatus> for u8

Source§

fn from(v: DeviceStatus) -> u8

Converts to this type from the input type.
Source§

impl From<u8> for DeviceStatus

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl Interact for DeviceStatus

Source§

fn read<I: I2c<SevenBitAddress>, D>( &mut self, dev: &mut Ds2484<I, D>, ) -> Result<(), Ds2484Error<I::Error>>

Read the register value from the DS2484.
Source§

fn write<I: I2c<SevenBitAddress>, D>( &mut self, _dev: &mut Ds2484<I, D>, ) -> Result<(), Ds2484Error<I::Error>>

Write the register value to the DS2484.
Source§

impl InteractAsync for DeviceStatus

Source§

async fn async_read<I: I2cAsync<SevenBitAddressAsync>, D>( &mut self, dev: &mut Ds2484<I, D>, ) -> Result<(), Ds2484Error<I::Error>>

Read the register value from the DS2484 asynchronously.
Source§

async fn async_write<I: I2cAsync<SevenBitAddressAsync>, D>( &mut self, _dev: &mut Ds2484<I, D>, ) -> Result<(), Ds2484Error<I::Error>>

Write the register value to the DS2484 asynchronously.
Source§

impl OneWireStatus for DeviceStatus

Source§

fn presence(&self) -> bool

Returns true if a device is present on the bus, false otherwise.
Source§

fn shortcircuit(&self) -> bool

Returns true if a short circuit is detected on the bus, false otherwise.
Source§

fn logic_level(&self) -> Option<bool>

Returns the logic state of the active 1-Wire line without initiating any 1-Wire communication.
Source§

impl Copy for DeviceStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.