diff --git a/embassy-stm32/src/fmac.rs b/embassy-stm32/src/fmac.rs new file mode 100644 index 00000000..a5a5ab43 --- /dev/null +++ b/embassy-stm32/src/fmac.rs @@ -0,0 +1,35 @@ +use embassy_hal_common::{into_ref, PeripheralRef}; + +use crate::pac::FMAC; +use crate::Peripheral; + +pub struct FMAC<'d, T: Instance, Tx, Rx> { + _peri: PeripheralRef<'d, T>, + txdma: PeripheralRef<'d, Tx>, + rxdma: PeripheralRef<'d, Rx>, +} + +impl<'d, T: Instance, Tx, Rx> FMAC<'d, T, Tx, Rx> { + pub fn new(peri: impl Peripheral
+ 'd) -> Self { + unimplemented!() + } +} + +pub(crate) mod sealed { + use super::*; + + pub trait Instance { + const REGS: Regs; + } +} +pub trait Instance: Peripheral
+ sealed::Instance {} + +foreach_peripheral!( + (fmac, $inst:ident) => { + impl sealed::Instance for peripherals::$inst { + const REGS: Regs = crate::pac::$inst; + } + + impl Instance for peripherals::$inst {} + }; +); diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index bbde2da5..a4666092 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs @@ -36,6 +36,8 @@ pub mod dcmi; pub mod eth; #[cfg(feature = "exti")] pub mod exti; +#[cfg(any(rcc_h5))] +pub mod fmac; #[cfg(fmc)] pub mod fmc; #[cfg(i2c)]