canadensis_serial 0.6.0

A Cyphal implementation: Cyphal/Serial transport
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Serial driver definitions

use canadensis_core::nb;
use core::fmt::Debug;

/// A driver that can send bytes
pub trait TransmitDriver {
    type Error: Debug;
    /// Attempts to send a byte without blocking
    fn send_byte(&mut self, byte: u8) -> nb::Result<(), Self::Error>;
}

/// A driver that can receive bytes
pub trait ReceiveDriver {
    type Error: Debug;
    /// Attempts to receive a byte without blocking
    fn receive_byte(&mut self) -> nb::Result<u8, Self::Error>;
}