pub struct Can<'d> { /* private fields */ }
Expand description
FDCAN Instance
Implementations§
source§impl<'d> Can<'d>
impl<'d> Can<'d>
sourcepub fn properties(&self) -> &Properties
pub fn properties(&self) -> &Properties
Get driver properties
sourcepub async fn write(&mut self, frame: &Frame) -> Option<Frame>
pub async fn write(&mut self, frame: &Frame) -> Option<Frame>
Queues the message to be sent but exerts backpressure. If a lower-priority frame is dropped from the mailbox, it is returned. If no lower-priority frames can be replaced, this call asynchronously waits for a frame to be successfully transmitted, then tries again.
sourcepub async fn read(&mut self) -> Result<Envelope, BusError>
pub async fn read(&mut self) -> Result<Envelope, BusError>
Returns the next received message frame
sourcepub async fn write_fd(&mut self, frame: &FdFrame) -> Option<FdFrame>
pub async fn write_fd(&mut self, frame: &FdFrame) -> Option<FdFrame>
Queues the message to be sent but exerts backpressure. If a lower-priority frame is dropped from the mailbox, it is returned. If no lower-priority frames can be replaced, this call asynchronously waits for a frame to be successfully transmitted, then tries again.
sourcepub async fn read_fd(&mut self) -> Result<FdEnvelope, BusError>
pub async fn read_fd(&mut self) -> Result<FdEnvelope, BusError>
Returns the next received message frame
sourcepub fn split(self) -> (CanTx<'d>, CanRx<'d>, Properties)
pub fn split(self) -> (CanTx<'d>, CanRx<'d>, Properties)
Split instance into separate portions: Tx(write), Rx(read), common properties
sourcepub fn buffered<const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize>(
self,
tx_buf: &'static mut TxBuf<TX_BUF_SIZE>,
rxb: &'static mut RxBuf<RX_BUF_SIZE>,
) -> BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
pub fn buffered<const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize>( self, tx_buf: &'static mut TxBuf<TX_BUF_SIZE>, rxb: &'static mut RxBuf<RX_BUF_SIZE>, ) -> BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
Return a buffered instance of driver without CAN FD support. User must supply Buffers
sourcepub fn buffered_fd<const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize>(
self,
tx_buf: &'static mut TxFdBuf<TX_BUF_SIZE>,
rxb: &'static mut RxFdBuf<RX_BUF_SIZE>,
) -> BufferedCanFd<'d, TX_BUF_SIZE, RX_BUF_SIZE>
pub fn buffered_fd<const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize>( self, tx_buf: &'static mut TxFdBuf<TX_BUF_SIZE>, rxb: &'static mut RxFdBuf<RX_BUF_SIZE>, ) -> BufferedCanFd<'d, TX_BUF_SIZE, RX_BUF_SIZE>
Return a buffered instance of driver with CAN FD support. User must supply Buffers