1
1
//! Board-specific clock configuration
2
2
3
3
use e310x_hal:: {
4
- e310x :: { PRCI , AONCLK } ,
5
- clock :: { Clocks , PrciExt , AonExt } ,
4
+ clock :: { AonExt , Clocks , PrciExt } ,
5
+ e310x :: { AONCLK , PRCI } ,
6
6
time:: Hertz ,
7
7
} ;
8
8
9
- #[ cfg( any( feature = "board-hifive1" , feature = "board-hifive1-revb" , feature = "board-redv" ) ) ]
9
+ #[ cfg( any(
10
+ feature = "board-hifive1" ,
11
+ feature = "board-hifive1-revb" ,
12
+ feature = "board-redv"
13
+ ) ) ]
10
14
/// Configures clock generation system.
11
15
///
12
16
/// For HiFive1 and HiFive1 Rev B boards external oscillators are enabled for
13
17
/// both high-frequency and low-frequency clocks.
14
18
pub fn configure ( prci : PRCI , aonclk : AONCLK , target_coreclk : Hertz ) -> Clocks {
15
19
let coreclk = prci. constrain ( ) ;
16
- let coreclk = coreclk. use_external ( Hertz ( 16_000_000 ) ) . coreclk ( target_coreclk) ;
20
+ let coreclk = coreclk
21
+ . use_external ( Hertz ( 16_000_000 ) )
22
+ . coreclk ( target_coreclk) ;
17
23
18
24
let aonclk = aonclk. constrain ( ) ;
19
25
let aonclk = aonclk. use_external ( Hertz ( 32_768 ) ) ;
@@ -28,7 +34,9 @@ pub fn configure(prci: PRCI, aonclk: AONCLK, target_coreclk: Hertz) -> Clocks {
28
34
/// high-frequency clock. For low-frequency clock internal oscillator is used.
29
35
pub fn configure ( prci : PRCI , aonclk : AONCLK , target_coreclk : Hertz ) -> Clocks {
30
36
let coreclk = prci. constrain ( ) ;
31
- let coreclk = coreclk. use_external ( Hertz ( 16_000_000 ) ) . coreclk ( target_coreclk) ;
37
+ let coreclk = coreclk
38
+ . use_external ( Hertz ( 16_000_000 ) )
39
+ . coreclk ( target_coreclk) ;
32
40
33
41
let aonclk = aonclk. constrain ( ) ;
34
42
0 commit comments