Struct aw_soc::uart::Serial

source ·
pub struct Serial<A: BaseAddress, const I: usize, PINS: Pins<I>> { /* private fields */ }
Expand description

Managed serial structure with peripheral and pins.

Implementations§

source§

impl<A: BaseAddress, const I: usize, PINS: Pins<I>> Serial<A, I, PINS>

source

pub fn new<A1: BaseAddress>( uart: UART<A>, pins: PINS, config: impl Into<Config>, clocks: &Clocks, ccu: &CCU<A1> ) -> Self

Create a serial instance.

source

pub fn free<A1: BaseAddress>(self, ccu: &CCU<A1>) -> (UART<A>, PINS)

Close uart and release peripheral.

Trait Implementations§

source§

impl<A: BaseAddress, const I: usize, PINS: Pins<I>> ErrorType for Serial<A, I, PINS>

§

type Error = ErrorKind

Error type
source§

impl<A: BaseAddress, const I: usize, PINS: Pins<I>> Write<u8> for Serial<A, I, PINS>

source§

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

Writes a slice, blocking until everything has been written Read more
source§

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

Block until the serial interface has sent all buffered words
source§

impl<A: BaseAddress, const I: usize, PINS: Pins<I>> Write<u8> for Serial<A, I, PINS>

source§

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

Writes a single word to the serial interface
source§

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

Ensures that none of the previously written words are still buffered

Auto Trait Implementations§

§

impl<A, const I: usize, PINS> RefUnwindSafe for Serial<A, I, PINS>where A: RefUnwindSafe, PINS: RefUnwindSafe,

§

impl<A, const I: usize, PINS> Send for Serial<A, I, PINS>where PINS: Send,

§

impl<A, const I: usize, PINS> Sync for Serial<A, I, PINS>where A: Sync, PINS: Sync,

§

impl<A, const I: usize, PINS> Unpin for Serial<A, I, PINS>where A: Unpin, PINS: Unpin,

§

impl<A, const I: usize, PINS> UnwindSafe for Serial<A, I, PINS>where A: UnwindSafe, PINS: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.