Struct Serial

Source
pub struct Serial<USART, PINS> { /* private fields */ }
Expand description

Serial abstraction

Implementations§

Source§

impl<PINS> Serial<USART1, PINS>

Source

pub fn usart1( usart: USART1, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<USART1>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<USART1>, Rx<USART1>)

Source

pub fn release(self) -> (USART1, PINS)

Source§

impl<PINS> Serial<USART2, PINS>

Source

pub fn usart2( usart: USART2, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<USART2>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<USART2>, Rx<USART2>)

Source

pub fn release(self) -> (USART2, PINS)

Source§

impl<PINS> Serial<USART6, PINS>

Source

pub fn usart6( usart: USART6, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<USART6>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<USART6>, Rx<USART6>)

Source

pub fn release(self) -> (USART6, PINS)

Source§

impl<PINS> Serial<USART3, PINS>

Source

pub fn usart3( usart: USART3, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<USART3>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<USART3>, Rx<USART3>)

Source

pub fn release(self) -> (USART3, PINS)

Source§

impl<PINS> Serial<UART4, PINS>

Source

pub fn uart4( usart: UART4, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<UART4>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<UART4>, Rx<UART4>)

Source

pub fn release(self) -> (UART4, PINS)

Source§

impl<PINS> Serial<UART5, PINS>

Source

pub fn uart5( usart: UART5, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<UART5>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<UART5>, Rx<UART5>)

Source

pub fn release(self) -> (UART5, PINS)

Source§

impl<PINS> Serial<UART7, PINS>

Source

pub fn uart7( usart: UART7, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<UART7>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<UART7>, Rx<UART7>)

Source

pub fn release(self) -> (UART7, PINS)

Source§

impl<PINS> Serial<UART8, PINS>

Source

pub fn uart8( usart: UART8, pins: PINS, config: Config, clocks: Clocks, ) -> Result<Self, InvalidConfig>
where PINS: Pins<UART8>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an interrupt event

Source

pub fn unlisten(&mut self, event: Event)

Stop listening for an interrupt event

Source

pub fn is_idle(&self) -> bool

Return true if the line idle status is set

Source

pub fn is_txe(&self) -> bool

Return true if the tx register is empty (and can accept data)

Source

pub fn is_rxne(&self) -> bool

Return true if the rx register is not empty (and can be read)

Source

pub fn split(self) -> (Tx<UART8>, Rx<UART8>)

Source

pub fn release(self) -> (UART8, PINS)

Trait Implementations§

Source§

impl<PINS> Read<u8> for Serial<UART4, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<UART5, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<UART7, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<UART8, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<USART1, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<USART2, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<USART3, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Read<u8> for Serial<USART6, PINS>

Source§

type Error = Error

Read error
Source§

fn read(&mut self) -> Result<u8, Error>

Reads a single word from the serial interface
Source§

impl<PINS> Write<u8> for Serial<UART4, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<UART5, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<UART7, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<UART8, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<USART1, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<USART2, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<USART3, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

impl<PINS> Write<u8> for Serial<USART6, PINS>

Source§

type Error = Error

Write error
Source§

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

Ensures that none of the previously written words are still buffered
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface

Auto Trait Implementations§

§

impl<USART, PINS> Freeze for Serial<USART, PINS>
where USART: Freeze, PINS: Freeze,

§

impl<USART, PINS> RefUnwindSafe for Serial<USART, PINS>
where USART: RefUnwindSafe, PINS: RefUnwindSafe,

§

impl<USART, PINS> Send for Serial<USART, PINS>
where USART: Send, PINS: Send,

§

impl<USART, PINS> Sync for Serial<USART, PINS>
where USART: Sync, PINS: Sync,

§

impl<USART, PINS> Unpin for Serial<USART, PINS>
where USART: Unpin, PINS: Unpin,

§

impl<USART, PINS> UnwindSafe for Serial<USART, PINS>
where USART: UnwindSafe, PINS: UnwindSafe,

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> 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.