@@ -330,7 +330,9 @@ fn into_pre_div(div: u8) -> cfgr2::PREDIV_A {
330
330
331
331
impl CFGR {
332
332
/// Uses `HSE` (external oscillator) instead of `HSI` (internal RC oscillator) as the clock source.
333
- /// Will result in a hang if an external oscillator is not connected or it fails to start.
333
+ ///
334
+ /// Will result in a hang if an external oscillator is not connected or it fails to start,
335
+ /// unless [css](CFGR::enable_css) is enabled.
334
336
pub fn use_hse < F > ( mut self , freq : F ) -> Self
335
337
where
336
338
F : Into < Hertz > ,
@@ -343,15 +345,18 @@ impl CFGR {
343
345
///
344
346
/// Uses user provided clock signal instead of an external oscillator.
345
347
/// `OSC_OUT` pin is free and can be used as GPIO.
348
+ ///
346
349
/// No effect if `HSE` is not enabled.
347
350
pub fn bypass_hse ( mut self ) -> Self {
348
351
self . hse_bypass = true ;
349
352
self
350
353
}
351
354
352
355
/// Enable `CSS` (Clock Security System).
356
+ ///
353
357
/// System clock is automatically switched to `HSI` and an interrupt (`CSSI`) is generated
354
358
/// when `HSE` clock failure is detected.
359
+ ///
355
360
/// No effect if `HSE` is not enabled.
356
361
pub fn enable_css ( mut self ) -> Self {
357
362
self . css = true ;
@@ -385,13 +390,15 @@ impl CFGR {
385
390
///
386
391
/// # Resolution and Limits
387
392
///
388
- /// Following is true for devices **except**, as these allow finer resolutions
393
+ /// - Maximal supported frequency with HSE: 72 Mhz
394
+ /// - Maximal supported frequency without HSE: 64 Mhz
395
+ ///
396
+ /// This is true for devices **except** the following devices,
397
+ /// as these allow finer resolutions
389
398
/// even when using the internal oscillator:
390
399
///
391
400
/// [stm32f302xd,stm32f302xe,stm32f303xd,stm32f303xe,stm32f398]
392
401
///
393
- /// - Maximal supported frequency with HSE: 72 Mhz
394
- /// - Maximal supported frequency without HSE: 64 Mhz
395
402
pub fn pclk2 < F > ( mut self , freq : F ) -> Self
396
403
where
397
404
F : Into < Hertz > ,
@@ -404,16 +411,17 @@ impl CFGR {
404
411
///
405
412
/// # Resolution and Limits
406
413
///
407
- /// Following is true for devices **except**, as these allow finer resolutions
408
- /// even when using the internal oscillator:
409
- ///
410
- /// [stm32f302xd,stm32f302xe,stm32f303xd,stm32f303xe,stm32f398]
411
- ///
412
414
/// - Maximal supported frequency with `HSE`: 72 Mhz
413
415
/// - Maximal supported frequency without `HSE`: 64 Mhz
414
416
///
415
417
/// If [`CFGR::hse`] is not used, therefor `HSI / 2` is used.
416
418
/// Only multiples of (HSI / 2) (4 Mhz) are allowed.
419
+ ///
420
+ /// This is true for devices **except** the following devices,
421
+ /// as these allow finer resolutions
422
+ /// even when using the internal oscillator:
423
+ ///
424
+ /// [stm32f302xd,stm32f302xe,stm32f303xd,stm32f303xe,stm32f398]
417
425
pub fn sysclk < F > ( mut self , freq : F ) -> Self
418
426
where
419
427
F : Into < Hertz > ,
@@ -796,11 +804,11 @@ impl Clocks {
796
804
797
805
/// Returns whether the USBCLK clock frequency is valid for the USB peripheral
798
806
///
799
- /// If the micrcontroller does support USB, 48 Mhz or 72 Mhz have to be used
807
+ /// If the microcontroller does support USB, 48 Mhz or 72 Mhz have to be used
800
808
/// and the [`CFGR::hse`] must be used.
801
809
///
802
- /// The APB1 / [`CFGR::pclk1`] clock must have a minimum frequency of 10 MHz to avoid data
803
- /// overrun/underrun problems. [RM0316 32.5.2][RM0316]
810
+ /// The APB1 / [`CFGR::pclk1`] clock must have a minimum frequency of 10 MHz to avoid data
811
+ /// overrun/underrun problems. [RM0316 32.5.2][RM0316]
804
812
///
805
813
/// [RM0316]: https://www.st.com/resource/en/reference_manual/dm00043574.pdf
806
814
pub fn usbclk_valid ( & self ) -> bool {
0 commit comments