Skip to content

Commit 0ba01f4

Browse files
committed
rename CFGR to Config
1 parent 0bd0c7e commit 0ba01f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+102
-100
lines changed

examples/analog-stopwatch-with-spi-ssd1306.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![no_main]
99

1010
use panic_semihosting as _;
11-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
11+
use stm32f4xx_hal::{self as hal, rcc::Config};
1212

1313
use crate::hal::{
1414
gpio::{Edge, Input, PA0},
@@ -223,7 +223,7 @@ fn main() -> ! {
223223

224224
fn setup_clocks(rcc: pac::RCC) -> Rcc {
225225
rcc.freeze(
226-
CFGR::hsi()
226+
Config::hsi()
227227
.hclk(180.MHz())
228228
.sysclk(180.MHz())
229229
.pclk1(45.MHz())

examples/blinky-timer-irq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use panic_halt as _;
1010

11-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
11+
use stm32f4xx_hal::{self as hal, rcc::Config};
1212

1313
use crate::hal::{
1414
gpio::{self, Output, PushPull},
@@ -66,7 +66,7 @@ fn TIM2() {
6666
fn main() -> ! {
6767
let dp = Peripherals::take().unwrap();
6868

69-
let rcc = dp.RCC.freeze(CFGR::hsi().sysclk(16.MHz()).pclk1(8.MHz()));
69+
let rcc = dp.RCC.freeze(Config::hsi().sysclk(16.MHz()).pclk1(8.MHz()));
7070

7171
// Configure PA5 pin to blink LED
7272
let gpioa = dp.GPIOA.split();

examples/can-send.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use bxcan::filter::Mask32;
1010
use bxcan::{Fifo, Frame, StandardId};
1111
use cortex_m_rt::entry;
1212
use nb::block;
13-
use stm32f4xx_hal::rcc::CFGR;
13+
use stm32f4xx_hal::rcc::Config;
1414
use stm32f4xx_hal::{pac, prelude::*};
1515

1616
#[entry]
@@ -20,7 +20,7 @@ fn main() -> ! {
2020
// To meet CAN clock accuracy requirements an external crystal or ceramic
2121
// resonator must be used. The blue pill has a 8MHz external crystal.
2222
// Other boards might have a crystal with another frequency or none at all.
23-
let _rcc = dp.RCC.freeze(CFGR::hse(8.MHz()));
23+
let _rcc = dp.RCC.freeze(Config::hse(8.MHz()));
2424

2525
let gpiob = dp.GPIOB.split();
2626
let mut can1 = {

examples/delay-syst-blinky.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use panic_halt as _; // panic handler
1010

1111
use cortex_m_rt::entry;
12-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
12+
use stm32f4xx_hal::{self as hal, rcc::Config};
1313

1414
use crate::hal::{pac, prelude::*};
1515

@@ -24,7 +24,7 @@ fn main() -> ! {
2424
let mut led = gpioa.pa5.into_push_pull_output();
2525

2626
// Set up the system clock. We want to run at 48MHz for this one.
27-
let rcc = dp.RCC.freeze(CFGR::hsi().sysclk(48.MHz()));
27+
let rcc = dp.RCC.freeze(Config::hsi().sysclk(48.MHz()));
2828

2929
// Create a delay abstraction based on SysTick
3030
let mut delay = cp.SYST.delay(&rcc.clocks);

examples/delay-timer-blinky.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use panic_halt as _; // panic handler
1010

1111
use cortex_m_rt::entry;
12-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
12+
use stm32f4xx_hal::{self as hal, rcc::Config};
1313

1414
use crate::hal::{pac, prelude::*};
1515

@@ -24,7 +24,7 @@ fn main() -> ! {
2424
let mut led = gpioc.pc13.into_push_pull_output();
2525

2626
// Set up the system clock. We want to run at 48MHz for this one.
27-
let rcc = dp.RCC.freeze(CFGR::hse(25.MHz()).sysclk(48.MHz()));
27+
let rcc = dp.RCC.freeze(Config::hse(25.MHz()).sysclk(48.MHz()));
2828

2929
// Create a delay abstraction based on general-pupose 32-bit timer TIM5
3030
let mut delay = dp.TIM5.delay_us(&rcc.clocks);

examples/display-touch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use stm32f4xx_hal::{
2222
gpio::Speed,
2323
pac,
2424
prelude::*,
25-
rcc::CFGR,
25+
rcc::Config,
2626
};
2727

2828
use embedded_graphics_07::{
@@ -53,7 +53,7 @@ fn main() -> ! {
5353
let p = pac::Peripherals::take().unwrap();
5454
let cp = cortex_m::Peripherals::take().unwrap();
5555

56-
let rcc = p.RCC.freeze(CFGR::hsi().sysclk(100.MHz()));
56+
let rcc = p.RCC.freeze(Config::hsi().sysclk(100.MHz()));
5757
let mut delay = cp.SYST.delay(&rcc.clocks);
5858

5959
let gpiob = p.GPIOB.split();

examples/dwt-blinky.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::hal::{
1111
};
1212
use cortex_m_rt::entry;
1313
use panic_halt as _;
14-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
14+
use stm32f4xx_hal::{self as hal, rcc::Config};
1515

1616
#[entry]
1717
fn main() -> ! {
@@ -25,7 +25,7 @@ fn main() -> ! {
2525
let mut led2 = gpiog.pg14.into_push_pull_output();
2626

2727
// Set up the system clock. We want to run at 48MHz for this one.
28-
let rcc = dp.RCC.freeze(CFGR::hsi().sysclk(48.MHz()));
28+
let rcc = dp.RCC.freeze(Config::hsi().sysclk(48.MHz()));
2929

3030
// Create a delay abstraction based on DWT cycle counter
3131
let dwt = cp.DWT.constrain(cp.DCB, &rcc.clocks);

examples/f413disco-lcd-ferris.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use panic_halt as _;
1414
use rtt_target::{self, rtt_init_print, ChannelMode};
1515

16-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
16+
use stm32f4xx_hal::{self as hal, rcc::Config};
1717

1818
use crate::hal::{
1919
fsmc_lcd::{DataPins16, FsmcLcd, LcdPins, Timing},
@@ -705,7 +705,7 @@ fn main() -> ! {
705705
let gpiog = p.GPIOG.split();
706706

707707
// Configure and lock the clocks at maximum warp
708-
let rcc = p.RCC.freeze(CFGR::hsi().sysclk(100.MHz()));
708+
let rcc = p.RCC.freeze(Config::hsi().sysclk(100.MHz()));
709709

710710
// Define the pins we need for our 16bit parallel bus
711711
use stm32f4xx_hal::gpio::alt::fsmc as alt;

examples/f469disco-lcd-test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use cortex_m_rt::entry;
1414
use defmt_rtt as _;
1515
use panic_probe as _;
1616

17-
use stm32f4xx_hal::{self as hal, rcc::CFGR};
17+
use stm32f4xx_hal::{self as hal, rcc::Config};
1818

1919
use crate::hal::{
2020
dsi::{
@@ -55,7 +55,7 @@ fn main() -> ! {
5555
let hse_freq = 8.MHz();
5656
let rcc = dp
5757
.RCC
58-
.freeze(CFGR::hse(hse_freq).pclk2(32.MHz()).sysclk(180.MHz()));
58+
.freeze(Config::hse(hse_freq).pclk2(32.MHz()).sysclk(180.MHz()));
5959
let mut delay = cp.SYST.delay(&rcc.clocks);
6060

6161
let gpioh = dp.GPIOH.split();

examples/fmc-sdram.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use panic_probe as _;
88

99
use core::{mem, slice};
10-
use stm32f4xx_hal::{fmc::FmcExt, gpio::alt::fmc as alt, pac, prelude::*, rcc::CFGR};
10+
use stm32f4xx_hal::{fmc::FmcExt, gpio::alt::fmc as alt, pac, prelude::*, rcc::Config};
1111

1212
use cortex_m::peripheral::Peripherals;
1313

@@ -49,7 +49,7 @@ impl XorShift32 {
4949
#[entry]
5050
fn main() -> ! {
5151
if let (Some(p), Some(cp)) = (pac::Peripherals::take(), Peripherals::take()) {
52-
let rcc = p.RCC.freeze(CFGR::hsi().sysclk(180.MHz()));
52+
let rcc = p.RCC.freeze(Config::hsi().sysclk(180.MHz()));
5353

5454
let mut delay = cp.SYST.delay(&rcc.clocks);
5555

0 commit comments

Comments
 (0)