Error with RCC configuration: field 'cfgr' of RegisterBlock is private #853
Unanswered
solsticexin
asked this question in
Q&A
Replies: 1 comment 3 replies
-
rcc API was changed in last release. Your example is outdated. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use the example code for RCC configuration, but I'm encountering the following error:
field
cfgr
ofRegisterBlock
is privatefield
cfgr
of structstm32f4xx_hal::pac::rcc::RegisterBlock
is privateprivate field
Here is the code I'm working with:

let dp = pac::Peripherals::take().unwrap();
let rcc = dp.RCC.constrain();
let clocks = rcc
.cfgr
.use_hse(8.MHz())
.sysclk(168.MHz())
.pclk1(24.MHz())
.i2s_clk(86.MHz())
.require_pll48clk()
.freeze();
// Test that the I2S clock is suitable for 48000kHz audio.
assert!(clocks.i2s_clk().unwrap() == 48.MHz().into());
Beta Was this translation helpful? Give feedback.
All reactions