embassy_stm32_plus/builder/uart/uart5/
rx.rs1use embassy_stm32::mode::Async;
2use embassy_stm32::peripherals::{PD2, UART5};
3use embassy_stm32::usart::{Config, ConfigError, UartRx};
4use crate::builder::uart::base::UartBase;
5
6pub struct Uart5RxBuilder {
8 pub base: UartBase<UART5>,
10 pub rx: PD2,
12}
13
14impl Uart5RxBuilder {
16 #[deprecated(note = "no any dma support RxDma<UART5>")]
18 #[inline]
19 pub fn new(uart: UART5, rx: PD2) -> Uart5RxBuilder {
20 Self { base: UartBase::new(uart), rx }
21 }
22
23 #[inline]
25 pub fn config(mut self, config: Config) -> Self {
26 self.base.set_config(config);
27 self
28 }
29
30 #[deprecated(note = "no any dma support RxDma<UART5>")]
32 #[inline]
33 pub fn build(self) -> Result<UartRx<'static, Async>, ConfigError> {
34 Err(ConfigError::RxOrTxNotEnabled)
35 }
36}