embassy-stm32

Crates

git

Versions

stm32f750v8

Flavors

๐Ÿ“ฃ We want to hear from you! Fill the Rust Embedded 2024 micro-survey.

Struct embassy_stm32::can::CanTx

source ยท
pub struct CanTx<'d> { /* private fields */ }
Expand description

CAN driver, transmit half.

Implementationsยง

sourceยง

impl<'d> CanTx<'d>

source

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.

source

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

Attempts to transmit a frame without blocking.

Returns [Err(TryWriteError::Full)] if the frame can not be queued for transmission now.

If FIFO scheduling is enabled, any empty mailbox will be used.

Otherwise, the frame will only be accepted if there is no frame with the same priority already queued. This is done to work around a hardware limitation that could lead to out-of-order delivery of frames with the same priority.

source

pub async fn flush(&self, mb: Mailbox)

Waits for a specific transmit mailbox to become empty

source

pub async fn flush_any(&self)

Waits until any of the transmit mailboxes become empty

Note that Self::try_write() may fail with TryWriteError::Full, even after the future returned by this function completes. This will happen if FIFO scheduling of outgoing frames is not enabled, and a frame with equal priority is already queued for transmission.

source

pub async fn flush_all(&self)

Waits until all of the transmit mailboxes become empty

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 buffered<const TX_BUF_SIZE: usize>( self, txb: &'static mut TxBuf<TX_BUF_SIZE>, ) -> BufferedCanTx<'d, TX_BUF_SIZE>

Return a buffered instance of driver. User must supply Buffers

Auto Trait Implementationsยง

ยง

impl<'d> Freeze for CanTx<'d>

ยง

impl<'d> !RefUnwindSafe for CanTx<'d>

ยง

impl<'d> !Send for CanTx<'d>

ยง

impl<'d> !Sync for CanTx<'d>

ยง

impl<'d> Unpin for CanTx<'d>

ยง

impl<'d> !UnwindSafe for CanTx<'d>

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>,

sourceยง

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>,

sourceยง

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.