pub struct BufferedCanRx<'d, const RX_BUF_SIZE: usize> { /* private fields */ }
Expand description
CAN driver, receive half in Buffered mode.
Implementations§
Source§impl<'d, const RX_BUF_SIZE: usize> BufferedCanRx<'d, RX_BUF_SIZE>
impl<'d, const RX_BUF_SIZE: usize> BufferedCanRx<'d, RX_BUF_SIZE>
Sourcepub fn try_read(&mut self) -> Result<Envelope, TryReadError>
pub fn try_read(&mut self) -> Result<Envelope, TryReadError>
Attempts to read a CAN frame without blocking.
Returns [Err(TryReadError::Empty)] if there are no frames in the rx queue.
Sourcepub async fn wait_not_empty(&mut self)
pub async fn wait_not_empty(&mut self)
Waits while receive queue is empty.
Sourcepub fn reader(&self) -> BufferedCanReceiver
pub fn reader(&self) -> BufferedCanReceiver
Returns a receiver that can be used for receiving CAN frames. Note, each CAN frame will only be received by one receiver.
Trait Implementations§
Auto Trait Implementations§
impl<'d, const RX_BUF_SIZE: usize> Freeze for BufferedCanRx<'d, RX_BUF_SIZE>
impl<'d, const RX_BUF_SIZE: usize> !RefUnwindSafe for BufferedCanRx<'d, RX_BUF_SIZE>
impl<'d, const RX_BUF_SIZE: usize> !Send for BufferedCanRx<'d, RX_BUF_SIZE>
impl<'d, const RX_BUF_SIZE: usize> !Sync for BufferedCanRx<'d, RX_BUF_SIZE>
impl<'d, const RX_BUF_SIZE: usize> Unpin for BufferedCanRx<'d, RX_BUF_SIZE>
impl<'d, const RX_BUF_SIZE: usize> !UnwindSafe for BufferedCanRx<'d, RX_BUF_SIZE>
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