Skip to content
Snippets Groups Projects
Commit 0eba1402 authored by Anton's avatar Anton
Browse files

bare6_5

parent f6b1713c
No related branches found
No related tags found
No related merge requests found
...@@ -122,22 +122,23 @@ fn clock_out(rcc: &RCC, gpioc: &GPIOC) { ...@@ -122,22 +122,23 @@ fn clock_out(rcc: &RCC, gpioc: &GPIOC) {
// mco2 : SYSCLK = 0b00 // mco2 : SYSCLK = 0b00
// mcopre : divide by 4 = 0b110 // mcopre : divide by 4 = 0b110
rcc.cfgr rcc.cfgr
.modify(|_, w| unsafe { w.mco2().bits(0b00).mco2pre().bits(0b110) }); .modify(|_, w| unsafe { w.mco2().sysclk().mco2pre().bits(0b110) });
// power on GPIOC, RM0368 6.3.11 // power on GPIOC, RM0368 6.3.11
rcc.ahb1enr.modify(|_, w| w.gpiocen().set_bit()); rcc.ahb1enr.modify(|_, w| w.gpiocen().enabled());
// MCO_2 alternate function AF0, STM32F401xD STM32F401xE data sheet // MCO_2 alternate function AF0, STM32F401xD STM32F401xE data sheet
// table 9 // table 9
// AF0, gpioc reset value = AF0 // AF0, gpioc reset value = AF0
// configure PC9 as alternate function 0b10, RM0368 6.2.10 // configure PC9 as alternate function 0b10, RM0368 6.2.10
gpioc.moder.modify(|_, w| w.moder9().bits(0b10)); gpioc.moder.modify(|_, w| w.moder9().alternate());
// otyper reset state push/pull, in reset state (don't need to change) // otyper reset state push/pull, in reset state (don't need to change)
// ospeedr 0b11 = very high speed // ospeedr 0b11 = very high speed
gpioc.ospeedr.modify(|_, w| w.ospeedr9().bits(0b11)); gpioc.ospeedr.modify(|_, w| w.ospeedr9().very_high_speed());
} }
// 0. Background reading: // 0. Background reading:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment