Struct canadensis_bxcan::pnp::BxCanPnpClient
source · [−]pub struct BxCanPnpClient<C: Clock, M, I: Instance + FilterOwner> {
pub client: PnpClient<C, M, CanTransmitter<C::Instant, SingleQueueDriver<SingleFrameQueue<C::Instant>, BxCanDriver<C::Instant, I>>>, CanReceiver<C::Instant, SingleQueueDriver<SingleFrameQueue<C::Instant>, BxCanDriver<C::Instant, I>>>>,
/* private fields */
}
Expand description
A plug-and-play node ID assignment client that uses a bxCAN peripheral
Fields
client: PnpClient<C, M, CanTransmitter<C::Instant, SingleQueueDriver<SingleFrameQueue<C::Instant>, BxCanDriver<C::Instant, I>>>, CanReceiver<C::Instant, SingleQueueDriver<SingleFrameQueue<C::Instant>, BxCanDriver<C::Instant, I>>>>
The node ID allocation client
Implementations
sourceimpl<C, M, I> BxCanPnpClient<C, M, I> where
C: Clock,
M: AllocationMessage<CanTransport>,
I: Instance + FilterOwner,
impl<C, M, I> BxCanPnpClient<C, M, I> where
C: Clock,
M: AllocationMessage<CanTransport>,
I: Instance + FilterOwner,
sourcepub fn new(
clock: C,
can: Can<I>,
unique_id: [u8; 16]
) -> Result<Self, Error<()>>
pub fn new(
clock: C,
can: Can<I>,
unique_id: [u8; 16]
) -> Result<Self, Error<()>>
Creates a node ID allocation client
sourcepub fn publish_request(&mut self)
pub fn publish_request(&mut self)
Publishes an ID allocation request, sending it onto the CAN bus
This function returns an error if no transmit mailbox was available for the frame.
sourcepub fn handle_incoming_frames(&mut self, now: C::Instant) -> Option<CanNodeId>
pub fn handle_incoming_frames(&mut self, now: C::Instant) -> Option<CanNodeId>
Handles and parses incoming CAN frames, and returns a node ID if one was received
Auto Trait Implementations
impl<C, M, I> RefUnwindSafe for BxCanPnpClient<C, M, I> where
C: RefUnwindSafe,
I: RefUnwindSafe,
M: RefUnwindSafe,
<<C as Clock>::Instant as Instant>::Duration: RefUnwindSafe,
<C as Clock>::Instant: RefUnwindSafe,
impl<C, M, I> Send for BxCanPnpClient<C, M, I> where
C: Send,
I: Send,
M: Send,
<<C as Clock>::Instant as Instant>::Duration: Send,
<C as Clock>::Instant: Send,
impl<C, M, I> Sync for BxCanPnpClient<C, M, I> where
C: Sync,
I: Sync,
M: Sync,
<<C as Clock>::Instant as Instant>::Duration: Sync,
<C as Clock>::Instant: Sync,
impl<C, M, I> Unpin for BxCanPnpClient<C, M, I> where
C: Unpin,
I: Unpin,
M: Unpin,
<<C as Clock>::Instant as Instant>::Duration: Unpin,
<C as Clock>::Instant: Unpin,
impl<C, M, I> UnwindSafe for BxCanPnpClient<C, M, I> where
C: UnwindSafe,
I: UnwindSafe,
M: UnwindSafe,
<<C as Clock>::Instant as Instant>::Duration: UnwindSafe,
<C as Clock>::Instant: 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