[][src]Trait kernel::hil::uart::ReceiveAdvanced

pub trait ReceiveAdvanced<'a>: Receive<'a> {
    fn receive_automatic(
        &self,
        rx_buffer: &'static mut [u8],
        rx_len: usize,
        interbyte_timeout: u8
    ) -> (ReturnCode, Option<&'static mut [u8]>); }

Trait that isn't required for basic UART operation, but provides useful abstractions that capsules may want to be able to leverage.

The interfaces are included here because some hardware platforms may be able to directly implement them, while others platforms may need to emulate them in software. The ones that can implement them in hardware should be able to leverage that efficiency, and by placing the interfaces here in the HIL they can do that.

Other interface ideas that have been discussed, but are not included due to the lack of a clear use case, but are noted here in case they might help someone in the future:

Required methods

fn receive_automatic(
    &self,
    rx_buffer: &'static mut [u8],
    rx_len: usize,
    interbyte_timeout: u8
) -> (ReturnCode, Option<&'static mut [u8]>)

Receive data until interbyte_timeout bit periods have passed since the last byte or buffer is full. Does not timeout until at least one byte has been received.

  • interbyte_timeout: number of bit periods since last data received.
Loading content...

Implementors

Loading content...