Struct esp32c3_hal::twai::TwaiConfiguration
source · 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,
impl<'d, T> TwaiConfiguration<'d, T>where T: Instance,
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,
sourcepub fn set_filter(&mut self, filter: impl Filter)
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.
sourcepub fn set_error_warning_limit(&mut self, limit: u8)
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).
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more