Struct bxcan::CanConfig[][src]

pub struct CanConfig<'a, I: Instance> { /* fields omitted */ }
Expand description

Configuration proxy to be used with Can::configure().

Implementations

impl<I: Instance> CanConfig<'_, I>[src]

pub fn set_bit_timing(&mut self, btr: u32) -> &mut Self[src]

Configures the bit timings.

You can use http://www.bittiming.can-wiki.info/ to calculate the btr parameter. Enter parameters as follows:

  • Clock Rate: The input clock speed to the CAN peripheral (not the CPU clock speed). This is the clock rate of the peripheral bus the CAN peripheral is attached to (eg. APB1).
  • Sample Point: Should normally be left at the default value of 87.5%.
  • SJW: Should normally be left at the default value of 1.

Then copy the CAN_BUS_TIME register value from the table and pass it as the btr parameter to this method.

pub fn set_loopback(&mut self, enabled: bool) -> &mut Self[src]

Enables or disables loopback mode: Internally connects the TX and RX signals together.

pub fn set_silent(&mut self, enabled: bool) -> &mut Self[src]

Enables or disables silent mode: Disconnects the TX signal from the pin.

Trait Implementations

impl<I: Instance> Drop for CanConfig<'_, I>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'a, I> Send for CanConfig<'a, I> where
    I: Send

impl<'a, I> Sync for CanConfig<'a, I> where
    I: Sync

impl<'a, I> Unpin for CanConfig<'a, I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.