Struct bxcan::Tx

source ·
pub struct Tx<I> { /* private fields */ }
Expand description

Interface to the CAN transmitter part.

Implementations§

source§

impl<I> Tx<I>
where I: Instance,

source

pub fn transmit(&mut self, frame: &Frame) -> Result<TransmitStatus, Infallible>

Puts a CAN frame in a transmit mailbox for transmission on the bus.

Frames are transmitted to the bus based on their priority (see FramePriority). Transmit order is preserved for frames with identical priority.

If all transmit mailboxes are full, and frame has a higher priority than the lowest-priority message in the transmit mailboxes, transmission of the enqueued frame is cancelled and frame is enqueued instead. The frame that was replaced is returned as TransmitStatus::dequeued_frame.

source

pub fn abort(&mut self, mailbox: Mailbox) -> bool

Attempts to abort the sending of a frame that is pending in a mailbox.

If there is no frame in the provided mailbox, or its transmission succeeds before it can be aborted, this function has no effect and returns false.

If there is a frame in the provided mailbox, and it is canceled successfully, this function returns true.

source

pub fn is_idle(&self) -> bool

Returns true if no frame is pending for transmission.

source

pub fn clear_interrupt_flags(&mut self)

Clears the request complete flag for all mailboxes.

Auto Trait Implementations§

§

impl<I> Freeze for Tx<I>

§

impl<I> RefUnwindSafe for Tx<I>
where I: RefUnwindSafe,

§

impl<I> Send for Tx<I>
where I: Send,

§

impl<I> Sync for Tx<I>
where I: Sync,

§

impl<I> Unpin for Tx<I>
where I: Unpin,

§

impl<I> UnwindSafe for Tx<I>
where I: UnwindSafe,

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.