Struct can_bit_timings_core::CanBitTiming[][src]

pub struct CanBitTiming {
    pub bs1: u8,
    pub bs2: u8,
    pub sjw: u8,
    pub prescaler: u16,
}

This struct holds parts of bit timing for CAN. Field descriptions quote descriptions from this site.

Fields

bs1: u8

bs1 = PROP_SEG + PHASE_SEG1

PROP_SEG is programmable to be 1, 2,... 8 Time Quanta long. It is used to compensate for signal delays across the network.

PHASE_SEG1 is programmable to be 1,2, ... 8 Time Quanta long. It is used to compensate for edge phase errors and may be lengthened during resynchronization.

bs2: u8

bs2 = PHASE_SEG2 (Seg 2) is the maximum of PHASE_SEG1 and the Information Processing Time long. It is also used to compensate edge phase errors and may be shortened during resynchronization. For this the minimum value of PHASE_SEG2 is the value of SJW. Information Processing Time is less than or equal to 2 Time Quanta long.

sjw: u8

Synchronization Jump Width

prescaler: u16

Prescaler value

Implementations

impl CanBitTiming[src]

pub fn bxcan(&self) -> u32[src]

Converts CanBitTiming struct to a u32 register as used by bxcan module.

pub fn total_time_quanta(&self) -> u16[src]

Outputs total time quanta used to clock a CAN bus module

Trait Implementations

impl Clone for CanBitTiming[src]

impl Copy for CanBitTiming[src]

impl Debug for CanBitTiming[src]

impl PartialEq<CanBitTiming> for CanBitTiming[src]

impl PartialOrd<CanBitTiming> for CanBitTiming[src]

impl StructuralPartialEq for CanBitTiming[src]

Auto Trait Implementations

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.