Skip to content

Commit 9f4974d

Browse files
author
Johannes Draaijer
committed
More docs
1 parent 0b20a08 commit 9f4974d

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

examples/arp-smoltcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn main() -> ! {
8686

8787
let mut last_link_up = false;
8888

89-
let mut bare_phy = BarePhy::new(eth_mac.with_smi(mdio, mdc), PHY_ADDR, Default::default());
89+
let mut bare_phy = BarePhy::new(eth_mac.with_mii(mdio, mdc), PHY_ADDR, Default::default());
9090

9191
loop {
9292
let link_up = bare_phy.phy_link_up();

examples/arp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn main() -> ! {
8484

8585
let mut last_link_up = false;
8686

87-
let mut bare_phy = BarePhy::new(eth_mac.with_smi(mdio, mdc), PHY_ADDR, Default::default());
87+
let mut bare_phy = BarePhy::new(eth_mac.with_mii(mdio, mdc), PHY_ADDR, Default::default());
8888

8989
loop {
9090
let link_up = bare_phy.phy_link_up();

examples/pktgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn main() -> ! {
9090
let mut tx_pkts = 0usize;
9191
let mut last_link_up = false;
9292

93-
let mut phy = BarePhy::new(eth_mac.with_smi(mdio, mdc), PHY_ADDR, Default::default());
93+
let mut phy = BarePhy::new(eth_mac.with_mii(mdio, mdc), PHY_ADDR, Default::default());
9494

9595
loop {
9696
let time: usize = cortex_m::interrupt::free(|cs| *TIME.borrow(cs).borrow());

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! An abstraction layer for ethernet periperhals embedded in STM32 processors.
22
//!
3-
//! For initialisation, see [`new`], and [`new_with_smi`]
3+
//! For initialisation, see [`new`], and [`new_with_mii`]
44
#![no_std]
55

66
/// Re-export
@@ -103,15 +103,15 @@ where
103103
///
104104
/// This method does not initialise the external PHY.
105105
///
106-
/// The SMI for the external PHY can be accessed through the
106+
/// The MII for the external PHY can be accessed through the
107107
/// returned [`EthernetMACWithMii`], .
108108
///
109109
/// # Note
110110
/// - Make sure that the buffers reside in a memory region that is
111111
/// accessible by the peripheral. Core-Coupled Memory (CCM) is
112112
/// usually not accessible.
113113
/// - HCLK must be at least 25 MHz.
114-
pub fn new_with_smi<'rx, 'tx, REFCLK, CRS, TXEN, TXD0, TXD1, RXD0, RXD1, MDIO, MDC>(
114+
pub fn new_with_mii<'rx, 'tx, REFCLK, CRS, TXEN, TXD0, TXD1, RXD0, RXD1, MDIO, MDC>(
115115
eth_mac: ETHERNET_MAC,
116116
eth_mmc: ETHERNET_MMC,
117117
eth_dma: ETHERNET_DMA,
@@ -133,7 +133,7 @@ where
133133
MDIO: mac::MdioPin,
134134
MDC: mac::MdcPin,
135135
{
136-
let mac = EthernetMAC::new(eth_mac, eth_mmc, clocks, pins)?.with_smi(mdio, mdc);
136+
let mac = EthernetMAC::new(eth_mac, eth_mmc, clocks, pins)?.with_mii(mdio, mdc);
137137

138138
let dma = EthernetDMA::new(&mac, eth_dma, rx_buffer, tx_buffer);
139139

src/mac/miim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ where
9999
Mdio: MdioPin,
100100
Mdc: MdcPin,
101101
{
102-
/// Create a temporary `Smi` instance.
102+
/// Create a temporary [`Stm32Mii`] instance.
103103
///
104104
/// Temporarily take exclusive access to the MDIO and MDC pins to ensure they are not used
105105
/// elsewhere for the duration of SMI communication.

src/mac/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ impl EthernetMAC {
150150
/// pins.
151151
///
152152
/// Exclusive access to the `MDIO` and `MDC` is required to ensure that are not used elsewhere
153-
/// for the duration of SMI communication.
154-
pub fn smi<'eth, 'pins, Mdio, Mdc>(
153+
/// for the duration of Mii communication.
154+
pub fn mii<'eth, 'pins, Mdio, Mdc>(
155155
&'eth mut self,
156156
mdio: &'pins mut Mdio,
157157
mdc: &'pins mut Mdc,
@@ -164,7 +164,7 @@ impl EthernetMAC {
164164
}
165165

166166
/// Turn this [`EthernetMAC`] into an [`EthernetMACWithMii`]
167-
pub fn with_smi<MDIO, MDC>(self, mdio: MDIO, mdc: MDC) -> EthernetMACWithMii<MDIO, MDC>
167+
pub fn with_mii<MDIO, MDC>(self, mdio: MDIO, mdc: MDC) -> EthernetMACWithMii<MDIO, MDC>
168168
where
169169
MDIO: MdioPin,
170170
MDC: MdcPin,
@@ -177,9 +177,9 @@ impl EthernetMAC {
177177
}
178178
}
179179

180-
/// Ethernet media access control (MAC) with owned SMI
180+
/// Ethernet media access control (MAC) with owned MII
181181
///
182-
/// This version of the struct owns it's SMI pins,
182+
/// This version of the struct owns it's MII pins,
183183
/// allowing it to be used directly, instead of requiring
184184
/// that a [`Miim`] is created.
185185
pub struct EthernetMACWithMii<MDIO, MDC>
@@ -233,13 +233,13 @@ where
233233
{
234234
pub fn read(&mut self, phy: u8, reg: u8) -> u16 {
235235
self.eth_mac
236-
.smi(&mut self.mdio, &mut self.mdc)
236+
.mii(&mut self.mdio, &mut self.mdc)
237237
.read(phy, reg)
238238
}
239239

240240
pub fn write(&mut self, phy: u8, reg: u8, data: u16) {
241241
self.eth_mac
242-
.smi(&mut self.mdio, &mut self.mdc)
242+
.mii(&mut self.mdio, &mut self.mdc)
243243
.write(phy, reg, data)
244244
}
245245
}

0 commit comments

Comments
 (0)