Struct stm32_hal2::usart::Usart[][src]

pub struct Usart<U> { /* fields omitted */ }

Represents the USART peripheral, for serial communications.

Implementations

impl<U> Usart<U> where
    U: Deref<Target = RegisterBlock>, 
[src]

pub fn new<C: ClockCfg>(
    regs: U,
    device: UsartDevice,
    baud: u32,
    word_len: WordLen,
    stop_bits: StopBits,
    clocks: &C,
    rcc: &mut RCC
) -> Self
[src]

pub fn write(&mut self, data: &[u8])[src]

Transmit data, as a sequence of u8.. See L44 RM, section 38.5.2: “Character transmission procedure”

pub fn read(&mut self, buf: &mut [u8])[src]

Receive data into a u8 buffer. See L44 RM, section 38.5.3: “Character reception procedure”

pub fn enable_interrupt(&mut self, interrupt_type: UsartInterrupt)[src]

Enable a specific type of interrupt.

pub fn clear_interrupt(&mut self, interrupt_type: UsartInterrupt)[src]

Clears the interrupt pending flag for a specific type of interrupt.

Auto Trait Implementations

impl<U> Send for Usart<U> where
    U: Send

impl<U> Sync for Usart<U> where
    U: Sync

impl<U> Unpin for Usart<U> where
    U: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.