embassy-stm32

Crates

git

Versions

stm32h757ai-cm4

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.