embassy_stm32_plus/builder/uart/uart5/
mod.rs1use embassy_stm32::mode::Async;
2use embassy_stm32::peripherals::{PC12, PD2, UART5};
3use embassy_stm32::usart::{Config, ConfigError, Uart};
4use crate::builder::uart::base::UartBase;
5
6pub mod rx;
7pub mod tx;
8
9pub struct Uart5Builder {
11 pub base: UartBase<UART5>,
13 pub tx: PC12,
15 pub rx: PD2,
17}
18
19impl Uart5Builder {
21 #[deprecated(note = "no any dma support TxDma<UART5> or RxDma<UART5>")]
23 #[inline]
24 pub fn new(uart: UART5, tx: PC12, rx: PD2) -> Self {
25 Self { base: UartBase::new(uart), tx, rx }
26 }
27
28 #[inline]
30 pub fn config(mut self, config: Config) -> Self {
31 self.base.set_config(config);
32 self
33 }
34
35 #[deprecated(note = "no any dma support TxDma<UART5> or RxDma<UART5>")]
37 #[inline]
38 pub fn build(self) -> Result<Uart<'static, Async>, ConfigError> {
39 Err(ConfigError::RxOrTxNotEnabled)
40 }
41}