pub struct Timestamp(_);
Expand description
A timestamp produced by the PTP periperhal
Implementations§
source§impl Timestamp
impl Timestamp
sourcepub const fn new(negative: bool, seconds: u32, subseconds: Subseconds) -> Self
pub const fn new(negative: bool, seconds: u32, subseconds: Subseconds) -> Self
Create a new Timestamp
sourcepub const fn is_negative(&self) -> bool
pub const fn is_negative(&self) -> bool
Check whether this timestamp is negative or not.
sourcepub const fn is_positive(&self) -> bool
pub const fn is_positive(&self) -> bool
Check whether this timestamp is positive or not.
sourcepub const fn subseconds(&self) -> Subseconds
pub const fn subseconds(&self) -> Subseconds
Get the raw subsecond value of this timestamp.
sourcepub const fn subseconds_signed(&self) -> u32
pub const fn subseconds_signed(&self) -> u32
Get the signed subsecond value of this timestamp.
Note that this is not an i32: it is, technically, a u31 with a leading sign bit.
sourcepub const fn from_parts(high: u32, low: u32) -> Timestamp
pub const fn from_parts(high: u32, low: u32) -> Timestamp
Create a new timestamp from the provided register values.
sourcepub fn from_descriptor(desc: &Descriptor) -> Option<Self>
pub fn from_descriptor(desc: &Descriptor) -> Option<Self>
Create a timestamp from the given descriptor
Trait Implementations§
source§impl AddAssign<Timestamp> for Timestamp
impl AddAssign<Timestamp> for Timestamp
source§fn add_assign(&mut self, rhs: Timestamp)
fn add_assign(&mut self, rhs: Timestamp)
Performs the
+=
operation. Read moresource§impl PartialEq<Timestamp> for Timestamp
impl PartialEq<Timestamp> for Timestamp
source§impl SubAssign<Timestamp> for Timestamp
impl SubAssign<Timestamp> for Timestamp
source§fn sub_assign(&mut self, rhs: Timestamp)
fn sub_assign(&mut self, rhs: Timestamp)
Performs the
-=
operation. Read more