@@ -55,12 +55,12 @@ mod consts {
55
55
pub const ETH_MACMIIAR_CR_HCLK_DIV_16 : u8 = 2 ;
56
56
/* For HCLK 35-60 MHz */
57
57
pub const ETH_MACMIIAR_CR_HCLK_DIV_26 : u8 = 3 ;
58
- /* For HCLK 150-168 MHz */
58
+ /* For HCLK over 150 MHz */
59
59
pub const ETH_MACMIIAR_CR_HCLK_DIV_102 : u8 = 4 ;
60
60
}
61
61
use self :: consts:: * ;
62
62
63
- /// HCLK must be between 25MHz and 168MHz to use the ethernet peripheral.
63
+ /// HCLK must be at least 25MHz to use the ethernet peripheral.
64
64
#[ derive( Debug ) ]
65
65
pub struct WrongClock ;
66
66
@@ -86,10 +86,10 @@ impl<'rx, 'tx> Eth<'rx, 'tx> {
86
86
///
87
87
/// Make sure that the buffers reside in a memory region that is
88
88
/// accessible by the peripheral. Core-Coupled Memory (CCM) is
89
- /// usually not accessible. HCLK must be between 25MHz and 168MHz for STM32F4xx
90
- /// or 25MHz to 216MHz for STM32F7xx.
89
+ /// usually not accessible. HCLK must be at least 25MHz.
91
90
///
92
- /// Uses an interrupt free critical section to turn on the ethernet clock for STM32F7xx.
91
+ /// Uses an interrupt free critical section to turn on the ethernet clock
92
+ /// for STM32F7xx.
93
93
///
94
94
/// Other than that, initializes and starts the Ethernet hardware
95
95
/// so that you can [`send()`](#method.send) and
@@ -131,15 +131,12 @@ impl<'rx, 'tx> Eth<'rx, 'tx> {
131
131
132
132
fn init ( & mut self , clocks : Clocks ) -> Result < ( ) , WrongClock > {
133
133
let clock_range = match clocks. hclk ( ) . 0 {
134
- 60_000_000 ..=99_999_999 => ETH_MACMIIAR_CR_HCLK_DIV_42 ,
135
- 100_000_000 ..=149_999_999 => ETH_MACMIIAR_CR_HCLK_DIV_62 ,
134
+ 0 ..=24_999_999 => return Err ( WrongClock ) ,
136
135
25_000_000 ..=34_999_999 => ETH_MACMIIAR_CR_HCLK_DIV_16 ,
137
136
35_000_000 ..=59_999_999 => ETH_MACMIIAR_CR_HCLK_DIV_26 ,
138
- #[ cfg( feature = "stm32f4xx-hal" ) ]
139
- 150_000_000 ..=168_000_000 => ETH_MACMIIAR_CR_HCLK_DIV_102 ,
140
- #[ cfg( feature = "stm32f7xx-hal" ) ]
141
- 150_000_000 ..=216_000_000 => ETH_MACMIIAR_CR_HCLK_DIV_102 ,
142
- _ => return Err ( WrongClock ) ,
137
+ 60_000_000 ..=99_999_999 => ETH_MACMIIAR_CR_HCLK_DIV_42 ,
138
+ 100_000_000 ..=149_999_999 => ETH_MACMIIAR_CR_HCLK_DIV_62 ,
139
+ _ => ETH_MACMIIAR_CR_HCLK_DIV_102 ,
143
140
} ;
144
141
self . reset_dma_and_wait ( ) ;
145
142
0 commit comments