lin_bus/
driver.rs

1//! Trait for a hardware driver to implement
2pub use crate::Error;
3use crate::PID;
4
5pub trait Master {
6    type Error: Into<crate::Error> + From<crate::Error>;
7    fn send_wakeup(&mut self) -> Result<(), Self::Error>;
8    fn send_header(&mut self, pid: PID) -> Result<(), Self::Error>;
9    fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>;
10    fn write(&mut self, data: &[u8]) -> Result<(), Self::Error>;
11}