Nut/OS  5.0.5
API Reference
Peripheral clocks configuration functions

Peripheral clocks configuration functions. More...

Collaboration diagram for Peripheral clocks configuration functions:

Functions

void RCC_RTCCLKConfig (uint32_t RCC_RTCCLKSource)
 Configures the RTC clock (RTCCLK).
void RCC_RTCCLKCmd (FunctionalState NewState)
 Enables or disables the RTC clock.
void RCC_BackupResetCmd (FunctionalState NewState)
 Forces or releases the Backup domain reset.
void RCC_I2SCLKConfig (uint32_t RCC_I2SCLKSource)
 Configures the I2S clock source (I2SCLK).
void RCC_AHB1PeriphClockCmd (uint32_t RCC_AHB1Periph, FunctionalState NewState)
 Enables or disables the AHB1 peripheral clock.
void RCC_AHB2PeriphClockCmd (uint32_t RCC_AHB2Periph, FunctionalState NewState)
 Enables or disables the AHB2 peripheral clock.
void RCC_AHB3PeriphClockCmd (uint32_t RCC_AHB3Periph, FunctionalState NewState)
 Enables or disables the AHB3 peripheral clock.
void RCC_APB1PeriphClockCmd (uint32_t RCC_APB1Periph, FunctionalState NewState)
 Enables or disables the Low Speed APB (APB1) peripheral clock.
void RCC_APB2PeriphClockCmd (uint32_t RCC_APB2Periph, FunctionalState NewState)
 Enables or disables the High Speed APB (APB2) peripheral clock.
void RCC_AHB1PeriphResetCmd (uint32_t RCC_AHB1Periph, FunctionalState NewState)
 Forces or releases AHB1 peripheral reset.
void RCC_AHB2PeriphResetCmd (uint32_t RCC_AHB2Periph, FunctionalState NewState)
 Forces or releases AHB2 peripheral reset.
void RCC_AHB3PeriphResetCmd (uint32_t RCC_AHB3Periph, FunctionalState NewState)
 Forces or releases AHB3 peripheral reset.
void RCC_APB1PeriphResetCmd (uint32_t RCC_APB1Periph, FunctionalState NewState)
 Forces or releases Low Speed APB (APB1) peripheral reset.
void RCC_APB2PeriphResetCmd (uint32_t RCC_APB2Periph, FunctionalState NewState)
 Forces or releases High Speed APB (APB2) peripheral reset.
void RCC_AHB1PeriphClockLPModeCmd (uint32_t RCC_AHB1Periph, FunctionalState NewState)
 Enables or disables the AHB1 peripheral clock during Low Power (Sleep) mode.
void RCC_AHB2PeriphClockLPModeCmd (uint32_t RCC_AHB2Periph, FunctionalState NewState)
 Enables or disables the AHB2 peripheral clock during Low Power (Sleep) mode.
void RCC_AHB3PeriphClockLPModeCmd (uint32_t RCC_AHB3Periph, FunctionalState NewState)
 Enables or disables the AHB3 peripheral clock during Low Power (Sleep) mode.
void RCC_APB1PeriphClockLPModeCmd (uint32_t RCC_APB1Periph, FunctionalState NewState)
 Enables or disables the APB1 peripheral clock during Low Power (Sleep) mode.
void RCC_APB2PeriphClockLPModeCmd (uint32_t RCC_APB2Periph, FunctionalState NewState)
 Enables or disables the APB2 peripheral clock during Low Power (Sleep) mode.
void RCC_RTCResetCmd (FunctionalState NewState)
 Forces or releases the RTC peripheral and associated resources reset.
void RCC_AHBPeriphClockCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
 Enables or disables the AHB peripheral clock.
void RCC_AHBPeriphResetCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
 Forces or releases AHB peripheral reset.
void RCC_AHBPeriphClockLPModeCmd (uint32_t RCC_AHBPeriph, FunctionalState NewState)
 Enables or disables the AHB peripheral clock during SLEEP mode.

Detailed Description

Peripheral clocks configuration functions.

 ===============================================================================
                   Peripheral clocks configuration functions
 ===============================================================================

  This section provide functions allowing to configure the Peripheral clocks.

  1. The RTC clock which is derived from the LSI, LSE or HSE clock divided by 2 to 31.

  2. After restart from Reset or wakeup from STANDBY, all peripherals are off
     except internal SRAM, Flash and JTAG. Before to start using a peripheral you
     have to enable its interface clock. You can do this using RCC_AHBPeriphClockCmd()
     , RCC_APB2PeriphClockCmd() and RCC_APB1PeriphClockCmd() functions.

  3. To reset the peripherals configuration (to the default state after device reset)
     you can use RCC_AHBPeriphResetCmd(), RCC_APB2PeriphResetCmd() and
     RCC_APB1PeriphResetCmd() functions.

  4. To further reduce power consumption in SLEEP mode the peripheral clocks can
     be disabled prior to executing the WFI or WFE instructions. You can do this
     using RCC_AHBPeriphClockLPModeCmd(), RCC_APB2PeriphClockLPModeCmd() and
     RCC_APB1PeriphClockLPModeCmd() functions.

 ===============================================================================
                   Peripheral clocks configuration functions
 ===============================================================================

  This section provide functions allowing to configure the Peripheral clocks.

  1. The RTC/LCD clock which is derived from the LSE, LSI or 1 MHz HSE_RTC (HSE
     divided by a programmable prescaler).

  2. After restart from Reset or wakeup from STANDBY, all peripherals are off
     except internal SRAM, Flash and JTAG. Before to start using a peripheral you
     have to enable its interface clock. You can do this using RCC_AHBPeriphClockCmd()
     , RCC_APB2PeriphClockCmd() and RCC_APB1PeriphClockCmd() functions.

  3. To reset the peripherals configuration (to the default state after device reset)
     you can use RCC_AHBPeriphResetCmd(), RCC_APB2PeriphResetCmd() and
     RCC_APB1PeriphResetCmd() functions.

  4. To further reduce power consumption in SLEEP mode the peripheral clocks can
     be disabled prior to executing the WFI or WFE instructions. You can do this
     using RCC_AHBPeriphClockLPModeCmd(), RCC_APB2PeriphClockLPModeCmd() and
     RCC_APB1PeriphClockLPModeCmd() functions.


Function Documentation

void RCC_RTCCLKConfig ( uint32_t  RCC_RTCCLKSource)

Configures the RTC clock (RTCCLK).

Configures the RTC and LCD clock (RTCCLK / LCDCLK).

Note:
As the RTC clock configuration bits are in the Backup domain and write access is denied to this domain after reset, you have to enable write access using PWR_BackupAccessCmd(ENABLE) function before to configure the RTC clock source (to be done once after reset).
Once the RTC clock is configured it can't be changed unless the Backup domain is reset using RCC_BackupResetCmd() function, or by a Power On Reset (POR).
Parameters:
RCC_RTCCLKSource,:specifies the RTC clock source. This parameter can be one of the following values:
  • RCC_RTCCLKSource_LSE: LSE selected as RTC clock
  • RCC_RTCCLKSource_LSI: LSI selected as RTC clock
  • RCC_RTCCLKSource_HSE_Divx: HSE clock divided by x selected as RTC clock, where x:[2,31]
Note:
If the LSE or LSI is used as RTC clock source, the RTC continues to work in STOP and STANDBY modes, and can be used as wakeup source. However, when the HSE clock is used as RTC clock source, the RTC cannot be used in STOP and STANDBY modes.
The maximum input clock frequency for RTC is 1MHz (when using HSE as RTC clock source).
Return values:
None
Note:
- As the RTC clock configuration bits are in the RTC domain and write access is denied to this domain after reset, you have to enable write access using PWR_RTCAccessCmd(ENABLE) function before to configure the RTC clock source (to be done once after reset).
  • Once the RTC clock is configured it can't be changed unless the RTC is reset using RCC_RTCResetCmd function, or by a Power On Reset (POR)
  • The RTC clock (RTCCLK) is used also to clock the LCD (LCDCLK).
Parameters:
RCC_RTCCLKSource,:specifies the RTC clock source. This parameter can be one of the following values:
  • RCC_RTCCLKSource_LSE: LSE selected as RTC clock
  • RCC_RTCCLKSource_LSI: LSI selected as RTC clock
  • RCC_RTCCLKSource_HSE_Div2: HSE divided by 2 selected as RTC clock
  • RCC_RTCCLKSource_HSE_Div4: HSE divided by 4 selected as RTC clock
  • RCC_RTCCLKSource_HSE_Div8: HSE divided by 8 selected as RTC clock
  • RCC_RTCCLKSource_HSE_Div16: HSE divided by 16 selected as RTC clock
Note:
- If the LSE or LSI is used as RTC clock source, the RTC continues to work in STOP and STANDBY modes, and can be used as wakeup source. However, when the HSE clock is used as RTC clock source, the RTC cannot be used in STOP and STANDBY modes.
  • The maximum input clock frequency for RTC is 1MHz (when using HSE as RTC clock source).
Return values:
None

References assert_param, IS_RCC_RTCCLK_SOURCE, RCC, and RCC_CFGR_RTCPRE.

void RCC_RTCCLKCmd ( FunctionalState  NewState)

Enables or disables the RTC clock.

Note:
This function must be used only after the RTC clock source was selected using the RCC_RTCCLKConfig function.
Parameters:
NewState,:new state of the RTC clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References __IO, assert_param, BDCR_RTCEN_BB, and IS_FUNCTIONAL_STATE.

void RCC_BackupResetCmd ( FunctionalState  NewState)

Forces or releases the Backup domain reset.

Note:
This function resets the RTC peripheral (including the backup registers) and the RTC clock source selection in RCC_CSR register.
The BKPSRAM is not affected by this reset.
Parameters:
NewState,:new state of the Backup domain reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References __IO, assert_param, BDCR_BDRST_BB, and IS_FUNCTIONAL_STATE.

void RCC_I2SCLKConfig ( uint32_t  RCC_I2SCLKSource)

Configures the I2S clock source (I2SCLK).

Note:
This function must be called before enabling the I2S APB clock.
This function applies only to Silicon RevisionB and RevisionY.
Parameters:
RCC_I2SCLKSource,:specifies the I2S clock source. This parameter can be one of the following values:
  • RCC_I2S2CLKSource_PLLI2S: PLLI2S clock used as I2S clock source
  • RCC_I2S2CLKSource_Ext: External clock mapped on the I2S_CKIN pin used as I2S clock source
Return values:
None
Note:
This function must be called before enabling the I2S APB clock.
Parameters:
RCC_I2SCLKSource,:specifies the I2S clock source. This parameter can be one of the following values:
  • RCC_I2S2CLKSource_PLLI2S: PLLI2S clock used as I2S clock source
  • RCC_I2S2CLKSource_Ext: External clock mapped on the I2S_CKIN pin used as I2S clock source
Return values:
None

References __IO, assert_param, CFGR_I2SSRC_BB, and IS_RCC_I2SCLK_SOURCE.

void RCC_AHB1PeriphClockCmd ( uint32_t  RCC_AHB1Periph,
FunctionalState  NewState 
)

Enables or disables the AHB1 peripheral clock.

Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_AHBPeriph,:specifies the AHB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHB1Periph_GPIOA: GPIOA clock
  • RCC_AHB1Periph_GPIOB: GPIOB clock
  • RCC_AHB1Periph_GPIOC: GPIOC clock
  • RCC_AHB1Periph_GPIOD: GPIOD clock
  • RCC_AHB1Periph_GPIOE: GPIOE clock
  • RCC_AHB1Periph_GPIOF: GPIOF clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOI: GPIOI clock
  • RCC_AHB1Periph_CRC: CRC clock
  • RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
  • RCC_AHB1Periph_DMA1: DMA1 clock
  • RCC_AHB1Periph_DMA2: DMA2 clock
  • RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
  • RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
  • RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
  • RCC_AHB1Periph_ETH_MAC_PTP: Ethernet PTP clock
  • RCC_AHB1Periph_OTG_HS: USB OTG HS clock
  • RCC_AHB1Periph_OTG_HS_ULPI: USB OTG HS ULPI clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None
Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_AHBPeriph,:specifies the AHB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHB1Periph_GPIOA: GPIOA clock
  • RCC_AHB1Periph_GPIOB: GPIOB clock
  • RCC_AHB1Periph_GPIOC: GPIOC clock
  • RCC_AHB1Periph_GPIOD: GPIOD clock
  • RCC_AHB1Periph_GPIOE: GPIOE clock
  • RCC_AHB1Periph_GPIOF: GPIOF clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOI: GPIOI clock
  • RCC_AHB1Periph_CRC: CRC clock
  • RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
  • RCC_AHB1Periph_CCMDATARAMEN CCM data RAM interface clock
  • RCC_AHB1Periph_DMA1: DMA1 clock
  • RCC_AHB1Periph_DMA2: DMA2 clock
  • RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
  • RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
  • RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
  • RCC_AHB1Periph_ETH_MAC_PTP: Ethernet PTP clock
  • RCC_AHB1Periph_OTG_HS: USB OTG HS clock
  • RCC_AHB1Periph_OTG_HS_ULPI: USB OTG HS ULPI clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB1_CLOCK_PERIPH, and RCC.

void RCC_AHB2PeriphClockCmd ( uint32_t  RCC_AHB2Periph,
FunctionalState  NewState 
)

Enables or disables the AHB2 peripheral clock.

Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_AHBPeriph,:specifies the AHB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHB2Periph_DCMI: DCMI clock
  • RCC_AHB2Periph_CRYP: CRYP clock
  • RCC_AHB2Periph_HASH: HASH clock
  • RCC_AHB2Periph_RNG: RNG clock
  • RCC_AHB2Periph_OTG_FS: USB OTG FS clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB2_PERIPH, and RCC.

void RCC_AHB3PeriphClockCmd ( uint32_t  RCC_AHB3Periph,
FunctionalState  NewState 
)

Enables or disables the AHB3 peripheral clock.

Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_AHBPeriph,:specifies the AHB3 peripheral to gates its clock. This parameter must be: RCC_AHB3Periph_FSMC
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB3_PERIPH, and RCC.

void RCC_APB1PeriphClockCmd ( uint32_t  RCC_APB1Periph,
FunctionalState  NewState 
)

Enables or disables the Low Speed APB (APB1) peripheral clock.

Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_APB1Periph,:specifies the APB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB1Periph_TIM2: TIM2 clock
  • RCC_APB1Periph_TIM3: TIM3 clock
  • RCC_APB1Periph_TIM4: TIM4 clock
  • RCC_APB1Periph_TIM5: TIM5 clock
  • RCC_APB1Periph_TIM6: TIM6 clock
  • RCC_APB1Periph_TIM7: TIM7 clock
  • RCC_APB1Periph_TIM12: TIM12 clock
  • RCC_APB1Periph_TIM13: TIM13 clock
  • RCC_APB1Periph_TIM14: TIM14 clock
  • RCC_APB1Periph_WWDG: WWDG clock
  • RCC_APB1Periph_SPI2: SPI2 clock
  • RCC_APB1Periph_SPI3: SPI3 clock
  • RCC_APB1Periph_USART2: USART2 clock
  • RCC_APB1Periph_USART3: USART3 clock
  • RCC_APB1Periph_UART4: UART4 clock
  • RCC_APB1Periph_UART5: UART5 clock
  • RCC_APB1Periph_I2C1: I2C1 clock
  • RCC_APB1Periph_I2C2: I2C2 clock
  • RCC_APB1Periph_I2C3: I2C3 clock
  • RCC_APB1Periph_CAN1: CAN1 clock
  • RCC_APB1Periph_CAN2: CAN2 clock
  • RCC_APB1Periph_PWR: PWR clock
  • RCC_APB1Periph_DAC: DAC clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None
Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_APB1Periph,:specifies the APB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB1Periph_TIM2
  • RCC_APB1Periph_TIM3
  • RCC_APB1Periph_TIM4
  • RCC_APB1Periph_TIM6
  • RCC_APB1Periph_TIM7
  • RCC_APB1Periph_LCD
  • RCC_APB1Periph_WWDG
  • RCC_APB1Periph_SPI2
  • RCC_APB1Periph_USART2
  • RCC_APB1Periph_USART3
  • RCC_APB1Periph_I2C1
  • RCC_APB1Periph_I2C2
  • RCC_APB1Periph_USB
  • RCC_APB1Periph_PWR
  • RCC_APB1Periph_DAC
  • RCC_APB1Periph_COMP
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_APB1_PERIPH, and RCC.

Referenced by Stm32I2cBus1Init(), and Stm32I2cBus2Init().

void RCC_APB2PeriphClockCmd ( uint32_t  RCC_APB2Periph,
FunctionalState  NewState 
)

Enables or disables the High Speed APB (APB2) peripheral clock.

Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_APB2Periph,:specifies the APB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB2Periph_TIM1: TIM1 clock
  • RCC_APB2Periph_TIM8: TIM8 clock
  • RCC_APB2Periph_USART1: USART1 clock
  • RCC_APB2Periph_USART6: USART6 clock
  • RCC_APB2Periph_ADC1: ADC1 clock
  • RCC_APB2Periph_ADC2: ADC2 clock
  • RCC_APB2Periph_ADC3: ADC3 clock
  • RCC_APB2Periph_SDIO: SDIO clock
  • RCC_APB2Periph_SPI1: SPI1 clock
  • RCC_APB2Periph_SYSCFG: SYSCFG clock
  • RCC_APB2Periph_TIM9: TIM9 clock
  • RCC_APB2Periph_TIM10: TIM10 clock
  • RCC_APB2Periph_TIM11: TIM11 clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None
Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_APB2Periph,:specifies the APB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB2Periph_SYSCFG
  • RCC_APB2Periph_TIM9
  • RCC_APB2Periph_TIM10
  • RCC_APB2Periph_TIM11
  • RCC_APB2Periph_ADC1
  • RCC_APB2Periph_SPI1
  • RCC_APB2Periph_USART1
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_APB2_PERIPH, and RCC.

void RCC_AHB1PeriphResetCmd ( uint32_t  RCC_AHB1Periph,
FunctionalState  NewState 
)

Forces or releases AHB1 peripheral reset.

Parameters:
RCC_AHB1Periph,:specifies the AHB1 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_AHB1Periph_GPIOA: GPIOA clock
  • RCC_AHB1Periph_GPIOB: GPIOB clock
  • RCC_AHB1Periph_GPIOC: GPIOC clock
  • RCC_AHB1Periph_GPIOD: GPIOD clock
  • RCC_AHB1Periph_GPIOE: GPIOE clock
  • RCC_AHB1Periph_GPIOF: GPIOF clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOI: GPIOI clock
  • RCC_AHB1Periph_CRC: CRC clock
  • RCC_AHB1Periph_DMA1: DMA1 clock
  • RCC_AHB1Periph_DMA2: DMA2 clock
  • RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
  • RCC_AHB1Periph_OTG_HS: USB OTG HS clock
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB1_RESET_PERIPH, and RCC.

void RCC_AHB2PeriphResetCmd ( uint32_t  RCC_AHB2Periph,
FunctionalState  NewState 
)

Forces or releases AHB2 peripheral reset.

Parameters:
RCC_AHB2Periph,:specifies the AHB2 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_AHB2Periph_DCMI: DCMI clock
  • RCC_AHB2Periph_CRYP: CRYP clock
  • RCC_AHB2Periph_HASH: HASH clock
  • RCC_AHB2Periph_RNG: RNG clock
  • RCC_AHB2Periph_OTG_FS: USB OTG FS clock
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB2_PERIPH, and RCC.

void RCC_AHB3PeriphResetCmd ( uint32_t  RCC_AHB3Periph,
FunctionalState  NewState 
)

Forces or releases AHB3 peripheral reset.

Parameters:
RCC_AHB3Periph,:specifies the AHB3 peripheral to reset. This parameter must be: RCC_AHB3Periph_FSMC
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB3_PERIPH, and RCC.

void RCC_APB1PeriphResetCmd ( uint32_t  RCC_APB1Periph,
FunctionalState  NewState 
)

Forces or releases Low Speed APB (APB1) peripheral reset.

Parameters:
RCC_APB1Periph,:specifies the APB1 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_APB1Periph_TIM2: TIM2 clock
  • RCC_APB1Periph_TIM3: TIM3 clock
  • RCC_APB1Periph_TIM4: TIM4 clock
  • RCC_APB1Periph_TIM5: TIM5 clock
  • RCC_APB1Periph_TIM6: TIM6 clock
  • RCC_APB1Periph_TIM7: TIM7 clock
  • RCC_APB1Periph_TIM12: TIM12 clock
  • RCC_APB1Periph_TIM13: TIM13 clock
  • RCC_APB1Periph_TIM14: TIM14 clock
  • RCC_APB1Periph_WWDG: WWDG clock
  • RCC_APB1Periph_SPI2: SPI2 clock
  • RCC_APB1Periph_SPI3: SPI3 clock
  • RCC_APB1Periph_USART2: USART2 clock
  • RCC_APB1Periph_USART3: USART3 clock
  • RCC_APB1Periph_UART4: UART4 clock
  • RCC_APB1Periph_UART5: UART5 clock
  • RCC_APB1Periph_I2C1: I2C1 clock
  • RCC_APB1Periph_I2C2: I2C2 clock
  • RCC_APB1Periph_I2C3: I2C3 clock
  • RCC_APB1Periph_CAN1: CAN1 clock
  • RCC_APB1Periph_CAN2: CAN2 clock
  • RCC_APB1Periph_PWR: PWR clock
  • RCC_APB1Periph_DAC: DAC clock
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None
Parameters:
RCC_APB1Periph,:specifies the APB1 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_APB1Periph_TIM2
  • RCC_APB1Periph_TIM3
  • RCC_APB1Periph_TIM4
  • RCC_APB1Periph_TIM6
  • RCC_APB1Periph_TIM7
  • RCC_APB1Periph_LCD
  • RCC_APB1Periph_WWDG
  • RCC_APB1Periph_SPI2
  • RCC_APB1Periph_USART2
  • RCC_APB1Periph_USART3
  • RCC_APB1Periph_I2C1
  • RCC_APB1Periph_I2C2
  • RCC_APB1Periph_USB
  • RCC_APB1Periph_PWR
  • RCC_APB1Periph_DAC
  • RCC_APB1Periph_COMP
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_APB1_PERIPH, and RCC.

Referenced by Stm32I2cBus1Init(), Stm32I2cBus2Init(), TIM_DeInit(), and USART_DeInit().

void RCC_APB2PeriphResetCmd ( uint32_t  RCC_APB2Periph,
FunctionalState  NewState 
)

Forces or releases High Speed APB (APB2) peripheral reset.

Parameters:
RCC_APB2Periph,:specifies the APB2 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_APB2Periph_TIM1: TIM1 clock
  • RCC_APB2Periph_TIM8: TIM8 clock
  • RCC_APB2Periph_USART1: USART1 clock
  • RCC_APB2Periph_USART6: USART6 clock
  • RCC_APB2Periph_ADC1: ADC1 clock
  • RCC_APB2Periph_ADC2: ADC2 clock
  • RCC_APB2Periph_ADC3: ADC3 clock
  • RCC_APB2Periph_SDIO: SDIO clock
  • RCC_APB2Periph_SPI1: SPI1 clock
  • RCC_APB2Periph_SYSCFG: SYSCFG clock
  • RCC_APB2Periph_TIM9: TIM9 clock
  • RCC_APB2Periph_TIM10: TIM10 clock
  • RCC_APB2Periph_TIM11: TIM11 clock
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None
Parameters:
RCC_APB2Periph,:specifies the APB2 peripheral to reset. This parameter can be any combination of the following values:
  • RCC_APB2Periph_SYSCFG
  • RCC_APB2Periph_TIM9
  • RCC_APB2Periph_TIM10
  • RCC_APB2Periph_TIM11
  • RCC_APB2Periph_ADC1
  • RCC_APB2Periph_SPI1
  • RCC_APB2Periph_USART1
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_APB2_PERIPH, IS_RCC_APB2_RESET_PERIPH, and RCC.

Referenced by TIM_DeInit(), and USART_DeInit().

void RCC_AHB1PeriphClockLPModeCmd ( uint32_t  RCC_AHB1Periph,
FunctionalState  NewState 
)

Enables or disables the AHB1 peripheral clock during Low Power (Sleep) mode.

Note:
Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
After wakeup from SLEEP mode, the peripheral clock is enabled again.
By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_AHBPeriph,:specifies the AHB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHB1Periph_GPIOA: GPIOA clock
  • RCC_AHB1Periph_GPIOB: GPIOB clock
  • RCC_AHB1Periph_GPIOC: GPIOC clock
  • RCC_AHB1Periph_GPIOD: GPIOD clock
  • RCC_AHB1Periph_GPIOE: GPIOE clock
  • RCC_AHB1Periph_GPIOF: GPIOF clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOG: GPIOG clock
  • RCC_AHB1Periph_GPIOI: GPIOI clock
  • RCC_AHB1Periph_CRC: CRC clock
  • RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
  • RCC_AHB1Periph_DMA1: DMA1 clock
  • RCC_AHB1Periph_DMA2: DMA2 clock
  • RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
  • RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
  • RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
  • RCC_AHB1Periph_ETH_MAC_PTP: Ethernet PTP clock
  • RCC_AHB1Periph_OTG_HS: USB OTG HS clock
  • RCC_AHB1Periph_OTG_HS_ULPI: USB OTG HS ULPI clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB1_LPMODE_PERIPH, and RCC.

void RCC_AHB2PeriphClockLPModeCmd ( uint32_t  RCC_AHB2Periph,
FunctionalState  NewState 
)

Enables or disables the AHB2 peripheral clock during Low Power (Sleep) mode.

Note:
Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
After wakeup from SLEEP mode, the peripheral clock is enabled again.
By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_AHBPeriph,:specifies the AHB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHB2Periph_DCMI: DCMI clock
  • RCC_AHB2Periph_CRYP: CRYP clock
  • RCC_AHB2Periph_HASH: HASH clock
  • RCC_AHB2Periph_RNG: RNG clock
  • RCC_AHB2Periph_OTG_FS: USB OTG FS clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB2_PERIPH, and RCC.

void RCC_AHB3PeriphClockLPModeCmd ( uint32_t  RCC_AHB3Periph,
FunctionalState  NewState 
)

Enables or disables the AHB3 peripheral clock during Low Power (Sleep) mode.

Note:
Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
After wakeup from SLEEP mode, the peripheral clock is enabled again.
By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_AHBPeriph,:specifies the AHB3 peripheral to gates its clock. This parameter must be: RCC_AHB3Periph_FSMC
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB3_PERIPH, and RCC.

void RCC_APB1PeriphClockLPModeCmd ( uint32_t  RCC_APB1Periph,
FunctionalState  NewState 
)

Enables or disables the APB1 peripheral clock during Low Power (Sleep) mode.

Enables or disables the APB1 peripheral clock during SLEEP mode.

Note:
Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
After wakeup from SLEEP mode, the peripheral clock is enabled again.
By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_APB1Periph,:specifies the APB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB1Periph_TIM2: TIM2 clock
  • RCC_APB1Periph_TIM3: TIM3 clock
  • RCC_APB1Periph_TIM4: TIM4 clock
  • RCC_APB1Periph_TIM5: TIM5 clock
  • RCC_APB1Periph_TIM6: TIM6 clock
  • RCC_APB1Periph_TIM7: TIM7 clock
  • RCC_APB1Periph_TIM12: TIM12 clock
  • RCC_APB1Periph_TIM13: TIM13 clock
  • RCC_APB1Periph_TIM14: TIM14 clock
  • RCC_APB1Periph_WWDG: WWDG clock
  • RCC_APB1Periph_SPI2: SPI2 clock
  • RCC_APB1Periph_SPI3: SPI3 clock
  • RCC_APB1Periph_USART2: USART2 clock
  • RCC_APB1Periph_USART3: USART3 clock
  • RCC_APB1Periph_UART4: UART4 clock
  • RCC_APB1Periph_UART5: UART5 clock
  • RCC_APB1Periph_I2C1: I2C1 clock
  • RCC_APB1Periph_I2C2: I2C2 clock
  • RCC_APB1Periph_I2C3: I2C3 clock
  • RCC_APB1Periph_CAN1: CAN1 clock
  • RCC_APB1Periph_CAN2: CAN2 clock
  • RCC_APB1Periph_PWR: PWR clock
  • RCC_APB1Periph_DAC: DAC clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None
Note:
- Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
  • After wakeup from SLEEP mode, the peripheral clock is enabled again.
  • By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_APB1Periph,:specifies the APB1 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB1Periph_TIM2
  • RCC_APB1Periph_TIM3
  • RCC_APB1Periph_TIM4
  • RCC_APB1Periph_TIM6
  • RCC_APB1Periph_TIM7
  • RCC_APB1Periph_LCD
  • RCC_APB1Periph_WWDG
  • RCC_APB1Periph_SPI2
  • RCC_APB1Periph_USART2
  • RCC_APB1Periph_USART3
  • RCC_APB1Periph_I2C1
  • RCC_APB1Periph_I2C2
  • RCC_APB1Periph_USB
  • RCC_APB1Periph_PWR
  • RCC_APB1Periph_DAC
  • RCC_APB1Periph_COMP
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_APB1_PERIPH, and RCC.

void RCC_APB2PeriphClockLPModeCmd ( uint32_t  RCC_APB2Periph,
FunctionalState  NewState 
)

Enables or disables the APB2 peripheral clock during Low Power (Sleep) mode.

Enables or disables the APB2 peripheral clock during SLEEP mode.

Note:
Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
After wakeup from SLEEP mode, the peripheral clock is enabled again.
By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_APB2Periph,:specifies the APB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB2Periph_TIM1: TIM1 clock
  • RCC_APB2Periph_TIM8: TIM8 clock
  • RCC_APB2Periph_USART1: USART1 clock
  • RCC_APB2Periph_USART6: USART6 clock
  • RCC_APB2Periph_ADC1: ADC1 clock
  • RCC_APB2Periph_ADC2: ADC2 clock
  • RCC_APB2Periph_ADC3: ADC3 clock
  • RCC_APB2Periph_SDIO: SDIO clock
  • RCC_APB2Periph_SPI1: SPI1 clock
  • RCC_APB2Periph_SYSCFG: SYSCFG clock
  • RCC_APB2Periph_TIM9: TIM9 clock
  • RCC_APB2Periph_TIM10: TIM10 clock
  • RCC_APB2Periph_TIM11: TIM11 clock
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None
Note:
- Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
  • After wakeup from SLEEP mode, the peripheral clock is enabled again.
  • By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_APB2Periph,:specifies the APB2 peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_APB2Periph_SYSCFG
  • RCC_APB2Periph_TIM9
  • RCC_APB2Periph_TIM10
  • RCC_APB2Periph_TIM11
  • RCC_APB2Periph_ADC1
  • RCC_APB2Periph_SPI1
  • RCC_APB2Periph_USART1
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_APB2_PERIPH, and RCC.

void RCC_RTCResetCmd ( FunctionalState  NewState)

Forces or releases the RTC peripheral and associated resources reset.

Note:
This function resets the RTC peripheral, RTC clock source selection (in RCC_CSR) and the backup registers.
Parameters:
NewState,:new state of the RTC reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References __IO, assert_param, CSR_RTCRST_BB, and IS_FUNCTIONAL_STATE.

void RCC_AHBPeriphClockCmd ( uint32_t  RCC_AHBPeriph,
FunctionalState  NewState 
)

Enables or disables the AHB peripheral clock.

Note:
After reset, the peripheral clock (used for registers read/write access) is disabled and the application software has to enable this clock before using it.
Parameters:
RCC_AHBPeriph,:specifies the AHB peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHBPeriph_GPIOA
  • RCC_AHBPeriph_GPIOB
  • RCC_AHBPeriph_GPIOC
  • RCC_AHBPeriph_GPIOD
  • RCC_AHBPeriph_GPIOE
  • RCC_AHBPeriph_GPIOH
  • RCC_AHBPeriph_CRC
  • RCC_AHBPeriph_FLITF (has effect only when the Flash memory is in power down mode)
  • RCC_AHBPeriph_DMA1
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB_PERIPH, and RCC.

void RCC_AHBPeriphResetCmd ( uint32_t  RCC_AHBPeriph,
FunctionalState  NewState 
)

Forces or releases AHB peripheral reset.

Parameters:
RCC_AHBPeriph,:specifies the AHB peripheral to reset. This parameter can be any combination of the following values:
  • RCC_AHBPeriph_GPIOA
  • RCC_AHBPeriph_GPIOB
  • RCC_AHBPeriph_GPIOC
  • RCC_AHBPeriph_GPIOD
  • RCC_AHBPeriph_GPIOE
  • RCC_AHBPeriph_GPIOH
  • RCC_AHBPeriph_CRC
  • RCC_AHBPeriph_FLITF (has effect only when the Flash memory is in power down mode)
  • RCC_AHBPeriph_DMA1
NewState,:new state of the specified peripheral reset. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB_PERIPH, and RCC.

void RCC_AHBPeriphClockLPModeCmd ( uint32_t  RCC_AHBPeriph,
FunctionalState  NewState 
)

Enables or disables the AHB peripheral clock during SLEEP mode.

Note:
- Peripheral clock gating in SLEEP mode can be used to further reduce power consumption.
  • After wakeup from SLEEP mode, the peripheral clock is enabled again.
  • By default, all peripheral clocks are enabled during SLEEP mode.
Parameters:
RCC_AHBPeriph,:specifies the AHB peripheral to gates its clock. This parameter can be any combination of the following values:
  • RCC_AHBPeriph_GPIOA
  • RCC_AHBPeriph_GPIOB
  • RCC_AHBPeriph_GPIOC
  • RCC_AHBPeriph_GPIOD
  • RCC_AHBPeriph_GPIOE
  • RCC_AHBPeriph_GPIOH
  • RCC_AHBPeriph_CRC
  • RCC_AHBPeriph_FLITF (has effect only when the Flash memory is in power down mode)
  • RCC_AHBPeriph_SRAM
  • RCC_AHBPeriph_DMA1
NewState,:new state of the specified peripheral clock. This parameter can be: ENABLE or DISABLE.
Return values:
None

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RCC_AHB_LPMODE_PERIPH, and RCC.