USART2

Type Alias USART2 

Source
pub type USART2 = Periph<RegisterBlock, 1073759232>;
Expand description

Universal synchronous asynchronous receiver transmitter

See peripheral structure

Aliased Type§

pub struct USART2 { /* private fields */ }

Trait Implementations§

Source§

impl Enable for USART2

Source§

fn enable(rcc: &mut RCC)

Enables peripheral
Source§

fn disable(rcc: &mut RCC)

Disables peripheral
Source§

fn is_enabled() -> bool

Check if peripheral enabled
Source§

fn is_disabled() -> bool

Check if peripheral disabled
Source§

unsafe fn enable_unchecked()

Safety Read more
Source§

unsafe fn disable_unchecked()

Safety Read more
Source§

impl RccBus for USART2

Source§

type Bus = APB1

Bus type;
Source§

impl Reset for USART2

Source§

fn reset(rcc: &mut RCC)

Resets peripheral
Source§

unsafe fn reset_unchecked()

Safety Read more
Source§

impl UartInit<Periph<RegisterBlock, 1073759232>> for USART2

Source§

fn init<OS: OsInterface>(self, mcu: &mut Mcu) -> Uart<OS, USART2>

Source§

impl UartPeriph for USART2

Source§

fn clear_err_flag(&self)

In order to clear that error flag, you have to do a read from the sr register followed by a read from the dr register.

Source§

fn is_tx_complete(&self) -> bool

Transfer is empty and completed
Source§

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

Source§

fn write_with(&mut self, f: impl FnOnce() -> Option<u16>) -> Option<bool>

Returns Read more
Source§

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

Source§

fn set_interrupt(&mut self, event: Event, enable: bool)

Source§

fn is_interrupt_enable(&mut self, event: Event) -> bool

Source§

fn is_interrupted(&mut self, event: Event) -> bool

Read and clean the flag
Source§

impl UartPeriphConfig for USART2

Source§

fn config(&mut self, config: Config)

Source§

fn enable_comm(&mut self, tx: bool, rx: bool)

Source§

fn set_stop_bits(&mut self, bits: StopBits)

Source§

fn is_tx_empty(&self) -> bool

Source§

fn is_rx_not_empty(&self) -> bool

Source§

impl UartPeriphWithDma for USART2