embassy_stm32_plus/traits/eth/
mod.rs

1use embassy_stm32::eth::PHY;
2use embassy_stm32::peripherals::ETH;
3use crate::builder::eth::{phy, pins, EthBuilder};
4use crate::builder::eth::phy::EthPhy;
5use crate::builder::eth::pins::EthPins;
6
7/// eth trait
8pub trait EthTrait<const TX: usize, const RX: usize, P: PHY> {
9    /// create eth builder
10    fn builder(self, pins: pins::EthPins, phy: phy::EthPhy<TX, RX, P>) -> EthBuilder<TX, RX, P>;
11}
12
13/// eth support eth trait
14impl<const TX: usize, const RX: usize, P: PHY> EthTrait<TX, RX, P> for ETH {
15    #[inline]
16    fn builder(self, pins: EthPins, phy: EthPhy<TX, RX, P>) -> EthBuilder<TX, RX, P> {
17        EthBuilder::new(self, pins, phy)
18    }
19}