pub struct TwaiConfiguration<'d, T> { /* private fields */ }
Expand description

An inactive TWAI peripheral in the “Reset”/configuration state.

Implementations§

source§

impl<'d, T> TwaiConfiguration<'d, T>
where T: Instance,

source

pub fn new<TX, RX>( peripheral: impl Peripheral<P = T> + 'd, tx_pin: impl Peripheral<P = TX> + 'd, rx_pin: impl Peripheral<P = RX> + 'd, clocks: &Clocks<'_>, baud_rate: BaudRate ) -> TwaiConfiguration<'d, T>
where TX: OutputPin, RX: InputPin,

source

pub fn set_filter(&mut self, filter: impl Filter)

Set up the acceptance filter on the device.

NOTE: On a bus with mixed 11-bit and 29-bit packet id’s, you may experience an 11-bit filter match against a 29-bit frame and vice versa. Your application should check the id again once a frame has been received to make sure it is the expected value.

ESP32C3 Reference Manual

source

pub fn set_error_warning_limit(&mut self, limit: u8)

Set the error warning threshold.

In the case when any of an error counter value exceeds the threshold, or all the error counter values are below the threshold, an error warning interrupt will be triggered (given the enable signal is valid).

source

pub fn start(self) -> Twai<'d, T>

Put the peripheral into Operation Mode, allowing the transmission and reception of packets using the new object.

Auto Trait Implementations§

§

impl<'d, T> RefUnwindSafe for TwaiConfiguration<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> Send for TwaiConfiguration<'d, T>
where T: Send,

§

impl<'d, T> Sync for TwaiConfiguration<'d, T>
where T: Sync,

§

impl<'d, T> Unpin for TwaiConfiguration<'d, T>
where T: Unpin,

§

impl<'d, T> !UnwindSafe for TwaiConfiguration<'d, T>

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> 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>,

§

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>,

§

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.