Module stm32h7xx_hal::rcc::rec[][src]

Peripheral Reset and Enable Control (REC)

This module contains safe accessors to the RCC functionality for each peripheral.

At a minimum each peripheral implements ResetEnable. Peripherals that have an individual clock multiplexer in the PKSU also have methods kernel_clk_mux and get_kernel_clk_mux. These set and get the state of the kernel clock multiplexer respectively.

Peripherals that share a clock multiplexer in the PKSU with other peripherals implement a trait with a get_kernel_clk_mux method that returns the current kernel clock state. Because the kernel_clk_mux is shared between multiple peripherals, it cannot be set by any individual one of them. Instead it can only be set by methods on the PeripheralRec itself. These methods are named kernel_xxxx_clk_mux().

Reset/Enable Example

// Constrain and Freeze power
...
let rcc = dp.RCC.constrain();
let ccdr = rcc.sys_ck(100.mhz()).freeze(pwrcfg, &dp.SYSCFG);

// Enable the clock to a peripheral and reset it
ccdr.peripheral.FDCAN.enable().reset();

Individual Kernel Clock Example

let ccdr = ...; // Returned by `freeze()`, see example above

// Set individual kernel clock
let cec_prec = ccdr.peripheral.CEC.kernel_clk_mux(CecClkSel::LSI);

assert_eq!(cec_prec.get_kernel_clk_mux(), CecClkSel::LSI);

Group Kernel Clock Example

let mut ccdr = ...; // Returned by `freeze()`, see example above

// Set group kernel clock mux
ccdr.peripheral.kernel_i2c123_clk_mux(I2c123ClkSel::PLL3_R);

// Enable and reset peripheral
let i2c3_prec = ccdr.peripheral.I2C3.enable().reset();

assert_eq!(i2c3_prec.get_kernel_clk_mux(), I2c123ClkSel::PLL3_R);

// Some method that consumes the i2c3 prec
init_i2c3(..., i2c3_prec);

// Can't set group kernel clock (it would also affect I2C3)
// ccdr.peripheral.kernel_i2c123_clk_mux(I2c123ClkSel::HSI_KER);

Structs

Adc3

Reset, Enable and Clock functionality for Adc3

Adc12

Reset, Enable and Clock functionality for Adc12

Bdma

Reset, Enable and Clock functionality for Bdma

Cec

Reset, Enable and Clock functionality for Cec

Comp12

Reset, Enable and Clock functionality for Comp12

Crc

Reset, Enable and Clock functionality for Crc

Crs

Reset, Enable and Clock functionality for Crs

Crypt

Reset, Enable and Clock functionality for Crypt

Dac12

Reset, Enable and Clock functionality for Dac12

Dfsdm1

Reset, Enable and Clock functionality for Dfsdm1

Dma1

Reset, Enable and Clock functionality for Dma1

Dma2

Reset, Enable and Clock functionality for Dma2

Dma2d

Reset, Enable and Clock functionality for Dma2d

Eth1Mac

Reset, Enable and Clock functionality for Eth1Mac

Fdcan

Reset, Enable and Clock functionality for Fdcan

Fmc

Reset, Enable and Clock functionality for Fmc

Gpioa

Reset, Enable and Clock functionality for Gpioa

Gpiob

Reset, Enable and Clock functionality for Gpiob

Gpioc

Reset, Enable and Clock functionality for Gpioc

Gpiod

Reset, Enable and Clock functionality for Gpiod

Gpioe

Reset, Enable and Clock functionality for Gpioe

Gpiof

Reset, Enable and Clock functionality for Gpiof

Gpiog

Reset, Enable and Clock functionality for Gpiog

Gpioh

Reset, Enable and Clock functionality for Gpioh

Gpioi

Reset, Enable and Clock functionality for Gpioi

Gpioj

Reset, Enable and Clock functionality for Gpioj

Gpiok

Reset, Enable and Clock functionality for Gpiok

Hash

Reset, Enable and Clock functionality for Hash

Hrtim

Reset, Enable and Clock functionality for Hrtim

I2c1

Reset, Enable and Clock functionality for I2c1

I2c2

Reset, Enable and Clock functionality for I2c2

I2c3

Reset, Enable and Clock functionality for I2c3

I2c4

Reset, Enable and Clock functionality for I2c4

Jpgdec

Reset, Enable and Clock functionality for Jpgdec

Lptim1

Reset, Enable and Clock functionality for Lptim1

Lptim2

Reset, Enable and Clock functionality for Lptim2

Lptim3

Reset, Enable and Clock functionality for Lptim3

Lptim4

Reset, Enable and Clock functionality for Lptim4

Lptim5

Reset, Enable and Clock functionality for Lptim5

Ltdc

Reset, Enable and Clock functionality for Ltdc

Mdios

Reset, Enable and Clock functionality for Mdios

Mdma

Reset, Enable and Clock functionality for Mdma

Opamp

Reset, Enable and Clock functionality for Opamp

PeripheralREC

Peripheral Reset and Enable Control

Qspi

Reset, Enable and Clock functionality for Qspi

Rng

Reset, Enable and Clock functionality for Rng

Sai1

Reset, Enable and Clock functionality for Sai1

Sai2

Reset, Enable and Clock functionality for Sai2

Sai3

Reset, Enable and Clock functionality for Sai3

Sai4

Reset, Enable and Clock functionality for Sai4

Sdmmc1

Reset, Enable and Clock functionality for Sdmmc1

Sdmmc2

Reset, Enable and Clock functionality for Sdmmc2

Spi1

Reset, Enable and Clock functionality for Spi1

Spi2

Reset, Enable and Clock functionality for Spi2

Spi3

Reset, Enable and Clock functionality for Spi3

Spi4

Reset, Enable and Clock functionality for Spi4

Spi5

Reset, Enable and Clock functionality for Spi5

Spi6

Reset, Enable and Clock functionality for Spi6

Swp

Reset, Enable and Clock functionality for Swp

Tim1

Reset, Enable and Clock functionality for Tim1

Tim2

Reset, Enable and Clock functionality for Tim2

Tim3

Reset, Enable and Clock functionality for Tim3

Tim4

Reset, Enable and Clock functionality for Tim4

Tim5

Reset, Enable and Clock functionality for Tim5

Tim6

Reset, Enable and Clock functionality for Tim6

Tim7

Reset, Enable and Clock functionality for Tim7

Tim8

Reset, Enable and Clock functionality for Tim8

Tim12

Reset, Enable and Clock functionality for Tim12

Tim13

Reset, Enable and Clock functionality for Tim13

Tim14

Reset, Enable and Clock functionality for Tim14

Tim15

Reset, Enable and Clock functionality for Tim15

Tim16

Reset, Enable and Clock functionality for Tim16

Tim17

Reset, Enable and Clock functionality for Tim17

Uart4

Reset, Enable and Clock functionality for Uart4

Uart5

Reset, Enable and Clock functionality for Uart5

Uart7

Reset, Enable and Clock functionality for Uart7

Uart8

Reset, Enable and Clock functionality for Uart8

Usart1

Reset, Enable and Clock functionality for Usart1

Usart2

Reset, Enable and Clock functionality for Usart2

Usart3

Reset, Enable and Clock functionality for Usart3

Usart6

Reset, Enable and Clock functionality for Usart6

Usb1Otg

Reset, Enable and Clock functionality for Usb1Otg

Usb2Otg

Reset, Enable and Clock functionality for Usb2Otg

Vref

Reset, Enable and Clock functionality for Vref

Enums

LowPowerMode

The clock gating state of a peripheral in low-power mode

Traits

AdcClkSelGetter

Can return ADC kernel clock source selection

I2c123ClkSelGetter

Can return I2C1/2/3 kernel clock source selection

Lptim345ClkSelGetter

Can return LPTIM3/4/5 kernel clock source selection

ResetEnable

A trait for Resetting, Enabling and Disabling a single peripheral

Sai23ClkSelGetter

Can return SAI2/3 kernel clock source selection

SdmmcClkSelGetter

Can return SDMMC kernel clock source selection

Spi45ClkSelGetter

Can return SPI4/5 kernel clock source selection

Spi123ClkSelGetter

Can return SPI1/2/3 kernel clock source selection

Usart16ClkSelGetter

Can return USART1/6 kernel clock source selection

Usart234578ClkSelGetter

Can return USART2/3/4/5/7/8 kernel clock source selection

UsbClkSelGetter

Can return USB kernel clock source selection

Type Definitions

AdcClkSel

ADC kernel clock source selection.

CecClkSel

CEC kernel clock source selection

Dfsdm1ClkSel

DFSDM1 kernel clock source selection

FdcanClkSel

FDCAN kernel clock source selection

FmcClkSel

FMC kernel clock source selection

I2c4ClkSel

I2C4 kernel clock source selection

I2c123ClkSel

I2C1/2/3 kernel clock source selection.

Lptim1ClkSel

LPTIM1 kernel clock source selection

Lptim2ClkSel

LPTIM2 kernel clock source selection

Lptim345ClkSel

LPTIM3/4/5 kernel clock source selection.

QspiClkSel

QUADSPI kernel clock source selection

RngClkSel

RNG kernel clock source selection

Sai1ClkSel

SAI1 kernel clock source selection

Sai4AClkSel

Sub-Block A of SAI4 kernel clock source selection

Sai4BClkSel

Sub-Block B of SAI4 kernel clock source selection

Sai23ClkSel

SAI2/3 kernel clock source selection.

SdmmcClkSel

SDMMC kernel clock source selection.

Spi6ClkSel

SPI6 kernel clock source selection

Spi45ClkSel

SPI4/5 kernel clock source selection.

Spi123ClkSel

SPI1/2/3 kernel clock source selection.

SwpClkSel

SWPMI kernel clock source selection

Usart16ClkSel

USART1/6 kernel clock source selection.

Usart234578ClkSel

USART2/3/4/5/7/8 kernel clock source selection.

UsbClkSel

USB kernel clock source selection.