kernel::hil::can

Trait StandardBitTiming

Source
pub trait StandardBitTiming {
    // Required method
    fn bit_timing_for_bitrate(
        clock_rate: u32,
        bitrate: u32,
    ) -> Result<BitTiming, ErrorCode>;
}
Expand description

The StandardBitTiming trait is used to calculate the optimum timing parameters for a given bitrate and the clock’s frequency.

Required Methods§

Source

fn bit_timing_for_bitrate( clock_rate: u32, bitrate: u32, ) -> Result<BitTiming, ErrorCode>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Configure> StandardBitTiming for T

The default implementation for the bit_timing_for_bitrate method. This algorithm is inspired by the Zephyr CAN driver available at <https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers/can>