@@ -40,10 +40,11 @@ impl EthernetMAC {
40
40
///
41
41
/// HCLK must be at least 25MHz, else this function will return `Err(WrongClock)`.
42
42
///
43
- /// This method does not initialise the external PHY. However it does return an
44
- /// [`EthernetMAC`] which implements the
45
- /// [`mac::SerialManagement`] trait. This can be used to
46
- /// communicate with the external PHY.
43
+ /// This method does not initialise the external PHY. However, you can access SMI
44
+ /// `read` and `write` functions through the `smi` and `with_smi` functions.
45
+ ///
46
+ /// Additionally, an optional `impl` of the [`ieee802_3_miim::Miim`] trait is available
47
+ /// with the `ieee802_3_miim` feature (enabled by default), for PHY communication.
47
48
pub fn new < REFCLK , CRS , TXEN , TXD0 , TXD1 , RXD0 , RXD1 > (
48
49
eth_mac : ETHERNET_MAC ,
49
50
eth_mmc : ETHERNET_MMC ,
@@ -154,21 +155,21 @@ impl EthernetMAC {
154
155
& ' eth mut self ,
155
156
mdio : & ' pins mut Mdio ,
156
157
mdc : & ' pins mut Mdc ,
157
- ) -> Stm32Miim < ' eth , ' pins , Mdio , Mdc >
158
+ ) -> Stm32Mii < ' eth , ' pins , Mdio , Mdc >
158
159
where
159
160
Mdio : MdioPin ,
160
161
Mdc : MdcPin ,
161
162
{
162
- Stm32Miim :: new ( self , mdio, mdc)
163
+ Stm32Mii :: new ( self , mdio, mdc)
163
164
}
164
165
165
- /// Turn this [`EthernetMAC`] into an [`EthernetMACWithSmi `]
166
- pub fn with_smi < MDIO , MDC > ( self , mdio : MDIO , mdc : MDC ) -> EthernetMACWithMiim < MDIO , MDC >
166
+ /// Turn this [`EthernetMAC`] into an [`EthernetMACWithMii `]
167
+ pub fn with_smi < MDIO , MDC > ( self , mdio : MDIO , mdc : MDC ) -> EthernetMACWithMii < MDIO , MDC >
167
168
where
168
169
MDIO : MdioPin ,
169
170
MDC : MdcPin ,
170
171
{
171
- EthernetMACWithMiim {
172
+ EthernetMACWithMii {
172
173
eth_mac : self ,
173
174
mdio,
174
175
mdc,
@@ -181,7 +182,7 @@ impl EthernetMAC {
181
182
/// This version of the struct owns it's SMI pins,
182
183
/// allowing it to be used directly, instead of requiring
183
184
/// that a [`Miim`] is created.
184
- pub struct EthernetMACWithMiim < MDIO , MDC >
185
+ pub struct EthernetMACWithMii < MDIO , MDC >
185
186
where
186
187
MDIO : MdioPin ,
187
188
MDC : MdcPin ,
@@ -191,15 +192,17 @@ where
191
192
mdc : MDC ,
192
193
}
193
194
194
- impl < MDIO , MDC > EthernetMACWithMiim < MDIO , MDC >
195
+ impl < MDIO , MDC > EthernetMACWithMii < MDIO , MDC >
195
196
where
196
197
MDIO : MdioPin ,
197
198
MDC : MdcPin ,
198
199
{
199
200
/// Create a new EthernetMAC with owned MDIO and MDC pins.
200
201
///
201
- /// To interact with a connected Phy, use this struct's impl of
202
- /// [`SerialManagement`]
202
+ /// To interact with a connected Phy, use the `read` and `write` functions.
203
+ ///
204
+ /// Functionality for interacting with PHYs from the `ieee802_3_miim` crate
205
+ /// is available if the default feature `ieee802_3_miim` is enabled.
203
206
pub fn new ( eth_mac : EthernetMAC , mdio : MDIO , mdc : MDC ) -> Self {
204
207
Self { eth_mac, mdio, mdc }
205
208
}
@@ -211,7 +214,7 @@ where
211
214
}
212
215
}
213
216
214
- impl < MDIO , MDC > Deref for EthernetMACWithMiim < MDIO , MDC >
217
+ impl < MDIO , MDC > Deref for EthernetMACWithMii < MDIO , MDC >
215
218
where
216
219
MDIO : MdioPin ,
217
220
MDC : MdcPin ,
@@ -223,7 +226,7 @@ where
223
226
}
224
227
}
225
228
226
- impl < MDIO , MDC > EthernetMACWithMiim < MDIO , MDC >
229
+ impl < MDIO , MDC > EthernetMACWithMii < MDIO , MDC >
227
230
where
228
231
MDIO : MdioPin ,
229
232
MDC : MdcPin ,
@@ -242,7 +245,7 @@ where
242
245
}
243
246
244
247
#[ cfg( feature = "ieee802_3_miim" ) ]
245
- impl < MDIO , MDC > miim:: Miim for EthernetMACWithMiim < MDIO , MDC >
248
+ impl < MDIO , MDC > miim:: Miim for EthernetMACWithMii < MDIO , MDC >
246
249
where
247
250
MDIO : MdioPin ,
248
251
MDC : MdcPin ,
0 commit comments