pub struct BxCanDriver<C, N>where
    C: Clock,
    N: Instance,{ /* private fields */ }
Expand description

A CAN driver that wraps a bxCAN device and keeps track of deadlines for queued frames

Implementations§

source§

impl<C, N> BxCanDriver<C, N>where C: Clock, N: Instance,

source

pub fn new(can: Can<N>) -> Self

Creates a CAN driver

source

pub fn into_can(self) -> Can<N>

Consumes this driver and returns its CAN object

source

pub fn can(&self) -> &Can<N>

Returns a reference to the CAN driver

source

pub fn can_mut(&mut self) -> &mut Can<N>

Returns a mutable reference to the CAN driver

source

pub fn loopback_frame_waiting(&self) -> bool

Returns true if at least one loopback frame is ready to receive

Trait Implementations§

source§

impl<C, N> ReceiveDriver<C> for BxCanDriver<C, N>where C: Clock, N: Instance + FilterOwner,

§

type Error = OverrunError

This matches the error type defined in bxcan

source§

fn receive(&mut self, clock: &mut C) -> Result<Frame<C::Instant>, Self::Error>

Tries to receive a frame from the frame receive queue or the loopback frame queue

If both loopback and non-loopback frames are waiting, this function returns a non-loopback frame.

source§

fn apply_filters<S>(&mut self, local_node: Option<CanNodeId>, subscriptions: S)where S: IntoIterator<Item = Subscription>,

Sets up frame reception filters to accept only frames matching the provided subscriptions Read more
source§

fn apply_accept_all(&mut self)

Sets up frame reception filters to accept all incoming frames
source§

impl<C, N> TransmitDriver<C> for BxCanDriver<C, N>where C: Clock, N: Instance,

§

type Error = Infallible

The error type
source§

fn try_reserve(&mut self, frames: usize) -> Result<(), OutOfMemoryError>

Attempts to reserve space to transmit frames additional frames Read more
source§

fn transmit( &mut self, frame: Frame<C::Instant>, clock: &mut C ) -> Result<Option<Frame<C::Instant>>, Self::Error>

Attempts to send a frame without blocking Read more
source§

fn flush(&mut self, _clock: &mut C) -> Result<(), Self::Error>

Attempts to flush all frames out of any in-memory queues that may exist and transmit them

Auto Trait Implementations§

§

impl<C, N> RefUnwindSafe for BxCanDriver<C, N>where N: RefUnwindSafe, <C as Clock>::Instant: RefUnwindSafe,

§

impl<C, N> Send for BxCanDriver<C, N>where N: Send, <C as Clock>::Instant: Send,

§

impl<C, N> Sync for BxCanDriver<C, N>where N: Sync, <C as Clock>::Instant: Sync,

§

impl<C, N> Unpin for BxCanDriver<C, N>where N: Unpin, <C as Clock>::Instant: Unpin,

§

impl<C, N> UnwindSafe for BxCanDriver<C, N>where N: UnwindSafe, <C as Clock>::Instant: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.