pub struct Can<'d, T: Instance, M: Mode> { /* private fields */ }Implementations§
Source§impl<'d, T: Instance> Can<'d, T, Async>
impl<'d, T: Instance> Can<'d, T, Async>
pub fn new_async<const REMAP: u8>( peri: Peri<'d, T>, rx: Peri<'d, impl RxPin<T, REMAP>>, tx: Peri<'d, impl TxPin<T, REMAP>>, _irq: impl Binding<T::ReceiveInterrupt, ReceiveInterruptHandler<T>> + Binding<T::TransmitInterrupt, TransmitInterruptHandler<T>> + 'd, fifo: CanFifo, mode: CanMode, bitrate: u32, config: Config, ) -> Result<Self, CanInitError>
pub async fn receive(&self) -> Result<CanFrame, CanError>
pub async fn transmit(&mut self, frame: &CanFrame) -> Result<(), CanError>
Source§impl<'d, T: Instance> Can<'d, T, NonBlocking>
impl<'d, T: Instance> Can<'d, T, NonBlocking>
Source§impl<'d, T: Instance, M: Mode> Can<'d, T, M>
impl<'d, T: Instance, M: Mode> Can<'d, T, M>
Sourcepub fn add_filter<BIT: BitMode, MODE: FilterMode>(
&self,
filter: CanFilter<BIT, MODE>,
)
pub fn add_filter<BIT: BitMode, MODE: FilterMode>( &self, filter: CanFilter<BIT, MODE>, )
Each filter bank consists of 2 32-bit registers CAN_FxR0 and CAN_FxR1
Sourcepub fn transmit_status(&self) -> TxStatus
pub fn transmit_status(&self) -> TxStatus
Retrieves status of the last frame transmission
Trait Implementations§
Source§impl<'d, T> Can for Can<'d, T, NonBlocking>where
T: Instance,
These trait methods are only usable within the embedded_can context.
Under normal use of the Can instance,
impl<'d, T> Can for Can<'d, T, NonBlocking>where
T: Instance,
These trait methods are only usable within the embedded_can context. Under normal use of the Can instance,
Source§fn transmit(
&mut self,
frame: &Self::Frame,
) -> Result<Option<Self::Frame>, Self::Error>
fn transmit( &mut self, frame: &Self::Frame, ) -> Result<Option<Self::Frame>, Self::Error>
Puts a frame in the transmit buffer to be sent on the bus.
If the transmit buffer is full, this function will try to replace a pending
lower priority frame and return the frame that was replaced.
Returns Err(WouldBlock) if the transmit buffer is full and no frame can be
replaced.