esp_hal::twai

Struct TwaiTx

Source
pub struct TwaiTx<'d, Dm: DriverMode> { /* private fields */ }
Available on crate feature unstable only.
Expand description

Interface to the TWAI transmitter part.

Implementations§

Source§

impl TwaiTx<'_, Async>

Source

pub async fn transmit_async( &mut self, frame: &EspTwaiFrame, ) -> Result<(), EspTwaiError>

Transmits an EspTwaiFrame asynchronously over the TWAI bus.

Source§

impl<Dm> TwaiTx<'_, Dm>
where Dm: DriverMode,

Source

pub fn transmit(&mut self, frame: &EspTwaiFrame) -> Result<(), EspTwaiError>

Transmit a frame.

Because of how the TWAI registers are set up, we have to do some assembly of bytes. Note that these registers serve a filter configuration role when the device is in configuration mode so patching the svd files to improve this may be non-trivial.

ESP32C3 Reference Manual

NOTE: TODO: This may not work if using the self reception/self test functionality. See notes 1 and 2 in the “Frame Identifier” section of the reference manual.

Auto Trait Implementations§

§

impl<'d, Dm> Freeze for TwaiTx<'d, Dm>

§

impl<'d, Dm> RefUnwindSafe for TwaiTx<'d, Dm>
where Dm: RefUnwindSafe,

§

impl<'d, Dm> Send for TwaiTx<'d, Dm>
where Dm: Send,

§

impl<'d, Dm> Sync for TwaiTx<'d, Dm>
where Dm: Sync,

§

impl<'d, Dm> Unpin for TwaiTx<'d, Dm>
where Dm: Unpin,

§

impl<'d, Dm> !UnwindSafe for TwaiTx<'d, Dm>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.