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]
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]
regs: U,
device: UsartDevice,
baud: u32,
word_len: WordLen,
stop_bits: StopBits,
clocks: &C,
rcc: &mut RCC
) -> Self
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.