pub struct CanBitTiming {
pub bs1: u8,
pub bs2: u8,
pub sjw: u8,
pub prescaler: u16,
}
Expand description
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§
Source§impl CanBitTiming
impl CanBitTiming
Sourcepub fn bxcan(&self) -> u32
pub fn bxcan(&self) -> u32
Converts CanBitTiming struct to a u32
register
as used by bxcan module.
Sourcepub fn total_time_quanta(&self) -> u16
pub fn total_time_quanta(&self) -> u16
Outputs total time quanta used to clock a CAN bus module
Trait Implementations§
Source§impl Clone for CanBitTiming
impl Clone for CanBitTiming
Source§fn clone(&self) -> CanBitTiming
fn clone(&self) -> CanBitTiming
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more