1#![macro_use]
3
4#[cfg_attr(eth_10m, path = "v10m/mod.rs")]
5#[cfg_attr(any(eth_v1, emac_v1), path = "v1/mod.rs")]
6mod _version;
7
8#[cfg(eth)]
9pub mod generic_smi;
10
11pub use self::_version::*;
12
13#[cfg(eth)]
14#[allow(unused)]
15const MTU: usize = 1514;
16
17#[cfg(eth)]
23pub unsafe trait StationManagement {
24 fn smi_read(&mut self, phy_addr: u8, reg: u8) -> u16;
26 fn smi_write(&mut self, phy_addr: u8, reg: u8, val: u16);
28}
29
30#[cfg(eth)]
36pub unsafe trait PHY {
37 fn phy_reset<S: StationManagement>(&mut self, sm: &mut S);
39 fn link_up<S: StationManagement>(&mut self, sm: &mut S) -> bool;
41}
42
43#[cfg(eth)]
44trait SealedInstance {
45 fn regs() -> crate::pac::eth::Eth;
46}
47
48#[allow(private_bounds)]
50#[cfg(eth)]
51pub trait Instance: SealedInstance + Send + 'static {}
52
53#[cfg(eth)]
54impl SealedInstance for crate::peripherals::ETH {
55 fn regs() -> crate::pac::eth::Eth {
56 crate::pac::ETH
57 }
58}
59#[cfg(eth)]
60impl Instance for crate::peripherals::ETH {}