pub struct Tx<I, MODE> { /* private fields */ }Expand description
Interface to the CAN transmitter part.
Implementations
sourceimpl<I, MODE> Tx<I, MODE> where
I: Instance,
impl<I, MODE> Tx<I, MODE> where
I: Instance,
sourcepub fn transmit(
&mut self,
frame: TxFrameHeader,
buffer: &[u8]
) -> Result<Option<()>, Infallible>
pub fn transmit(
&mut self,
frame: TxFrameHeader,
buffer: &[u8]
) -> Result<Option<()>, Infallible>
Puts a CAN frame in a transmit mailbox for transmission on the bus.
Frames are transmitted to the bus based on their priority (identifier). Transmit order is preserved for frames with identical identifiers.
If all transmit mailboxes are full, a higher priority frame can replace a lower-priority frame, which is returned via the closure ‘pending’. If ‘pending’ is called; it’s return value is returned via Option
, if it is not, None is returned. If there are only higher priority frames in the queue, this returns Err::WouldBlock
sourcepub fn transmit_preserve<PTX, P>(
&mut self,
frame: TxFrameHeader,
buffer: &[u8],
pending: &mut PTX
) -> Result<Option<P>, Infallible> where
PTX: FnMut(Mailbox, TxFrameHeader, &[u32]) -> P,
pub fn transmit_preserve<PTX, P>(
&mut self,
frame: TxFrameHeader,
buffer: &[u8],
pending: &mut PTX
) -> Result<Option<P>, Infallible> where
PTX: FnMut(Mailbox, TxFrameHeader, &[u32]) -> P,
As Transmit, but if there is a pending frame, pending will be called so that the frame can
be preserved.
sourcepub fn tx_queue_is_full(&self) -> bool
pub fn tx_queue_is_full(&self) -> bool
Returns if the tx queue is able to accept new messages without having to cancel an existing one
sourcepub fn clear_transmission_completed_flag(&mut self)
pub fn clear_transmission_completed_flag(&mut self)
Clears the transmission complete flag.
sourcepub fn clear_transmission_cancelled_flag(&mut self)
pub fn clear_transmission_cancelled_flag(&mut self)
Clears the transmission cancelled flag.
Auto Trait Implementations
impl<I, MODE> RefUnwindSafe for Tx<I, MODE> where
I: RefUnwindSafe,
MODE: RefUnwindSafe,
impl<I, MODE> Send for Tx<I, MODE> where
I: Send,
MODE: Send,
impl<I, MODE> Sync for Tx<I, MODE> where
I: Sync,
MODE: Sync,
impl<I, MODE> Unpin for Tx<I, MODE> where
I: Unpin,
MODE: Unpin,
impl<I, MODE> UnwindSafe for Tx<I, MODE> where
I: UnwindSafe,
MODE: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more