|
@@ -2,53 +2,56 @@
|
|
|
******************************************************************************
|
|
******************************************************************************
|
|
|
* @file stm32f4xx_rcc.c
|
|
* @file stm32f4xx_rcc.c
|
|
|
* @author MCD Application Team
|
|
* @author MCD Application Team
|
|
|
- * @version V1.0.0
|
|
|
|
|
- * @date 30-September-2011
|
|
|
|
|
|
|
+ * @version V1.3.0
|
|
|
|
|
+ * @date 08-November-2013
|
|
|
* @brief This file provides firmware functions to manage the following
|
|
* @brief This file provides firmware functions to manage the following
|
|
|
* functionalities of the Reset and clock control (RCC) peripheral:
|
|
* functionalities of the Reset and clock control (RCC) peripheral:
|
|
|
- * - Internal/external clocks, PLL, CSS and MCO configuration
|
|
|
|
|
- * - System, AHB and APB busses clocks configuration
|
|
|
|
|
- * - Peripheral clocks configuration
|
|
|
|
|
- * - Interrupts and flags management
|
|
|
|
|
|
|
+ * + Internal/external clocks, PLL, CSS and MCO configuration
|
|
|
|
|
+ * + System, AHB and APB busses clocks configuration
|
|
|
|
|
+ * + Peripheral clocks configuration
|
|
|
|
|
+ * + Interrupts and flags management
|
|
|
*
|
|
*
|
|
|
- * @verbatim
|
|
|
|
|
- *
|
|
|
|
|
- * ===================================================================
|
|
|
|
|
- * RCC specific features
|
|
|
|
|
- * ===================================================================
|
|
|
|
|
- *
|
|
|
|
|
- * After reset the device is running from Internal High Speed oscillator
|
|
|
|
|
- * (HSI 16MHz) with Flash 0 wait state, Flash prefetch buffer, D-Cache
|
|
|
|
|
- * and I-Cache are disabled, and all peripherals are off except internal
|
|
|
|
|
- * SRAM, Flash and JTAG.
|
|
|
|
|
- * - There is no prescaler on High speed (AHB) and Low speed (APB) busses;
|
|
|
|
|
- * all peripherals mapped on these busses are running at HSI speed.
|
|
|
|
|
- * - The clock for all peripherals is switched off, except the SRAM and FLASH.
|
|
|
|
|
- * - All GPIOs are in input floating state, except the JTAG pins which
|
|
|
|
|
- * are assigned to be used for debug purpose.
|
|
|
|
|
- *
|
|
|
|
|
- * Once the device started from reset, the user application has to:
|
|
|
|
|
- * - Configure the clock source to be used to drive the System clock
|
|
|
|
|
- * (if the application needs higher frequency/performance)
|
|
|
|
|
- * - Configure the System clock frequency and Flash settings
|
|
|
|
|
- * - Configure the AHB and APB busses prescalers
|
|
|
|
|
- * - Enable the clock for the peripheral(s) to be used
|
|
|
|
|
- * - Configure the clock source(s) for peripherals which clocks are not
|
|
|
|
|
- * derived from the System clock (I2S, RTC, ADC, USB OTG FS/SDIO/RNG)
|
|
|
|
|
- *
|
|
|
|
|
- * @endverbatim
|
|
|
|
|
- *
|
|
|
|
|
|
|
+ @verbatim
|
|
|
|
|
+ ===============================================================================
|
|
|
|
|
+ ##### RCC specific features #####
|
|
|
|
|
+ ===============================================================================
|
|
|
|
|
+ [..]
|
|
|
|
|
+ After reset the device is running from Internal High Speed oscillator
|
|
|
|
|
+ (HSI 16MHz) with Flash 0 wait state, Flash prefetch buffer, D-Cache
|
|
|
|
|
+ and I-Cache are disabled, and all peripherals are off except internal
|
|
|
|
|
+ SRAM, Flash and JTAG.
|
|
|
|
|
+ (+) There is no prescaler on High speed (AHB) and Low speed (APB) busses;
|
|
|
|
|
+ all peripherals mapped on these busses are running at HSI speed.
|
|
|
|
|
+ (+) The clock for all peripherals is switched off, except the SRAM and FLASH.
|
|
|
|
|
+ (+) All GPIOs are in input floating state, except the JTAG pins which
|
|
|
|
|
+ are assigned to be used for debug purpose.
|
|
|
|
|
+ [..]
|
|
|
|
|
+ Once the device started from reset, the user application has to:
|
|
|
|
|
+ (+) Configure the clock source to be used to drive the System clock
|
|
|
|
|
+ (if the application needs higher frequency/performance)
|
|
|
|
|
+ (+) Configure the System clock frequency and Flash settings
|
|
|
|
|
+ (+) Configure the AHB and APB busses prescalers
|
|
|
|
|
+ (+) Enable the clock for the peripheral(s) to be used
|
|
|
|
|
+ (+) Configure the clock source(s) for peripherals which clocks are not
|
|
|
|
|
+ derived from the System clock (I2S, RTC, ADC, USB OTG FS/SDIO/RNG)
|
|
|
|
|
+ @endverbatim
|
|
|
******************************************************************************
|
|
******************************************************************************
|
|
|
* @attention
|
|
* @attention
|
|
|
*
|
|
*
|
|
|
- * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
|
|
|
|
- * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
|
|
|
|
- * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
|
|
|
|
- * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
|
|
|
|
- * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
|
|
|
|
- * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
|
|
|
|
|
|
+ * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
|
|
|
|
|
+ *
|
|
|
|
|
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
|
|
|
|
+ * You may not use this file except in compliance with the License.
|
|
|
|
|
+ * You may obtain a copy of the License at:
|
|
|
|
|
+ *
|
|
|
|
|
+ * http://www.st.com/software_license_agreement_liberty_v2
|
|
|
|
|
+ *
|
|
|
|
|
+ * Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
+ * See the License for the specific language governing permissions and
|
|
|
|
|
+ * limitations under the License.
|
|
|
*
|
|
*
|
|
|
- * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
|
|
|
|
******************************************************************************
|
|
******************************************************************************
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
@@ -83,6 +86,10 @@
|
|
|
#define PLLI2SON_BitNumber 0x1A
|
|
#define PLLI2SON_BitNumber 0x1A
|
|
|
#define CR_PLLI2SON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLI2SON_BitNumber * 4))
|
|
#define CR_PLLI2SON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLI2SON_BitNumber * 4))
|
|
|
|
|
|
|
|
|
|
+/* Alias word address of PLLSAION bit */
|
|
|
|
|
+#define PLLSAION_BitNumber 0x1C
|
|
|
|
|
+#define CR_PLLSAION_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLSAION_BitNumber * 4))
|
|
|
|
|
+
|
|
|
/* --- CFGR Register ---*/
|
|
/* --- CFGR Register ---*/
|
|
|
/* Alias word address of I2SSRC bit */
|
|
/* Alias word address of I2SSRC bit */
|
|
|
#define CFGR_OFFSET (RCC_OFFSET + 0x08)
|
|
#define CFGR_OFFSET (RCC_OFFSET + 0x08)
|
|
@@ -97,11 +104,18 @@
|
|
|
/* Alias word address of BDRST bit */
|
|
/* Alias word address of BDRST bit */
|
|
|
#define BDRST_BitNumber 0x10
|
|
#define BDRST_BitNumber 0x10
|
|
|
#define BDCR_BDRST_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (BDRST_BitNumber * 4))
|
|
#define BDCR_BDRST_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (BDRST_BitNumber * 4))
|
|
|
|
|
+
|
|
|
/* --- CSR Register ---*/
|
|
/* --- CSR Register ---*/
|
|
|
/* Alias word address of LSION bit */
|
|
/* Alias word address of LSION bit */
|
|
|
#define CSR_OFFSET (RCC_OFFSET + 0x74)
|
|
#define CSR_OFFSET (RCC_OFFSET + 0x74)
|
|
|
#define LSION_BitNumber 0x00
|
|
#define LSION_BitNumber 0x00
|
|
|
#define CSR_LSION_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (LSION_BitNumber * 4))
|
|
#define CSR_LSION_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (LSION_BitNumber * 4))
|
|
|
|
|
+
|
|
|
|
|
+/* --- DCKCFGR Register ---*/
|
|
|
|
|
+/* Alias word address of TIMPRE bit */
|
|
|
|
|
+#define DCKCFGR_OFFSET (RCC_OFFSET + 0x8C)
|
|
|
|
|
+#define TIMPRE_BitNumber 0x18
|
|
|
|
|
+#define DCKCFGR_TIMPRE_BB (PERIPH_BB_BASE + (DCKCFGR_OFFSET * 32) + (TIMPRE_BitNumber * 4))
|
|
|
/* ---------------------- RCC registers bit mask ------------------------ */
|
|
/* ---------------------- RCC registers bit mask ------------------------ */
|
|
|
/* CFGR register bit mask */
|
|
/* CFGR register bit mask */
|
|
|
#define CFGR_MCO2_RESET_MASK ((uint32_t)0x07FFFFFF)
|
|
#define CFGR_MCO2_RESET_MASK ((uint32_t)0x07FFFFFF)
|
|
@@ -137,45 +151,48 @@ static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6
|
|
|
* @brief Internal and external clocks, PLL, CSS and MCO configuration functions
|
|
* @brief Internal and external clocks, PLL, CSS and MCO configuration functions
|
|
|
*
|
|
*
|
|
|
@verbatim
|
|
@verbatim
|
|
|
- ===============================================================================
|
|
|
|
|
- Internal/external clocks, PLL, CSS and MCO configuration functions
|
|
|
|
|
- ===============================================================================
|
|
|
|
|
-
|
|
|
|
|
- This section provide functions allowing to configure the internal/external clocks,
|
|
|
|
|
- PLLs, CSS and MCO pins.
|
|
|
|
|
|
|
+ ===================================================================================
|
|
|
|
|
+ ##### Internal and external clocks, PLL, CSS and MCO configuration functions #####
|
|
|
|
|
+ ===================================================================================
|
|
|
|
|
+ [..]
|
|
|
|
|
+ This section provide functions allowing to configure the internal/external clocks,
|
|
|
|
|
+ PLLs, CSS and MCO pins.
|
|
|
|
|
|
|
|
- 1. HSI (high-speed internal), 16 MHz factory-trimmed RC used directly or through
|
|
|
|
|
- the PLL as System clock source.
|
|
|
|
|
|
|
+ (#) HSI (high-speed internal), 16 MHz factory-trimmed RC used directly or through
|
|
|
|
|
+ the PLL as System clock source.
|
|
|
|
|
|
|
|
- 2. LSI (low-speed internal), 32 KHz low consumption RC used as IWDG and/or RTC
|
|
|
|
|
- clock source.
|
|
|
|
|
|
|
+ (#) LSI (low-speed internal), 32 KHz low consumption RC used as IWDG and/or RTC
|
|
|
|
|
+ clock source.
|
|
|
|
|
|
|
|
- 3. HSE (high-speed external), 4 to 26 MHz crystal oscillator used directly or
|
|
|
|
|
- through the PLL as System clock source. Can be used also as RTC clock source.
|
|
|
|
|
|
|
+ (#) HSE (high-speed external), 4 to 26 MHz crystal oscillator used directly or
|
|
|
|
|
+ through the PLL as System clock source. Can be used also as RTC clock source.
|
|
|
|
|
|
|
|
- 4. LSE (low-speed external), 32 KHz oscillator used as RTC clock source.
|
|
|
|
|
|
|
+ (#) LSE (low-speed external), 32 KHz oscillator used as RTC clock source.
|
|
|
|
|
|
|
|
- 5. PLL (clocked by HSI or HSE), featuring two different output clocks:
|
|
|
|
|
- - The first output is used to generate the high speed system clock (up to 168 MHz)
|
|
|
|
|
- - The second output is used to generate the clock for the USB OTG FS (48 MHz),
|
|
|
|
|
- the random analog generator (<=48 MHz) and the SDIO (<= 48 MHz).
|
|
|
|
|
|
|
+ (#) PLL (clocked by HSI or HSE), featuring two different output clocks:
|
|
|
|
|
+ (++) The first output is used to generate the high speed system clock (up to 168 MHz)
|
|
|
|
|
+ (++) The second output is used to generate the clock for the USB OTG FS (48 MHz),
|
|
|
|
|
+ the random analog generator (<=48 MHz) and the SDIO (<= 48 MHz).
|
|
|
|
|
|
|
|
- 6. PLLI2S (clocked by HSI or HSE), used to generate an accurate clock to achieve
|
|
|
|
|
- high-quality audio performance on the I2S interface.
|
|
|
|
|
|
|
+ (#) PLLI2S (clocked by HSI or HSE), used to generate an accurate clock to achieve
|
|
|
|
|
+ high-quality audio performance on the I2S interface or SAI interface in case
|
|
|
|
|
+ of STM32F429x/439x devices.
|
|
|
|
|
+
|
|
|
|
|
+ (#) PLLSAI clocked by (HSI or HSE), used to generate an accurate clock to SAI
|
|
|
|
|
+ interface and LCD TFT controller available only for STM32F42xxx/43xxx devices.
|
|
|
|
|
|
|
|
- 7. CSS (Clock security system), once enable and if a HSE clock failure occurs
|
|
|
|
|
- (HSE used directly or through PLL as System clock source), the System clock
|
|
|
|
|
- is automatically switched to HSI and an interrupt is generated if enabled.
|
|
|
|
|
- The interrupt is linked to the Cortex-M4 NMI (Non-Maskable Interrupt)
|
|
|
|
|
- exception vector.
|
|
|
|
|
-
|
|
|
|
|
- 8. MCO1 (microcontroller clock output), used to output HSI, LSE, HSE or PLL
|
|
|
|
|
- clock (through a configurable prescaler) on PA8 pin.
|
|
|
|
|
-
|
|
|
|
|
- 9. MCO2 (microcontroller clock output), used to output HSE, PLL, SYSCLK or PLLI2S
|
|
|
|
|
- clock (through a configurable prescaler) on PC9 pin.
|
|
|
|
|
-
|
|
|
|
|
-@endverbatim
|
|
|
|
|
|
|
+ (#) CSS (Clock security system), once enable and if a HSE clock failure occurs
|
|
|
|
|
+ (HSE used directly or through PLL as System clock source), the System clock
|
|
|
|
|
+ is automatically switched to HSI and an interrupt is generated if enabled.
|
|
|
|
|
+ The interrupt is linked to the Cortex-M4 NMI (Non-Maskable Interrupt)
|
|
|
|
|
+ exception vector.
|
|
|
|
|
+
|
|
|
|
|
+ (#) MCO1 (microcontroller clock output), used to output HSI, LSE, HSE or PLL
|
|
|
|
|
+ clock (through a configurable prescaler) on PA8 pin.
|
|
|
|
|
+
|
|
|
|
|
+ (#) MCO2 (microcontroller clock output), used to output HSE, PLL, SYSCLK or PLLI2S
|
|
|
|
|
+ clock (through a configurable prescaler) on PC9 pin.
|
|
|
|
|
+ @endverbatim
|
|
|
* @{
|
|
* @{
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
@@ -188,7 +205,7 @@ static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6
|
|
|
* - CSS, MCO1 and MCO2 OFF
|
|
* - CSS, MCO1 and MCO2 OFF
|
|
|
* - All interrupts disabled
|
|
* - All interrupts disabled
|
|
|
* @note This function doesn't modify the configuration of the
|
|
* @note This function doesn't modify the configuration of the
|
|
|
- * - Peripheral clocks
|
|
|
|
|
|
|
+ * - Peripheral clocks
|
|
|
* - LSI, LSE and RTC clocks
|
|
* - LSI, LSE and RTC clocks
|
|
|
* @param None
|
|
* @param None
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -201,17 +218,27 @@ void RCC_DeInit(void)
|
|
|
/* Reset CFGR register */
|
|
/* Reset CFGR register */
|
|
|
RCC->CFGR = 0x00000000;
|
|
RCC->CFGR = 0x00000000;
|
|
|
|
|
|
|
|
- /* Reset HSEON, CSSON and PLLON bits */
|
|
|
|
|
- RCC->CR &= (uint32_t)0xFEF6FFFF;
|
|
|
|
|
|
|
+ /* Reset HSEON, CSSON, PLLON, PLLI2S and PLLSAI(STM32F42/43xxx devices) bits */
|
|
|
|
|
+ RCC->CR &= (uint32_t)0xEAF6FFFF;
|
|
|
|
|
|
|
|
/* Reset PLLCFGR register */
|
|
/* Reset PLLCFGR register */
|
|
|
RCC->PLLCFGR = 0x24003010;
|
|
RCC->PLLCFGR = 0x24003010;
|
|
|
|
|
|
|
|
|
|
+ /* Reset PLLI2SCFGR register */
|
|
|
|
|
+ RCC->PLLI2SCFGR = 0x20003000;
|
|
|
|
|
+
|
|
|
|
|
+ /* Reset PLLSAICFGR register, only available for STM32F42/43xxx devices */
|
|
|
|
|
+ RCC->PLLSAICFGR = 0x24003000;
|
|
|
|
|
+
|
|
|
/* Reset HSEBYP bit */
|
|
/* Reset HSEBYP bit */
|
|
|
RCC->CR &= (uint32_t)0xFFFBFFFF;
|
|
RCC->CR &= (uint32_t)0xFFFBFFFF;
|
|
|
|
|
|
|
|
/* Disable all interrupts */
|
|
/* Disable all interrupts */
|
|
|
RCC->CIR = 0x00000000;
|
|
RCC->CIR = 0x00000000;
|
|
|
|
|
+
|
|
|
|
|
+ /* Disable Timers clock prescalers selection, only available for STM32F42/43xxx devices */
|
|
|
|
|
+ RCC->DCKCFGR = 0x00000000;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -463,9 +490,13 @@ void RCC_PLLCmd(FunctionalState NewState)
|
|
|
*(__IO uint32_t *) CR_PLLON_BB = (uint32_t)NewState;
|
|
*(__IO uint32_t *) CR_PLLON_BB = (uint32_t)NewState;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#if defined (STM32F40_41xxx) || defined (STM32F401xx)
|
|
|
/**
|
|
/**
|
|
|
* @brief Configures the PLLI2S clock multiplication and division factors.
|
|
* @brief Configures the PLLI2S clock multiplication and division factors.
|
|
|
*
|
|
*
|
|
|
|
|
+ * @note This function can be used only for STM32F405xx/407xx, STM32F415xx/417xx
|
|
|
|
|
+ * or STM32F401xx devices.
|
|
|
|
|
+ *
|
|
|
* @note This function must be used only when the PLLI2S is disabled.
|
|
* @note This function must be used only when the PLLI2S is disabled.
|
|
|
* @note PLLI2S clock source is common with the main PLL (configured in
|
|
* @note PLLI2S clock source is common with the main PLL (configured in
|
|
|
* RCC_PLLConfig function )
|
|
* RCC_PLLConfig function )
|
|
@@ -490,6 +521,44 @@ void RCC_PLLI2SConfig(uint32_t PLLI2SN, uint32_t PLLI2SR)
|
|
|
|
|
|
|
|
RCC->PLLI2SCFGR = (PLLI2SN << 6) | (PLLI2SR << 28);
|
|
RCC->PLLI2SCFGR = (PLLI2SN << 6) | (PLLI2SR << 28);
|
|
|
}
|
|
}
|
|
|
|
|
+#endif /* STM32F40_41xxx || STM32F401xx */
|
|
|
|
|
+
|
|
|
|
|
+#if defined (STM32F427_437xx) || defined (STM32F429_439xx)
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures the PLLI2S clock multiplication and division factors.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be used only when the PLLI2S is disabled.
|
|
|
|
|
+ * @note PLLI2S clock source is common with the main PLL (configured in
|
|
|
|
|
+ * RCC_PLLConfig function )
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param PLLI2SN: specifies the multiplication factor for PLLI2S VCO output clock
|
|
|
|
|
+ * This parameter must be a number between 192 and 432.
|
|
|
|
|
+ * @note You have to set the PLLI2SN parameter correctly to ensure that the VCO
|
|
|
|
|
+ * output frequency is between 192 and 432 MHz.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param PLLI2SQ: specifies the division factor for SAI1 clock
|
|
|
|
|
+ * This parameter must be a number between 2 and 15.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param PLLI2SR: specifies the division factor for I2S clock
|
|
|
|
|
+ * This parameter must be a number between 2 and 7.
|
|
|
|
|
+ * @note You have to set the PLLI2SR parameter correctly to not exceed 192 MHz
|
|
|
|
|
+ * on the I2S clock frequency.
|
|
|
|
|
+ * @note the PLLI2SR parameter is only available with STM32F42xxx/43xxx devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_PLLI2SConfig(uint32_t PLLI2SN, uint32_t PLLI2SQ, uint32_t PLLI2SR)
|
|
|
|
|
+{
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_PLLI2SN_VALUE(PLLI2SN));
|
|
|
|
|
+ assert_param(IS_RCC_PLLI2SQ_VALUE(PLLI2SQ));
|
|
|
|
|
+ assert_param(IS_RCC_PLLI2SR_VALUE(PLLI2SR));
|
|
|
|
|
+
|
|
|
|
|
+ RCC->PLLI2SCFGR = (PLLI2SN << 6) | (PLLI2SQ << 24) | (PLLI2SR << 28);
|
|
|
|
|
+}
|
|
|
|
|
+#endif /* STM32F427_437xx || STM32F429_439xx */
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Enables or disables the PLLI2S.
|
|
* @brief Enables or disables the PLLI2S.
|
|
@@ -504,6 +573,53 @@ void RCC_PLLI2SCmd(FunctionalState NewState)
|
|
|
*(__IO uint32_t *) CR_PLLI2SON_BB = (uint32_t)NewState;
|
|
*(__IO uint32_t *) CR_PLLI2SON_BB = (uint32_t)NewState;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures the PLLSAI clock multiplication and division factors.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be used only when the PLLSAI is disabled.
|
|
|
|
|
+ * @note PLLSAI clock source is common with the main PLL (configured in
|
|
|
|
|
+ * RCC_PLLConfig function )
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param PLLSAIN: specifies the multiplication factor for PLLSAI VCO output clock
|
|
|
|
|
+ * This parameter must be a number between 192 and 432.
|
|
|
|
|
+ * @note You have to set the PLLSAIN parameter correctly to ensure that the VCO
|
|
|
|
|
+ * output frequency is between 192 and 432 MHz.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param PLLSAIQ: specifies the division factor for SAI1 clock
|
|
|
|
|
+ * This parameter must be a number between 2 and 15.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param PLLSAIR: specifies the division factor for LTDC clock
|
|
|
|
|
+ * This parameter must be a number between 2 and 7.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_PLLSAIConfig(uint32_t PLLSAIN, uint32_t PLLSAIQ, uint32_t PLLSAIR)
|
|
|
|
|
+{
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_PLLSAIN_VALUE(PLLSAIN));
|
|
|
|
|
+ assert_param(IS_RCC_PLLSAIR_VALUE(PLLSAIR));
|
|
|
|
|
+
|
|
|
|
|
+ RCC->PLLSAICFGR = (PLLSAIN << 6) | (PLLSAIQ << 24) | (PLLSAIR << 28);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Enables or disables the PLLSAI.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note The PLLSAI is disabled by hardware when entering STOP and STANDBY modes.
|
|
|
|
|
+ * @param NewState: new state of the PLLSAI. This parameter can be: ENABLE or DISABLE.
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_PLLSAICmd(FunctionalState NewState)
|
|
|
|
|
+{
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_FUNCTIONAL_STATE(NewState));
|
|
|
|
|
+ *(__IO uint32_t *) CR_PLLSAION_BB = (uint32_t)NewState;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Enables or disables the Clock Security System.
|
|
* @brief Enables or disables the Clock Security System.
|
|
|
* @note If a failure is detected on the HSE oscillator clock, this oscillator
|
|
* @note If a failure is detected on the HSE oscillator clock, this oscillator
|
|
@@ -607,59 +723,119 @@ void RCC_MCO2Config(uint32_t RCC_MCO2Source, uint32_t RCC_MCO2Div)
|
|
|
*
|
|
*
|
|
|
@verbatim
|
|
@verbatim
|
|
|
===============================================================================
|
|
===============================================================================
|
|
|
- System, AHB and APB busses clocks configuration functions
|
|
|
|
|
|
|
+ ##### System, AHB and APB busses clocks configuration functions #####
|
|
|
===============================================================================
|
|
===============================================================================
|
|
|
-
|
|
|
|
|
- This section provide functions allowing to configure the System, AHB, APB1 and
|
|
|
|
|
- APB2 busses clocks.
|
|
|
|
|
|
|
+ [..]
|
|
|
|
|
+ This section provide functions allowing to configure the System, AHB, APB1 and
|
|
|
|
|
+ APB2 busses clocks.
|
|
|
|
|
|
|
|
- 1. Several clock sources can be used to drive the System clock (SYSCLK): HSI,
|
|
|
|
|
- HSE and PLL.
|
|
|
|
|
- The AHB clock (HCLK) is derived from System clock through configurable prescaler
|
|
|
|
|
- and used to clock the CPU, memory and peripherals mapped on AHB bus (DMA, GPIO...).
|
|
|
|
|
- APB1 (PCLK1) and APB2 (PCLK2) clocks are derived from AHB clock through
|
|
|
|
|
- configurable prescalers and used to clock the peripherals mapped on these busses.
|
|
|
|
|
- You can use "RCC_GetClocksFreq()" function to retrieve the frequencies of these clocks.
|
|
|
|
|
-
|
|
|
|
|
-@note All the peripheral clocks are derived from the System clock (SYSCLK) except:
|
|
|
|
|
- - I2S: the I2S clock can be derived either from a specific PLL (PLLI2S) or
|
|
|
|
|
- from an external clock mapped on the I2S_CKIN pin.
|
|
|
|
|
- You have to use RCC_I2SCLKConfig() function to configure this clock.
|
|
|
|
|
- - RTC: the RTC clock can be derived either from the LSI, LSE or HSE clock
|
|
|
|
|
- divided by 2 to 31. You have to use RCC_RTCCLKConfig() and RCC_RTCCLKCmd()
|
|
|
|
|
- functions to configure this clock.
|
|
|
|
|
- - USB OTG FS, SDIO and RTC: USB OTG FS require a frequency equal to 48 MHz
|
|
|
|
|
- to work correctly, while the SDIO require a frequency equal or lower than
|
|
|
|
|
- to 48. This clock is derived of the main PLL through PLLQ divider.
|
|
|
|
|
- - IWDG clock which is always the LSI clock.
|
|
|
|
|
|
|
+ (#) Several clock sources can be used to drive the System clock (SYSCLK): HSI,
|
|
|
|
|
+ HSE and PLL.
|
|
|
|
|
+ The AHB clock (HCLK) is derived from System clock through configurable
|
|
|
|
|
+ prescaler and used to clock the CPU, memory and peripherals mapped
|
|
|
|
|
+ on AHB bus (DMA, GPIO...). APB1 (PCLK1) and APB2 (PCLK2) clocks are derived
|
|
|
|
|
+ from AHB clock through configurable prescalers and used to clock
|
|
|
|
|
+ the peripherals mapped on these busses. You can use
|
|
|
|
|
+ "RCC_GetClocksFreq()" function to retrieve the frequencies of these clocks.
|
|
|
|
|
+
|
|
|
|
|
+ -@- All the peripheral clocks are derived from the System clock (SYSCLK) except:
|
|
|
|
|
+ (+@) I2S: the I2S clock can be derived either from a specific PLL (PLLI2S) or
|
|
|
|
|
+ from an external clock mapped on the I2S_CKIN pin.
|
|
|
|
|
+ You have to use RCC_I2SCLKConfig() function to configure this clock.
|
|
|
|
|
+ (+@) RTC: the RTC clock can be derived either from the LSI, LSE or HSE clock
|
|
|
|
|
+ divided by 2 to 31. You have to use RCC_RTCCLKConfig() and RCC_RTCCLKCmd()
|
|
|
|
|
+ functions to configure this clock.
|
|
|
|
|
+ (+@) USB OTG FS, SDIO and RTC: USB OTG FS require a frequency equal to 48 MHz
|
|
|
|
|
+ to work correctly, while the SDIO require a frequency equal or lower than
|
|
|
|
|
+ to 48. This clock is derived of the main PLL through PLLQ divider.
|
|
|
|
|
+ (+@) IWDG clock which is always the LSI clock.
|
|
|
|
|
|
|
|
- 2. The maximum frequency of the SYSCLK and HCLK is 168 MHz, PCLK2 82 MHz and PCLK1 42 MHz.
|
|
|
|
|
- Depending on the device voltage range, the maximum frequency should be
|
|
|
|
|
- adapted accordingly:
|
|
|
|
|
|
|
+ (#) For STM32F405xx/407xx and STM32F415xx/417xx devices, the maximum frequency
|
|
|
|
|
+ of the SYSCLK and HCLK is 168 MHz, PCLK2 84 MHz and PCLK1 42 MHz. Depending
|
|
|
|
|
+ on the device voltage range, the maximum frequency should be adapted accordingly:
|
|
|
|
|
+ +-------------------------------------------------------------------------------------+
|
|
|
|
|
+ | Latency | HCLK clock frequency (MHz) |
|
|
|
|
|
+ | |---------------------------------------------------------------------|
|
|
|
|
|
+ | | voltage range | voltage range | voltage range | voltage range |
|
|
|
|
|
+ | | 2.7 V - 3.6 V | 2.4 V - 2.7 V | 2.1 V - 2.4 V | 1.8 V - 2.1 V |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |0WS(1CPU cycle)|0 < HCLK <= 30 |0 < HCLK <= 24 |0 < HCLK <= 22 |0 < HCLK <= 20 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |1WS(2CPU cycle)|30 < HCLK <= 60 |24 < HCLK <= 48 |22 < HCLK <= 44 |20 < HCLK <= 40 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |2WS(3CPU cycle)|60 < HCLK <= 90 |48 < HCLK <= 72 |44 < HCLK <= 66 |40 < HCLK <= 60 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |3WS(4CPU cycle)|90 < HCLK <= 120|72 < HCLK <= 96 |66 < HCLK <= 88 |60 < HCLK <= 80 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |4WS(5CPU cycle)|120< HCLK <= 150|96 < HCLK <= 120|88 < HCLK <= 110 |80 < HCLK <= 100 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |5WS(6CPU cycle)|150< HCLK <= 168|120< HCLK <= 144|110 < HCLK <= 132|100 < HCLK <= 120|
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |6WS(7CPU cycle)| NA |144< HCLK <= 168|132 < HCLK <= 154|120 < HCLK <= 140|
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |7WS(8CPU cycle)| NA | NA |154 < HCLK <= 168|140 < HCLK <= 160|
|
|
|
|
|
+ +---------------|----------------|----------------|-----------------|-----------------+
|
|
|
|
|
+ (#) For STM32F42xxx/43xxx devices, the maximum frequency of the SYSCLK and HCLK is 180 MHz,
|
|
|
|
|
+ PCLK2 90 MHz and PCLK1 45 MHz. Depending on the device voltage range, the maximum
|
|
|
|
|
+ frequency should be adapted accordingly:
|
|
|
+-------------------------------------------------------------------------------------+
|
|
+-------------------------------------------------------------------------------------+
|
|
|
| Latency | HCLK clock frequency (MHz) |
|
|
| Latency | HCLK clock frequency (MHz) |
|
|
|
| |---------------------------------------------------------------------|
|
|
| |---------------------------------------------------------------------|
|
|
|
| | voltage range | voltage range | voltage range | voltage range |
|
|
| | voltage range | voltage range | voltage range | voltage range |
|
|
|
| | 2.7 V - 3.6 V | 2.4 V - 2.7 V | 2.1 V - 2.4 V | 1.8 V - 2.1 V |
|
|
| | 2.7 V - 3.6 V | 2.4 V - 2.7 V | 2.1 V - 2.4 V | 1.8 V - 2.1 V |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |0WS(1CPU cycle)|0 < HCLK <= 30 |0 < HCLK <= 24 |0 < HCLK <= 18 |0 < HCLK <= 16 |
|
|
|
|
|
|
|
+ |0WS(1CPU cycle)|0 < HCLK <= 30 |0 < HCLK <= 24 |0 < HCLK <= 22 |0 < HCLK <= 20 |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |1WS(2CPU cycle)|30 < HCLK <= 60 |24 < HCLK <= 48 |18 < HCLK <= 36 |16 < HCLK <= 32 |
|
|
|
|
|
|
|
+ |1WS(2CPU cycle)|30 < HCLK <= 60 |24 < HCLK <= 48 |22 < HCLK <= 44 |20 < HCLK <= 40 |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |2WS(3CPU cycle)|60 < HCLK <= 90 |48 < HCLK <= 72 |36 < HCLK <= 54 |32 < HCLK <= 48 |
|
|
|
|
|
|
|
+ |2WS(3CPU cycle)|60 < HCLK <= 90 |48 < HCLK <= 72 |44 < HCLK <= 66 |40 < HCLK <= 60 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |3WS(4CPU cycle)|90 < HCLK <= 120|72 < HCLK <= 96 |66 < HCLK <= 88 |60 < HCLK <= 80 |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |3WS(4CPU cycle)|90 < HCLK <= 120|72 < HCLK <= 96 |54 < HCLK <= 72 |48 < HCLK <= 64 |
|
|
|
|
|
|
|
+ |4WS(5CPU cycle)|120< HCLK <= 150|96 < HCLK <= 120|88 < HCLK <= 110 |80 < HCLK <= 100 |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |4WS(5CPU cycle)|120< HCLK <= 150|96 < HCLK <= 120|72 < HCLK <= 90 |64 < HCLK <= 80 |
|
|
|
|
|
|
|
+ |5WS(6CPU cycle)|120< HCLK <= 180|120< HCLK <= 144|110 < HCLK <= 132|100 < HCLK <= 120|
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |5WS(6CPU cycle)|120< HCLK <= 168|120< HCLK <= 144|90 < HCLK <= 108 |80 < HCLK <= 96 |
|
|
|
|
|
|
|
+ |6WS(7CPU cycle)| NA |144< HCLK <= 168|132 < HCLK <= 154|120 < HCLK <= 140|
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |7WS(8CPU cycle)| NA |168< HCLK <= 180|154 < HCLK <= 176|140 < HCLK <= 160|
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |8WS(9CPU cycle)| NA | NA |176 < HCLK <= 180|160 < HCLK <= 168|
|
|
|
|
|
+ +-------------------------------------------------------------------------------------+
|
|
|
|
|
+
|
|
|
|
|
+ (#) For STM32F401xx devices, the maximum frequency of the SYSCLK and HCLK is 84 MHz,
|
|
|
|
|
+ PCLK2 84 MHz and PCLK1 42 MHz. Depending on the device voltage range, the maximum
|
|
|
|
|
+ frequency should be adapted accordingly:
|
|
|
|
|
+ +-------------------------------------------------------------------------------------+
|
|
|
|
|
+ | Latency | HCLK clock frequency (MHz) |
|
|
|
|
|
+ | |---------------------------------------------------------------------|
|
|
|
|
|
+ | | voltage range | voltage range | voltage range | voltage range |
|
|
|
|
|
+ | | 2.7 V - 3.6 V | 2.4 V - 2.7 V | 2.1 V - 2.4 V | 1.8 V - 2.1 V |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |0WS(1CPU cycle)|0 < HCLK <= 30 |0 < HCLK <= 24 |0 < HCLK <= 22 |0 < HCLK <= 20 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |1WS(2CPU cycle)|30 < HCLK <= 60 |24 < HCLK <= 48 |22 < HCLK <= 44 |20 < HCLK <= 40 |
|
|
|
|
|
+ |---------------|----------------|----------------|-----------------|-----------------|
|
|
|
|
|
+ |2WS(3CPU cycle)|60 < HCLK <= 84 |48 < HCLK <= 72 |44 < HCLK <= 66 |40 < HCLK <= 60 |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |6WS(7CPU cycle)| NA |144< HCLK <= 168|108 < HCLK <= 120|96 < HCLK <= 112 |
|
|
|
|
|
|
|
+ |3WS(4CPU cycle)| NA |72 < HCLK <= 84 |66 < HCLK <= 84 |60 < HCLK <= 80 |
|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|---------------|----------------|----------------|-----------------|-----------------|
|
|
|
- |7WS(8CPU cycle)| NA | NA |120 < HCLK <= 138|112 < HCLK <= 120|
|
|
|
|
|
- +-------------------------------------------------------------------------------------+
|
|
|
|
|
- @note When VOS bit (in PWR_CR register) is reset to '0’, the maximum value of HCLK is 144 MHz.
|
|
|
|
|
- You can use PWR_MainRegulatorModeConfig() function to set or reset this bit.
|
|
|
|
|
|
|
+ |4WS(5CPU cycle)| NA | NA | NA |80 < HCLK <= 84 |
|
|
|
|
|
+ +-------------------------------------------------------------------------------------+
|
|
|
|
|
+
|
|
|
|
|
+ -@- On STM32F405xx/407xx and STM32F415xx/417xx devices:
|
|
|
|
|
+ (++) when VOS = '0', the maximum value of fHCLK = 144MHz.
|
|
|
|
|
+ (++) when VOS = '1', the maximum value of fHCLK = 168MHz.
|
|
|
|
|
+ [..]
|
|
|
|
|
+ On STM32F42xxx/43xxx devices:
|
|
|
|
|
+ (++) when VOS[1:0] = '0x01', the maximum value of fHCLK is 120MHz.
|
|
|
|
|
+ (++) when VOS[1:0] = '0x10', the maximum value of fHCLK is 144MHz.
|
|
|
|
|
+ (++) when VOS[1:0] = '0x11', the maximum value of f is 168MHz
|
|
|
|
|
+ [..]
|
|
|
|
|
+ On STM32F401x devices:
|
|
|
|
|
+ (++) when VOS[1:0] = '0x01', the maximum value of fHCLK is 64MHz.
|
|
|
|
|
+ (++) when VOS[1:0] = '0x10', the maximum value of fHCLK is 84MHz.
|
|
|
|
|
+ You can use PWR_MainRegulatorModeConfig() function to control VOS bits.
|
|
|
|
|
|
|
|
@endverbatim
|
|
@endverbatim
|
|
|
* @{
|
|
* @{
|
|
@@ -926,26 +1102,26 @@ void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)
|
|
|
*
|
|
*
|
|
|
@verbatim
|
|
@verbatim
|
|
|
===============================================================================
|
|
===============================================================================
|
|
|
- Peripheral clocks configuration functions
|
|
|
|
|
|
|
+ ##### Peripheral clocks configuration functions #####
|
|
|
===============================================================================
|
|
===============================================================================
|
|
|
-
|
|
|
|
|
- This section provide functions allowing to configure the Peripheral clocks.
|
|
|
|
|
|
|
+ [..] 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.
|
|
|
|
|
|
|
+ (#) 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.
|
|
|
|
|
|
|
+ (#) 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.
|
|
|
|
|
+
|
|
|
|
|
+ (#) 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.
|
|
|
|
|
|
|
+ (#) 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.
|
|
|
|
|
|
|
|
@endverbatim
|
|
@endverbatim
|
|
|
* @{
|
|
* @{
|
|
@@ -1051,6 +1227,202 @@ void RCC_I2SCLKConfig(uint32_t RCC_I2SCLKSource)
|
|
|
*(__IO uint32_t *) CFGR_I2SSRC_BB = RCC_I2SCLKSource;
|
|
*(__IO uint32_t *) CFGR_I2SSRC_BB = RCC_I2SCLKSource;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures the SAI clock Divider coming from PLLI2S.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be called before enabling the PLLI2S.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param RCC_PLLI2SDivQ: specifies the PLLI2S division factor for SAI1 clock .
|
|
|
|
|
+ * This parameter must be a number between 1 and 32.
|
|
|
|
|
+ * SAI1 clock frequency = f(PLLI2S_Q) / RCC_PLLI2SDivQ
|
|
|
|
|
+ *
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_SAIPLLI2SClkDivConfig(uint32_t RCC_PLLI2SDivQ)
|
|
|
|
|
+{
|
|
|
|
|
+ uint32_t tmpreg = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_PLLI2S_DIVQ_VALUE(RCC_PLLI2SDivQ));
|
|
|
|
|
+
|
|
|
|
|
+ tmpreg = RCC->DCKCFGR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Clear PLLI2SDIVQ[4:0] bits */
|
|
|
|
|
+ tmpreg &= ~(RCC_DCKCFGR_PLLI2SDIVQ);
|
|
|
|
|
+
|
|
|
|
|
+ /* Set PLLI2SDIVQ values */
|
|
|
|
|
+ tmpreg |= (RCC_PLLI2SDivQ - 1);
|
|
|
|
|
+
|
|
|
|
|
+ /* Store the new value */
|
|
|
|
|
+ RCC->DCKCFGR = tmpreg;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures the SAI clock Divider coming from PLLSAI.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be called before enabling the PLLSAI.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param RCC_PLLSAIDivQ: specifies the PLLSAI division factor for SAI1 clock .
|
|
|
|
|
+ * This parameter must be a number between 1 and 32.
|
|
|
|
|
+ * SAI1 clock frequency = f(PLLSAI_Q) / RCC_PLLSAIDivQ
|
|
|
|
|
+ *
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_SAIPLLSAIClkDivConfig(uint32_t RCC_PLLSAIDivQ)
|
|
|
|
|
+{
|
|
|
|
|
+ uint32_t tmpreg = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_PLLSAI_DIVQ_VALUE(RCC_PLLSAIDivQ));
|
|
|
|
|
+
|
|
|
|
|
+ tmpreg = RCC->DCKCFGR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Clear PLLI2SDIVQ[4:0] and PLLSAIDIVQ[4:0] bits */
|
|
|
|
|
+ tmpreg &= ~(RCC_DCKCFGR_PLLSAIDIVQ);
|
|
|
|
|
+
|
|
|
|
|
+ /* Set PLLSAIDIVQ values */
|
|
|
|
|
+ tmpreg |= ((RCC_PLLSAIDivQ - 1) << 8);
|
|
|
|
|
+
|
|
|
|
|
+ /* Store the new value */
|
|
|
|
|
+ RCC->DCKCFGR = tmpreg;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures SAI1BlockA clock source selection.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be called before enabling PLLSAI, PLLI2S and
|
|
|
|
|
+ * the SAI clock.
|
|
|
|
|
+ * @param RCC_SAIBlockACLKSource: specifies the SAI Block A clock source.
|
|
|
|
|
+ * This parameter can be one of the following values:
|
|
|
|
|
+ * @arg RCC_SAIACLKSource_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used
|
|
|
|
|
+ * as SAI1 Block A clock
|
|
|
|
|
+ * @arg RCC_SAIACLKSource_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used
|
|
|
|
|
+ * as SAI1 Block A clock
|
|
|
|
|
+ * @arg RCC_SAIACLKSource_Ext: External clock mapped on the I2S_CKIN pin
|
|
|
|
|
+ * used as SAI1 Block A clock
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_SAIBlockACLKConfig(uint32_t RCC_SAIBlockACLKSource)
|
|
|
|
|
+{
|
|
|
|
|
+ uint32_t tmpreg = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_SAIACLK_SOURCE(RCC_SAIBlockACLKSource));
|
|
|
|
|
+
|
|
|
|
|
+ tmpreg = RCC->DCKCFGR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Clear RCC_DCKCFGR_SAI1ASRC[1:0] bits */
|
|
|
|
|
+ tmpreg &= ~RCC_DCKCFGR_SAI1ASRC;
|
|
|
|
|
+
|
|
|
|
|
+ /* Set SAI Block A source selection value */
|
|
|
|
|
+ tmpreg |= RCC_SAIBlockACLKSource;
|
|
|
|
|
+
|
|
|
|
|
+ /* Store the new value */
|
|
|
|
|
+ RCC->DCKCFGR = tmpreg;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures SAI1BlockB clock source selection.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be called before enabling PLLSAI, PLLI2S and
|
|
|
|
|
+ * the SAI clock.
|
|
|
|
|
+ * @param RCC_SAIBlockBCLKSource: specifies the SAI Block B clock source.
|
|
|
|
|
+ * This parameter can be one of the following values:
|
|
|
|
|
+ * @arg RCC_SAIBCLKSource_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used
|
|
|
|
|
+ * as SAI1 Block B clock
|
|
|
|
|
+ * @arg RCC_SAIBCLKSource_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used
|
|
|
|
|
+ * as SAI1 Block B clock
|
|
|
|
|
+ * @arg RCC_SAIBCLKSource_Ext: External clock mapped on the I2S_CKIN pin
|
|
|
|
|
+ * used as SAI1 Block B clock
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_SAIBlockBCLKConfig(uint32_t RCC_SAIBlockBCLKSource)
|
|
|
|
|
+{
|
|
|
|
|
+ uint32_t tmpreg = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_SAIBCLK_SOURCE(RCC_SAIBlockBCLKSource));
|
|
|
|
|
+
|
|
|
|
|
+ tmpreg = RCC->DCKCFGR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Clear RCC_DCKCFGR_SAI1BSRC[1:0] bits */
|
|
|
|
|
+ tmpreg &= ~RCC_DCKCFGR_SAI1BSRC;
|
|
|
|
|
+
|
|
|
|
|
+ /* Set SAI Block B source selection value */
|
|
|
|
|
+ tmpreg |= RCC_SAIBlockBCLKSource;
|
|
|
|
|
+
|
|
|
|
|
+ /* Store the new value */
|
|
|
|
|
+ RCC->DCKCFGR = tmpreg;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures the LTDC clock Divider coming from PLLSAI.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note The LTDC peripheral is only available with STM32F429xx/439xx Devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function must be called before enabling the PLLSAI.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param RCC_PLLSAIDivR: specifies the PLLSAI division factor for LTDC clock .
|
|
|
|
|
+ * This parameter must be a number between 2 and 16.
|
|
|
|
|
+ * LTDC clock frequency = f(PLLSAI_R) / RCC_PLLSAIDivR
|
|
|
|
|
+ *
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_LTDCCLKDivConfig(uint32_t RCC_PLLSAIDivR)
|
|
|
|
|
+{
|
|
|
|
|
+ uint32_t tmpreg = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_PLLSAI_DIVR_VALUE(RCC_PLLSAIDivR));
|
|
|
|
|
+
|
|
|
|
|
+ tmpreg = RCC->DCKCFGR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Clear PLLSAIDIVR[2:0] bits */
|
|
|
|
|
+ tmpreg &= ~RCC_DCKCFGR_PLLSAIDIVR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Set PLLSAIDIVR values */
|
|
|
|
|
+ tmpreg |= RCC_PLLSAIDivR;
|
|
|
|
|
+
|
|
|
|
|
+ /* Store the new value */
|
|
|
|
|
+ RCC->DCKCFGR = tmpreg;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @brief Configures the Timers clocks prescalers selection.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note This function can be used only for STM32F42xxx/43xxx and STM32F401xx devices.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param RCC_TIMCLKPrescaler : specifies the Timers clocks prescalers selection
|
|
|
|
|
+ * This parameter can be one of the following values:
|
|
|
|
|
+ * @arg RCC_TIMPrescDesactivated: The Timers kernels clocks prescaler is
|
|
|
|
|
+ * equal to HPRE if PPREx is corresponding to division by 1 or 2,
|
|
|
|
|
+ * else it is equal to [(HPRE * PPREx) / 2] if PPREx is corresponding to
|
|
|
|
|
+ * division by 4 or more.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @arg RCC_TIMPrescActivated: The Timers kernels clocks prescaler is
|
|
|
|
|
+ * equal to HPRE if PPREx is corresponding to division by 1, 2 or 4,
|
|
|
|
|
+ * else it is equal to [(HPRE * PPREx) / 4] if PPREx is corresponding
|
|
|
|
|
+ * to division by 8 or more.
|
|
|
|
|
+ * @retval None
|
|
|
|
|
+ */
|
|
|
|
|
+void RCC_TIMCLKPresConfig(uint32_t RCC_TIMCLKPrescaler)
|
|
|
|
|
+{
|
|
|
|
|
+ /* Check the parameters */
|
|
|
|
|
+ assert_param(IS_RCC_TIMCLK_PRESCALER(RCC_TIMCLKPrescaler));
|
|
|
|
|
+
|
|
|
|
|
+ *(__IO uint32_t *) DCKCFGR_TIMPRE_BB = RCC_TIMCLKPrescaler;
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Enables or disables the AHB1 peripheral clock.
|
|
* @brief Enables or disables the AHB1 peripheral clock.
|
|
|
* @note After reset, the peripheral clock (used for registers read/write access)
|
|
* @note After reset, the peripheral clock (used for registers read/write access)
|
|
@@ -1067,11 +1439,14 @@ void RCC_I2SCLKConfig(uint32_t RCC_I2SCLKSource)
|
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
|
* @arg RCC_AHB1Periph_GPIOI: GPIOI clock
|
|
* @arg RCC_AHB1Periph_GPIOI: GPIOI clock
|
|
|
|
|
+ * @arg RCC_AHB1Periph_GPIOJ: GPIOJ clock (STM32F42xxx/43xxx devices)
|
|
|
|
|
+ * @arg RCC_AHB1Periph_GPIOK: GPIOK clock (STM32F42xxx/43xxx devices)
|
|
|
* @arg RCC_AHB1Periph_CRC: CRC clock
|
|
* @arg RCC_AHB1Periph_CRC: CRC clock
|
|
|
* @arg RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
|
|
* @arg RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
|
|
|
* @arg RCC_AHB1Periph_CCMDATARAMEN CCM data RAM interface clock
|
|
* @arg RCC_AHB1Periph_CCMDATARAMEN CCM data RAM interface clock
|
|
|
* @arg RCC_AHB1Periph_DMA1: DMA1 clock
|
|
* @arg RCC_AHB1Periph_DMA1: DMA1 clock
|
|
|
* @arg RCC_AHB1Periph_DMA2: DMA2 clock
|
|
* @arg RCC_AHB1Periph_DMA2: DMA2 clock
|
|
|
|
|
+ * @arg RCC_AHB1Periph_DMA2D: DMA2D clock (STM32F429xx/439xx devices)
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
|
|
@@ -1137,6 +1512,7 @@ void RCC_AHB2PeriphClockCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState)
|
|
|
* using it.
|
|
* using it.
|
|
|
* @param RCC_AHBPeriph: specifies the AHB3 peripheral to gates its clock.
|
|
* @param RCC_AHBPeriph: specifies the AHB3 peripheral to gates its clock.
|
|
|
* This parameter must be: RCC_AHB3Periph_FSMC
|
|
* This parameter must be: RCC_AHB3Periph_FSMC
|
|
|
|
|
+ * or RCC_AHB3Periph_FMC (STM32F42xxx/43xxx devices)
|
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1187,6 +1563,8 @@ void RCC_AHB3PeriphClockCmd(uint32_t RCC_AHB3Periph, FunctionalState NewState)
|
|
|
* @arg RCC_APB1Periph_CAN2: CAN2 clock
|
|
* @arg RCC_APB1Periph_CAN2: CAN2 clock
|
|
|
* @arg RCC_APB1Periph_PWR: PWR clock
|
|
* @arg RCC_APB1Periph_PWR: PWR clock
|
|
|
* @arg RCC_APB1Periph_DAC: DAC clock
|
|
* @arg RCC_APB1Periph_DAC: DAC clock
|
|
|
|
|
+ * @arg RCC_APB1Periph_UART7: UART7 clock
|
|
|
|
|
+ * @arg RCC_APB1Periph_UART8: UART8 clock
|
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1223,10 +1601,15 @@ void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
|
|
|
* @arg RCC_APB2Periph_ADC3: ADC3 clock
|
|
* @arg RCC_APB2Periph_ADC3: ADC3 clock
|
|
|
* @arg RCC_APB2Periph_SDIO: SDIO clock
|
|
* @arg RCC_APB2Periph_SDIO: SDIO clock
|
|
|
* @arg RCC_APB2Periph_SPI1: SPI1 clock
|
|
* @arg RCC_APB2Periph_SPI1: SPI1 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI4: SPI4 clock
|
|
|
* @arg RCC_APB2Periph_SYSCFG: SYSCFG clock
|
|
* @arg RCC_APB2Periph_SYSCFG: SYSCFG clock
|
|
|
* @arg RCC_APB2Periph_TIM9: TIM9 clock
|
|
* @arg RCC_APB2Periph_TIM9: TIM9 clock
|
|
|
* @arg RCC_APB2Periph_TIM10: TIM10 clock
|
|
* @arg RCC_APB2Periph_TIM10: TIM10 clock
|
|
|
* @arg RCC_APB2Periph_TIM11: TIM11 clock
|
|
* @arg RCC_APB2Periph_TIM11: TIM11 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI5: SPI5 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI6: SPI6 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SAI1: SAI1 clock (STM32F42xxx/43xxx devices)
|
|
|
|
|
+ * @arg RCC_APB2Periph_LTDC: LTDC clock (STM32F429xx/439xx devices)
|
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1260,9 +1643,12 @@ void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
|
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
|
* @arg RCC_AHB1Periph_GPIOI: GPIOI clock
|
|
* @arg RCC_AHB1Periph_GPIOI: GPIOI clock
|
|
|
|
|
+ * @arg RCC_AHB1Periph_GPIOJ: GPIOJ clock (STM32F42xxx/43xxx devices)
|
|
|
|
|
+ * @arg RCC_AHB1Periph_GPIOK: GPIOK clock (STM32F42xxx/43xxxdevices)
|
|
|
* @arg RCC_AHB1Periph_CRC: CRC clock
|
|
* @arg RCC_AHB1Periph_CRC: CRC clock
|
|
|
* @arg RCC_AHB1Periph_DMA1: DMA1 clock
|
|
* @arg RCC_AHB1Periph_DMA1: DMA1 clock
|
|
|
* @arg RCC_AHB1Periph_DMA2: DMA2 clock
|
|
* @arg RCC_AHB1Periph_DMA2: DMA2 clock
|
|
|
|
|
+ * @arg RCC_AHB1Periph_DMA2D: DMA2D clock (STM32F429xx/439xx devices)
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
|
|
|
* @arg RCC_AHB1Periph_OTG_HS: USB OTG HS clock
|
|
* @arg RCC_AHB1Periph_OTG_HS: USB OTG HS clock
|
|
|
*
|
|
*
|
|
@@ -1319,6 +1705,7 @@ void RCC_AHB2PeriphResetCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState)
|
|
|
* @brief Forces or releases AHB3 peripheral reset.
|
|
* @brief Forces or releases AHB3 peripheral reset.
|
|
|
* @param RCC_AHB3Periph: specifies the AHB3 peripheral to reset.
|
|
* @param RCC_AHB3Periph: specifies the AHB3 peripheral to reset.
|
|
|
* This parameter must be: RCC_AHB3Periph_FSMC
|
|
* This parameter must be: RCC_AHB3Periph_FSMC
|
|
|
|
|
+ * or RCC_AHB3Periph_FMC (STM32F42xxx/43xxx devices)
|
|
|
* @param NewState: new state of the specified peripheral reset.
|
|
* @param NewState: new state of the specified peripheral reset.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1366,6 +1753,8 @@ void RCC_AHB3PeriphResetCmd(uint32_t RCC_AHB3Periph, FunctionalState NewState)
|
|
|
* @arg RCC_APB1Periph_CAN2: CAN2 clock
|
|
* @arg RCC_APB1Periph_CAN2: CAN2 clock
|
|
|
* @arg RCC_APB1Periph_PWR: PWR clock
|
|
* @arg RCC_APB1Periph_PWR: PWR clock
|
|
|
* @arg RCC_APB1Periph_DAC: DAC clock
|
|
* @arg RCC_APB1Periph_DAC: DAC clock
|
|
|
|
|
+ * @arg RCC_APB1Periph_UART7: UART7 clock
|
|
|
|
|
+ * @arg RCC_APB1Periph_UART8: UART8 clock
|
|
|
* @param NewState: new state of the specified peripheral reset.
|
|
* @param NewState: new state of the specified peripheral reset.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1398,10 +1787,15 @@ void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
|
|
|
* @arg RCC_APB2Periph_ADC3: ADC3 clock
|
|
* @arg RCC_APB2Periph_ADC3: ADC3 clock
|
|
|
* @arg RCC_APB2Periph_SDIO: SDIO clock
|
|
* @arg RCC_APB2Periph_SDIO: SDIO clock
|
|
|
* @arg RCC_APB2Periph_SPI1: SPI1 clock
|
|
* @arg RCC_APB2Periph_SPI1: SPI1 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI4: SPI4 clock
|
|
|
* @arg RCC_APB2Periph_SYSCFG: SYSCFG clock
|
|
* @arg RCC_APB2Periph_SYSCFG: SYSCFG clock
|
|
|
* @arg RCC_APB2Periph_TIM9: TIM9 clock
|
|
* @arg RCC_APB2Periph_TIM9: TIM9 clock
|
|
|
* @arg RCC_APB2Periph_TIM10: TIM10 clock
|
|
* @arg RCC_APB2Periph_TIM10: TIM10 clock
|
|
|
* @arg RCC_APB2Periph_TIM11: TIM11 clock
|
|
* @arg RCC_APB2Periph_TIM11: TIM11 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI5: SPI5 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI6: SPI6 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SAI1: SAI1 clock (STM32F42xxx/43xxx devices)
|
|
|
|
|
+ * @arg RCC_APB2Periph_LTDC: LTDC clock (STM32F429xx/439xx devices)
|
|
|
* @param NewState: new state of the specified peripheral reset.
|
|
* @param NewState: new state of the specified peripheral reset.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1438,10 +1832,13 @@ void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
|
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
* @arg RCC_AHB1Periph_GPIOG: GPIOG clock
|
|
|
* @arg RCC_AHB1Periph_GPIOI: GPIOI clock
|
|
* @arg RCC_AHB1Periph_GPIOI: GPIOI clock
|
|
|
|
|
+ * @arg RCC_AHB1Periph_GPIOJ: GPIOJ clock (STM32F42xxx/43xxx devices)
|
|
|
|
|
+ * @arg RCC_AHB1Periph_GPIOK: GPIOK clock (STM32F42xxx/43xxx devices)
|
|
|
* @arg RCC_AHB1Periph_CRC: CRC clock
|
|
* @arg RCC_AHB1Periph_CRC: CRC clock
|
|
|
* @arg RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
|
|
* @arg RCC_AHB1Periph_BKPSRAM: BKPSRAM interface clock
|
|
|
* @arg RCC_AHB1Periph_DMA1: DMA1 clock
|
|
* @arg RCC_AHB1Periph_DMA1: DMA1 clock
|
|
|
* @arg RCC_AHB1Periph_DMA2: DMA2 clock
|
|
* @arg RCC_AHB1Periph_DMA2: DMA2 clock
|
|
|
|
|
+ * @arg RCC_AHB1Periph_DMA2D: DMA2D clock (STM32F429xx/439xx devices)
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC: Ethernet MAC clock
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Tx: Ethernet Transmission clock
|
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
|
|
* @arg RCC_AHB1Periph_ETH_MAC_Rx: Ethernet Reception clock
|
|
@@ -1507,6 +1904,7 @@ void RCC_AHB2PeriphClockLPModeCmd(uint32_t RCC_AHB2Periph, FunctionalState NewSt
|
|
|
* @note By default, all peripheral clocks are enabled during SLEEP mode.
|
|
* @note By default, all peripheral clocks are enabled during SLEEP mode.
|
|
|
* @param RCC_AHBPeriph: specifies the AHB3 peripheral to gates its clock.
|
|
* @param RCC_AHBPeriph: specifies the AHB3 peripheral to gates its clock.
|
|
|
* This parameter must be: RCC_AHB3Periph_FSMC
|
|
* This parameter must be: RCC_AHB3Periph_FSMC
|
|
|
|
|
+ * or RCC_AHB3Periph_FMC (STM32F429x/439x devices)
|
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1557,6 +1955,8 @@ void RCC_AHB3PeriphClockLPModeCmd(uint32_t RCC_AHB3Periph, FunctionalState NewSt
|
|
|
* @arg RCC_APB1Periph_CAN2: CAN2 clock
|
|
* @arg RCC_APB1Periph_CAN2: CAN2 clock
|
|
|
* @arg RCC_APB1Periph_PWR: PWR clock
|
|
* @arg RCC_APB1Periph_PWR: PWR clock
|
|
|
* @arg RCC_APB1Periph_DAC: DAC clock
|
|
* @arg RCC_APB1Periph_DAC: DAC clock
|
|
|
|
|
+ * @arg RCC_APB1Periph_UART7: UART7 clock
|
|
|
|
|
+ * @arg RCC_APB1Periph_UART8: UART8 clock
|
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1593,10 +1993,15 @@ void RCC_APB1PeriphClockLPModeCmd(uint32_t RCC_APB1Periph, FunctionalState NewSt
|
|
|
* @arg RCC_APB2Periph_ADC3: ADC3 clock
|
|
* @arg RCC_APB2Periph_ADC3: ADC3 clock
|
|
|
* @arg RCC_APB2Periph_SDIO: SDIO clock
|
|
* @arg RCC_APB2Periph_SDIO: SDIO clock
|
|
|
* @arg RCC_APB2Periph_SPI1: SPI1 clock
|
|
* @arg RCC_APB2Periph_SPI1: SPI1 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI4: SPI4 clock
|
|
|
* @arg RCC_APB2Periph_SYSCFG: SYSCFG clock
|
|
* @arg RCC_APB2Periph_SYSCFG: SYSCFG clock
|
|
|
* @arg RCC_APB2Periph_TIM9: TIM9 clock
|
|
* @arg RCC_APB2Periph_TIM9: TIM9 clock
|
|
|
* @arg RCC_APB2Periph_TIM10: TIM10 clock
|
|
* @arg RCC_APB2Periph_TIM10: TIM10 clock
|
|
|
* @arg RCC_APB2Periph_TIM11: TIM11 clock
|
|
* @arg RCC_APB2Periph_TIM11: TIM11 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI5: SPI5 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SPI6: SPI6 clock
|
|
|
|
|
+ * @arg RCC_APB2Periph_SAI1: SAI1 clock (STM32F42xxx/43xxx devices)
|
|
|
|
|
+ * @arg RCC_APB2Periph_LTDC: LTDC clock (STM32F429xx/439xx devices)
|
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
* @param NewState: new state of the specified peripheral clock.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1625,7 +2030,7 @@ void RCC_APB2PeriphClockLPModeCmd(uint32_t RCC_APB2Periph, FunctionalState NewSt
|
|
|
*
|
|
*
|
|
|
@verbatim
|
|
@verbatim
|
|
|
===============================================================================
|
|
===============================================================================
|
|
|
- Interrupts and flags management functions
|
|
|
|
|
|
|
+ ##### Interrupts and flags management functions #####
|
|
|
===============================================================================
|
|
===============================================================================
|
|
|
|
|
|
|
|
@endverbatim
|
|
@endverbatim
|
|
@@ -1641,7 +2046,8 @@ void RCC_APB2PeriphClockLPModeCmd(uint32_t RCC_APB2Periph, FunctionalState NewSt
|
|
|
* @arg RCC_IT_HSIRDY: HSI ready interrupt
|
|
* @arg RCC_IT_HSIRDY: HSI ready interrupt
|
|
|
* @arg RCC_IT_HSERDY: HSE ready interrupt
|
|
* @arg RCC_IT_HSERDY: HSE ready interrupt
|
|
|
* @arg RCC_IT_PLLRDY: main PLL ready interrupt
|
|
* @arg RCC_IT_PLLRDY: main PLL ready interrupt
|
|
|
- * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt
|
|
|
|
|
|
|
+ * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt
|
|
|
|
|
+ * @arg RCC_IT_PLLSAIRDY: PLLSAI ready interrupt (only for STM32F42xxx/43xxx devices)
|
|
|
* @param NewState: new state of the specified RCC interrupts.
|
|
* @param NewState: new state of the specified RCC interrupts.
|
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
* This parameter can be: ENABLE or DISABLE.
|
|
|
* @retval None
|
|
* @retval None
|
|
@@ -1671,6 +2077,7 @@ void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState)
|
|
|
* @arg RCC_FLAG_HSERDY: HSE oscillator clock ready
|
|
* @arg RCC_FLAG_HSERDY: HSE oscillator clock ready
|
|
|
* @arg RCC_FLAG_PLLRDY: main PLL clock ready
|
|
* @arg RCC_FLAG_PLLRDY: main PLL clock ready
|
|
|
* @arg RCC_FLAG_PLLI2SRDY: PLLI2S clock ready
|
|
* @arg RCC_FLAG_PLLI2SRDY: PLLI2S clock ready
|
|
|
|
|
+ * @arg RCC_FLAG_PLLSAIRDY: PLLSAI clock ready (only for STM32F42xxx/43xxx devices)
|
|
|
* @arg RCC_FLAG_LSERDY: LSE oscillator clock ready
|
|
* @arg RCC_FLAG_LSERDY: LSE oscillator clock ready
|
|
|
* @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready
|
|
* @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready
|
|
|
* @arg RCC_FLAG_BORRST: POR/PDR or BOR reset
|
|
* @arg RCC_FLAG_BORRST: POR/PDR or BOR reset
|
|
@@ -1742,7 +2149,8 @@ void RCC_ClearFlag(void)
|
|
|
* @arg RCC_IT_HSIRDY: HSI ready interrupt
|
|
* @arg RCC_IT_HSIRDY: HSI ready interrupt
|
|
|
* @arg RCC_IT_HSERDY: HSE ready interrupt
|
|
* @arg RCC_IT_HSERDY: HSE ready interrupt
|
|
|
* @arg RCC_IT_PLLRDY: main PLL ready interrupt
|
|
* @arg RCC_IT_PLLRDY: main PLL ready interrupt
|
|
|
- * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt
|
|
|
|
|
|
|
+ * @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt
|
|
|
|
|
+ * @arg RCC_IT_PLLSAIRDY: PLLSAI clock ready interrupt (only for STM32F42xxx/43xxx devices)
|
|
|
* @arg RCC_IT_CSS: Clock Security System interrupt
|
|
* @arg RCC_IT_CSS: Clock Security System interrupt
|
|
|
* @retval The new state of RCC_IT (SET or RESET).
|
|
* @retval The new state of RCC_IT (SET or RESET).
|
|
|
*/
|
|
*/
|
|
@@ -1776,6 +2184,7 @@ ITStatus RCC_GetITStatus(uint8_t RCC_IT)
|
|
|
* @arg RCC_IT_HSERDY: HSE ready interrupt
|
|
* @arg RCC_IT_HSERDY: HSE ready interrupt
|
|
|
* @arg RCC_IT_PLLRDY: main PLL ready interrupt
|
|
* @arg RCC_IT_PLLRDY: main PLL ready interrupt
|
|
|
* @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt
|
|
* @arg RCC_IT_PLLI2SRDY: PLLI2S ready interrupt
|
|
|
|
|
+ * @arg RCC_IT_PLLSAIRDY: PLLSAI ready interrupt (only for STM32F42xxx/43xxx devices)
|
|
|
* @arg RCC_IT_CSS: Clock Security System interrupt
|
|
* @arg RCC_IT_CSS: Clock Security System interrupt
|
|
|
* @retval None
|
|
* @retval None
|
|
|
*/
|
|
*/
|
|
@@ -1805,4 +2214,4 @@ void RCC_ClearITPendingBit(uint8_t RCC_IT)
|
|
|
* @}
|
|
* @}
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
|
|
|
|
|
|
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|