@@ -98,14 +98,17 @@ pub struct CFGR {
98
98
}
99
99
100
100
impl CFGR {
101
- pub fn hse < F > ( mut self , freq : F ) -> Self
101
+ /// Uses HSE (external oscillator) instead of HSI (internal RC oscillator) as the clock source.
102
+ /// Will result in a hang if an external oscillator is not connected or it fails to start.
103
+ pub fn use_hse < F > ( mut self , freq : F ) -> Self
102
104
where
103
105
F : Into < Hertz > ,
104
106
{
105
107
self . hse = Some ( freq. into ( ) . 0 ) ;
106
108
self
107
109
}
108
110
111
+ /// Sets the desired frequency for the HCLK clock
109
112
pub fn hclk < F > ( mut self , freq : F ) -> Self
110
113
where
111
114
F : Into < Hertz > ,
@@ -114,6 +117,7 @@ impl CFGR {
114
117
self
115
118
}
116
119
120
+ /// Sets the desired frequency for the PCKL1 clock
117
121
pub fn pclk1 < F > ( mut self , freq : F ) -> Self
118
122
where
119
123
F : Into < Hertz > ,
@@ -122,6 +126,7 @@ impl CFGR {
122
126
self
123
127
}
124
128
129
+ /// Sets the desired frequency for the PCLK2 clock
125
130
pub fn pclk2 < F > ( mut self , freq : F ) -> Self
126
131
where
127
132
F : Into < Hertz > ,
@@ -130,6 +135,7 @@ impl CFGR {
130
135
self
131
136
}
132
137
138
+ /// Sets the desired frequency for the SYSCLK clock
133
139
pub fn sysclk < F > ( mut self , freq : F ) -> Self
134
140
where
135
141
F : Into < Hertz > ,
@@ -256,7 +262,6 @@ impl CFGR {
256
262
}
257
263
258
264
// set prescalers and clock source
259
-
260
265
rcc. cfgr . modify ( |_, w| unsafe {
261
266
w. ppre2 ( )
262
267
. bits ( ppre2_bits)
0 commit comments