Struct embassy_stm32::can::CanTx
source · pub struct CanTx<'d, T: Instance> { /* private fields */ }
Expand description
CAN driver, transmit half.
Implementations§
source§impl<'d, T: Instance> CanTx<'d, T>
impl<'d, T: Instance> CanTx<'d, T>
sourcepub async fn write(&mut self, frame: &Frame) -> TransmitStatus
pub async fn write(&mut self, frame: &Frame) -> TransmitStatus
Queues the message to be sent.
If the TX queue is full, this will wait until there is space, therefore exerting backpressure.
sourcepub fn try_write(
&mut self,
frame: &Frame
) -> Result<TransmitStatus, TryWriteError>
pub fn try_write( &mut self, frame: &Frame ) -> Result<TransmitStatus, TryWriteError>
Attempts to transmit a frame without blocking.
Returns [Err(TryWriteError::Full)] if all transmit mailboxes are full.
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 buffered<const TX_BUF_SIZE: usize>(
self,
txb: &'static mut TxBuf<TX_BUF_SIZE>
) -> BufferedCanTx<'d, T, TX_BUF_SIZE>
pub fn buffered<const TX_BUF_SIZE: usize>( self, txb: &'static mut TxBuf<TX_BUF_SIZE> ) -> BufferedCanTx<'d, T, TX_BUF_SIZE>
Return a buffered instance of driver. User must supply Buffers
Auto Trait Implementations§
impl<'d, T> Freeze for CanTx<'d, T>where
T: Freeze,
impl<'d, T> RefUnwindSafe for CanTx<'d, T>where
T: RefUnwindSafe,
impl<'d, T> Send for CanTx<'d, T>where
T: Send,
impl<'d, T> Sync for CanTx<'d, T>where
T: Sync,
impl<'d, T> Unpin for CanTx<'d, T>where
T: Unpin,
impl<'d, T> !UnwindSafe for CanTx<'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