embassy-stm32

Crates

git

Versions

stm32u595aj

Flavors

embassy_stm32::can::config

Struct FdCanConfig

Source
pub struct FdCanConfig {
    pub nbtr: NominalBitTiming,
    pub dbtr: DataBitTiming,
    pub automatic_retransmit: bool,
    pub transmit_pause: bool,
    pub frame_transmit: FrameTransmissionConfig,
    pub non_iso_mode: bool,
    pub edge_filtering: bool,
    pub protocol_exception_handling: bool,
    pub clock_divider: ClockDivider,
    pub timestamp_source: TimestampSource,
    pub global_filter: GlobalFilter,
    pub tx_buffer_mode: TxBufferMode,
}
Expand description

FdCan Config Struct

Fields§

§nbtr: NominalBitTiming

Nominal Bit Timings

§dbtr: DataBitTiming

(Variable) Data Bit Timings

§automatic_retransmit: bool

Enables or disables automatic retransmission of messages

If this is enabled, the CAN peripheral will automatically try to retransmit each frame util it can be sent. Otherwise, it will try only once to send each frame.

Automatic retransmission is enabled by default.

§transmit_pause: bool

Enabled or disables the pausing between transmissions

This feature looses up burst transmissions coming from a single node and it protects against “babbling idiot” scenarios where the application program erroneously requests too many transmissions.

§frame_transmit: FrameTransmissionConfig

Enabled or disables the pausing between transmissions

This feature looses up burst transmissions coming from a single node and it protects against “babbling idiot” scenarios where the application program erroneously requests too many transmissions.

§non_iso_mode: bool

Non Isoe Mode If this is set, the FDCAN uses the CAN FD frame format as specified by the Bosch CAN FD Specification V1.0.

§edge_filtering: bool

Edge Filtering: Two consecutive dominant tq required to detect an edge for hard synchronization

§protocol_exception_handling: bool

Enables protocol exception handling

§clock_divider: ClockDivider

Sets the general clock divider for this FdCAN instance

§timestamp_source: TimestampSource

Sets the timestamp source

§global_filter: GlobalFilter

Configures the Global Filter

§tx_buffer_mode: TxBufferMode

TX buffer mode (FIFO or priority queue)

Implementations§

Source§

impl FdCanConfig

Source

pub const fn set_nominal_bit_timing(self, btr: NominalBitTiming) -> Self

Configures the bit timings.

Source

pub const fn set_data_bit_timing(self, btr: DataBitTiming) -> Self

Configures the bit timings.

Source

pub const fn set_automatic_retransmit(self, enabled: bool) -> Self

Enables or disables automatic retransmission of messages

If this is enabled, the CAN peripheral will automatically try to retransmit each frame util it can be sent. Otherwise, it will try only once to send each frame.

Automatic retransmission is enabled by default.

Source

pub const fn set_transmit_pause(self, enabled: bool) -> Self

Enabled or disables the pausing between transmissions

This feature looses up burst transmissions coming from a single node and it protects against “babbling idiot” scenarios where the application program erroneously requests too many transmissions.

Source

pub const fn set_non_iso_mode(self, enabled: bool) -> Self

If this is set, the FDCAN uses the CAN FD frame format as specified by the Bosch CAN FD Specification V1.0.

Source

pub const fn set_edge_filtering(self, enabled: bool) -> Self

Two consecutive dominant tq required to detect an edge for hard synchronization

Source

pub const fn set_frame_transmit(self, fts: FrameTransmissionConfig) -> Self

Sets the allowed transmission types for messages.

Source

pub const fn set_protocol_exception_handling(self, peh: bool) -> Self

Enables protocol exception handling

Source

pub const fn set_clock_divider(self, div: ClockDivider) -> Self

Sets the general clock divider for this FdCAN instance

Source

pub const fn set_timestamp_source(self, tss: TimestampSource) -> Self

Sets the timestamp source

Source

pub const fn set_global_filter(self, filter: GlobalFilter) -> Self

Sets the global filter settings

Source

pub const fn set_tx_buffer_mode(self, txbm: TxBufferMode) -> Self

Sets the TX buffer mode (FIFO or priority queue)

Trait Implementations§

Source§

impl Clone for FdCanConfig

Source§

fn clone(&self) -> FdCanConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FdCanConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FdCanConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for FdCanConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.