Struct SpiConsoleDevice

Source
pub struct SpiConsoleDevice<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> SpiConsoleDevice<'a>

Source

pub fn new( spi: &'a dyn Target, device_tx_ready_pin: Option<&'a Rc<dyn GpioPin>>, ) -> Result<Self>

Trait Implementations§

Source§

impl<'a> ConsoleDevice for SpiConsoleDevice<'a>

Source§

fn poll_read(&self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>>

Reads received data into buf, returning the number of bytes read. Read more
Source§

fn write(&self, buf: &[u8]) -> Result<()>

Writes data from buf to the UART.

Auto Trait Implementations§

§

impl<'a> !Freeze for SpiConsoleDevice<'a>

§

impl<'a> !RefUnwindSafe for SpiConsoleDevice<'a>

§

impl<'a> !Send for SpiConsoleDevice<'a>

§

impl<'a> !Sync for SpiConsoleDevice<'a>

§

impl<'a> Unpin for SpiConsoleDevice<'a>

§

impl<'a> !UnwindSafe for SpiConsoleDevice<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ConsoleExt for T
where T: ConsoleDevice + ?Sized,

Source§

fn read(&self, buf: &mut [u8]) -> Result<usize, Error>

Reads UART receive data into buf, returning the number of bytes read. This function is blocking.
Source§

fn read_timeout( &self, buf: &mut [u8], timeout: Duration, ) -> Result<usize, Error>

Reads UART receive data into buf, returning the number of bytes read. The timeout may be used to specify a duration to wait for data. If timeout expires without any data arriving Ok(0) will be returned, never Err(_).
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V