pub struct Timing {
pub baud_rate_prescaler: u8,
pub propagation_segment: u8,
pub phase_segment_1: u8,
pub phase_segment_2: u8,
pub sync_jump_width: u8,
}Available on crate feature
unstable only.Expand description
Bit timing parameters for one phase (nominal or data).
Fields§
§baud_rate_prescaler: u8Bit rate prescaler. Divides the function clock to produce the time quantum.
propagation_segment: u8Propagation segment, in time quanta.
phase_segment_1: u8Phase segment 1, in time quanta.
phase_segment_2: u8Phase segment 2, in time quanta.
sync_jump_width: u8Synchronization jump width, in time quanta.
Implementations§
Source§impl Timing
impl Timing
Sourcepub const fn is_valid(&self, limits: &TimingLimits) -> bool
pub const fn is_valid(&self, limits: &TimingLimits) -> bool
Returns whether every parameter fits the given limits.
Also checks the two constraints of TRM 38.3.7.7, which are expressed in system clock periods and therefore include the prescaler.
Sourcepub const fn total_quanta(&self) -> u32
pub const fn total_quanta(&self) -> u32
Returns the total bit time in time quanta, including the sync segment.
Sourcepub const fn bit_rate(&self, clock_hz: u32) -> u32
pub const fn bit_rate(&self, clock_hz: u32) -> u32
Returns the bit rate in bits per second for a given function clock.
Sourcepub const fn sample_point_permille(&self) -> u32
pub const fn sample_point_permille(&self) -> u32
Returns the sample point in per mille of the bit time.
Trait Implementations§
impl Copy for Timing
impl Eq for Timing
impl StructuralPartialEq for Timing
Auto Trait Implementations§
impl Freeze for Timing
impl RefUnwindSafe for Timing
impl Send for Timing
impl Sync for Timing
impl Unpin for Timing
impl UnsafeUnpin for Timing
impl UnwindSafe for Timing
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)