pub struct Tx<I> { /* private fields */ }
Expand description
Interface to the CAN transmitter part.
Implementations§
source§impl<I> Tx<I>where
I: Instance,
impl<I> Tx<I>where
I: Instance,
sourcepub fn transmit(&mut self, frame: &Frame) -> Result<TransmitStatus, Infallible>
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
.
sourcepub fn abort(&mut self, mailbox: Mailbox) -> bool
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
.
sourcepub fn clear_interrupt_flags(&mut self)
pub fn clear_interrupt_flags(&mut self)
Clears the request complete flag for all mailboxes.