embedded_hal::blocking::can

Trait Can

Source
pub trait Can {
    type Frame: Frame;
    type Error: Error;

    // Required methods
    fn transmit(&mut self, frame: &Self::Frame) -> Result<(), Self::Error>;
    fn receive(&mut self) -> Result<Self::Frame, Self::Error>;
}
Expand description

A blocking CAN interface that is able to transmit and receive frames.

Required Associated Types§

Source

type Frame: Frame

Associated frame type.

Source

type Error: Error

Associated error type.

Required Methods§

Source

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

Puts a frame in the transmit buffer. Blocks until space is available in the transmit buffer.

Source

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

Blocks until a frame was received or an error occured.

Implementors§