Subversion Repositories DashDisplay

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 5
Line 1... Line 1...
1
/**
1
/**
2
  ******************************************************************************
2
  ******************************************************************************
3
  * @file    stm32f1xx_hal_rcc_ex.h
3
  * @file    stm32f1xx_hal_rcc_ex.h
4
  * @author  MCD Application Team
4
  * @author  MCD Application Team
5
  * @version V1.0.1
5
  * @version V1.0.4
6
  * @date    31-July-2015
6
  * @date    29-April-2016
7
  * @brief   Header file of RCC HAL Extension module.
7
  * @brief   Header file of RCC HAL Extension module.
8
  ******************************************************************************
8
  ******************************************************************************
9
  * @attention
9
  * @attention
10
  *
10
  *
11
  * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
11
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
12
  *
12
  *
13
  * Redistribution and use in source and binary forms, with or without modification,
13
  * Redistribution and use in source and binary forms, with or without modification,
14
  * are permitted provided that the following conditions are met:
14
  * are permitted provided that the following conditions are met:
15
  *   1. Redistributions of source code must retain the above copyright notice,
15
  *   1. Redistributions of source code must retain the above copyright notice,
16
  *      this list of conditions and the following disclaimer.
16
  *      this list of conditions and the following disclaimer.
Line 408... Line 408...
408
 
408
 
409
/** @defgroup RCCEx_USB_Prescaler USB Prescaler
409
/** @defgroup RCCEx_USB_Prescaler USB Prescaler
410
  * @{
410
  * @{
411
  */
411
  */
412
#define RCC_USBCLKSOURCE_PLL              RCC_CFGR_USBPRE
412
#define RCC_USBCLKSOURCE_PLL              RCC_CFGR_USBPRE
413
#define RCC_USBCLKSOURCE_PLL_DIV1_5       ((uint32_t)0x00000000)
413
#define RCC_USBCLKSOURCE_PLL_DIV1_5            ((uint32_t)0x00000000)
414
 
414
 
415
/**
415
/**
416
  * @}
416
  * @}
417
  */
417
  */
418
 
418
 
Line 602... Line 602...
602
#if defined(STM32F105xC) || defined(STM32F107xC)
602
#if defined(STM32F105xC) || defined(STM32F107xC)
603
/** @defgroup RCCEx_Interrupt RCCEx Interrupt
603
/** @defgroup RCCEx_Interrupt RCCEx Interrupt
604
  * @{
604
  * @{
605
  */
605
  */
606
#define RCC_IT_PLL2RDY                   ((uint8_t)RCC_CIR_PLL2RDYF)
606
#define RCC_IT_PLL2RDY                   ((uint8_t)RCC_CIR_PLL2RDYF)
607
#define RCC_IT_PLLI2SRDY                   ((uint8_t)RCC_CIR_PLL3RDYF)
607
#define RCC_IT_PLLI2SRDY                 ((uint8_t)RCC_CIR_PLL3RDYF)
608
/**
608
/**
609
  * @}
609
  * @}
610
  */  
610
  */  
611
 
611
 
612
/** @defgroup RCCEx_Flag RCCEx Flag
612
/** @defgroup RCCEx_Flag RCCEx Flag
Line 1400... Line 1400...
1400
#if defined(STM32F105xC) || defined(STM32F107xC)
1400
#if defined(STM32F105xC) || defined(STM32F107xC)
1401
/** @defgroup RCCEx_Peripheral_Clock_Force_Release Peripheral Clock Force Release
1401
/** @defgroup RCCEx_Peripheral_Clock_Force_Release Peripheral Clock Force Release
1402
  * @brief  Force or release AHB peripheral reset.
1402
  * @brief  Force or release AHB peripheral reset.
1403
  * @{
1403
  * @{
1404
  */  
1404
  */  
1405
#define __HAL_RCC_AHB_FORCE_RESET()         (RCC->AHBRSTR = 0xFFFFFFFF)
1405
#define __HAL_RCC_AHB_FORCE_RESET()         (RCC->AHBRSTR = 0xFFFFFFFFU)
1406
#define __HAL_RCC_USB_OTG_FS_FORCE_RESET()       (RCC->AHBRSTR |= (RCC_AHBRSTR_OTGFSRST))
1406
#define __HAL_RCC_USB_OTG_FS_FORCE_RESET()       (RCC->AHBRSTR |= (RCC_AHBRSTR_OTGFSRST))
1407
#if defined(STM32F107xC)
1407
#if defined(STM32F107xC)
1408
#define __HAL_RCC_ETHMAC_FORCE_RESET()      (RCC->AHBRSTR |= (RCC_AHBRSTR_ETHMACRST))
1408
#define __HAL_RCC_ETHMAC_FORCE_RESET()      (RCC->AHBRSTR |= (RCC_AHBRSTR_ETHMACRST))
1409
#endif /* STM32F107xC */
1409
#endif /* STM32F107xC */
1410
 
1410
 
Line 1601... Line 1601...
1601
/**
1601
/**
1602
  * @brief  Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL.
1602
  * @brief  Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL.
1603
  * @note   Predivision factor can not be changed if PLL is used as system clock
1603
  * @note   Predivision factor can not be changed if PLL is used as system clock
1604
  *         In this case, you have to select another source of the system clock, disable the PLL and
1604
  *         In this case, you have to select another source of the system clock, disable the PLL and
1605
  *         then change the HSE predivision factor.
1605
  *         then change the HSE predivision factor.
1606
  * @param  __HSE_PREDIV_VALUE__: specifies the division value applied to HSE.
1606
  * @param  __HSE_PREDIV_VALUE__ specifies the division value applied to HSE.
1607
  *         This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV16.
1607
  *         This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV16.
1608
  */
1608
  */
1609
#define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV1, (uint32_t)(__HSE_PREDIV_VALUE__))
1609
#define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV1, (uint32_t)(__HSE_PREDIV_VALUE__))
1610
#else
1610
#else
1611
/**
1611
/**
1612
  * @brief  Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL.
1612
  * @brief  Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL.
1613
  * @note   Predivision factor can not be changed if PLL is used as system clock
1613
  * @note   Predivision factor can not be changed if PLL is used as system clock
1614
  *         In this case, you have to select another source of the system clock, disable the PLL and
1614
  *         In this case, you have to select another source of the system clock, disable the PLL and
1615
  *         then change the HSE predivision factor.
1615
  *         then change the HSE predivision factor.
1616
  * @param  __HSE_PREDIV_VALUE__: specifies the division value applied to HSE.
1616
  * @param  __HSE_PREDIV_VALUE__ specifies the division value applied to HSE.
1617
  *         This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV2.
1617
  *         This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV2.
1618
  */
1618
  */
1619
#define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) \
1619
#define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) \
1620
                  MODIFY_REG(RCC->CFGR,RCC_CFGR_PLLXTPRE, (uint32_t)(__HSE_PREDIV_VALUE__))
1620
                  MODIFY_REG(RCC->CFGR,RCC_CFGR_PLLXTPRE, (uint32_t)(__HSE_PREDIV_VALUE__))
1621
 
1621
 
Line 1659... Line 1659...
1659
#define __HAL_RCC_PLLI2S_DISABLE()         (*(__IO uint32_t *) RCC_CR_PLLI2SON_BB = DISABLE)
1659
#define __HAL_RCC_PLLI2S_DISABLE()         (*(__IO uint32_t *) RCC_CR_PLLI2SON_BB = DISABLE)
1660
 
1660
 
1661
/** @brief macros to configure the main PLLI2S multiplication factor.
1661
/** @brief macros to configure the main PLLI2S multiplication factor.
1662
  * @note   This function must be used only when the main PLLI2S is disabled.
1662
  * @note   This function must be used only when the main PLLI2S is disabled.
1663
  *  
1663
  *  
1664
  * @param  __PLLI2SMUL__: specifies the multiplication factor for PLLI2S VCO output clock
1664
  * @param  __PLLI2SMUL__ specifies the multiplication factor for PLLI2S VCO output clock
1665
  *          This parameter can be one of the following values:
1665
  *          This parameter can be one of the following values:
1666
  *             @arg RCC_PLLI2S_MUL8: PLLI2SVCO = PLLI2S clock entry x 8
1666
  *             @arg @ref RCC_PLLI2S_MUL8 PLLI2SVCO = PLLI2S clock entry x 8
1667
  *             @arg RCC_PLLI2S_MUL9: PLLI2SVCO = PLLI2S clock entry x 9
1667
  *             @arg @ref RCC_PLLI2S_MUL9 PLLI2SVCO = PLLI2S clock entry x 9
1668
  *             @arg RCC_PLLI2S_MUL10: PLLI2SVCO = PLLI2S clock entry x 10
1668
  *             @arg @ref RCC_PLLI2S_MUL10 PLLI2SVCO = PLLI2S clock entry x 10
1669
  *             @arg RCC_PLLI2S_MUL11: PLLI2SVCO = PLLI2S clock entry x 11
1669
  *             @arg @ref RCC_PLLI2S_MUL11 PLLI2SVCO = PLLI2S clock entry x 11
1670
  *             @arg RCC_PLLI2S_MUL12: PLLI2SVCO = PLLI2S clock entry x 12
1670
  *             @arg @ref RCC_PLLI2S_MUL12 PLLI2SVCO = PLLI2S clock entry x 12
1671
  *             @arg RCC_PLLI2S_MUL13: PLLI2SVCO = PLLI2S clock entry x 13
1671
  *             @arg @ref RCC_PLLI2S_MUL13 PLLI2SVCO = PLLI2S clock entry x 13
1672
  *             @arg RCC_PLLI2S_MUL14: PLLI2SVCO = PLLI2S clock entry x 14
1672
  *             @arg @ref RCC_PLLI2S_MUL14 PLLI2SVCO = PLLI2S clock entry x 14
1673
  *             @arg RCC_PLLI2S_MUL16: PLLI2SVCO = PLLI2S clock entry x 16
1673
  *             @arg @ref RCC_PLLI2S_MUL16 PLLI2SVCO = PLLI2S clock entry x 16
1674
  *             @arg RCC_PLLI2S_MUL20: PLLI2SVCO = PLLI2S clock entry x 20
1674
  *             @arg @ref RCC_PLLI2S_MUL20 PLLI2SVCO = PLLI2S clock entry x 20
1675
  *  
1675
  *  
1676
  */
1676
  */
1677
#define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SMUL__)\
1677
#define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SMUL__)\
1678
          MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PLL3MUL,(__PLLI2SMUL__))
1678
          MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PLL3MUL,(__PLLI2SMUL__))
1679
 
1679
 
Line 1689... Line 1689...
1689
  */  
1689
  */  
1690
 
1690
 
1691
#if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
1691
#if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
1692
 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
1692
 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
1693
/** @brief  Macro to configure the USB clock.
1693
/** @brief  Macro to configure the USB clock.
1694
  * @param  __USBCLKSOURCE__: specifies the USB clock source.
1694
  * @param  __USBCLKSOURCE__ specifies the USB clock source.
1695
  *          This parameter can be one of the following values:
1695
  *          This parameter can be one of the following values:
1696
  *            @arg RCC_USBCLKSOURCE_PLL: PLL clock divided by 1 selected as USB clock
1696
  *            @arg @ref RCC_USBCLKSOURCE_PLL PLL clock divided by 1 selected as USB clock
1697
  *            @arg RCC_USBCLKSOURCE_PLL_DIV1_5: PLL clock divided by 1.5 selected as USB clock
1697
  *            @arg @ref RCC_USBCLKSOURCE_PLL_DIV1_5 PLL clock divided by 1.5 selected as USB clock
1698
  */
1698
  */
1699
#define __HAL_RCC_USB_CONFIG(__USBCLKSOURCE__) \
1699
#define __HAL_RCC_USB_CONFIG(__USBCLKSOURCE__) \
1700
                  MODIFY_REG(RCC->CFGR, RCC_CFGR_USBPRE, (uint32_t)(__USBCLKSOURCE__))
1700
                  MODIFY_REG(RCC->CFGR, RCC_CFGR_USBPRE, (uint32_t)(__USBCLKSOURCE__))
1701
 
1701
 
1702
/** @brief  Macro to get the USB clock (USBCLK).
1702
/** @brief  Macro to get the USB clock (USBCLK).
1703
  * @retval The clock source can be one of the following values:
1703
  * @retval The clock source can be one of the following values:
1704
  *            @arg RCC_USBCLKSOURCE_PLL: PLL clock divided by 1 selected as USB clock
1704
  *            @arg @ref RCC_USBCLKSOURCE_PLL PLL clock divided by 1 selected as USB clock
1705
  *            @arg RCC_USBCLKSOURCE_PLL_DIV1_5: PLL clock divided by 1.5 selected as USB clock
1705
  *            @arg @ref RCC_USBCLKSOURCE_PLL_DIV1_5 PLL clock divided by 1.5 selected as USB clock
1706
  */
1706
  */
1707
#define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_USBPRE)))
1707
#define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_USBPRE)))
1708
 
1708
 
1709
#endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
1709
#endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
1710
 
1710
 
1711
#if defined(STM32F105xC) || defined(STM32F107xC)
1711
#if defined(STM32F105xC) || defined(STM32F107xC)
1712
 
1712
 
1713
/** @brief  Macro to configure the USB OTSclock.
1713
/** @brief  Macro to configure the USB OTSclock.
1714
  * @param  __USBCLKSOURCE__: specifies the USB clock source.
1714
  * @param  __USBCLKSOURCE__ specifies the USB clock source.
1715
  *          This parameter can be one of the following values:
1715
  *          This parameter can be one of the following values:
1716
  *            @arg RCC_USBCLKSOURCE_PLL_DIV2: PLL clock divided by 2 selected as USB OTG FS clock
1716
  *            @arg @ref RCC_USBCLKSOURCE_PLL_DIV2 PLL clock divided by 2 selected as USB OTG FS clock
1717
  *            @arg RCC_USBCLKSOURCE_PLL_DIV3: PLL clock divided by 3 selected as USB OTG FS clock
1717
  *            @arg @ref RCC_USBCLKSOURCE_PLL_DIV3 PLL clock divided by 3 selected as USB OTG FS clock
1718
  */
1718
  */
1719
#define __HAL_RCC_USB_CONFIG(__USBCLKSOURCE__) \
1719
#define __HAL_RCC_USB_CONFIG(__USBCLKSOURCE__) \
1720
                  MODIFY_REG(RCC->CFGR, RCC_CFGR_OTGFSPRE, (uint32_t)(__USBCLKSOURCE__))
1720
                  MODIFY_REG(RCC->CFGR, RCC_CFGR_OTGFSPRE, (uint32_t)(__USBCLKSOURCE__))
1721
 
1721
 
1722
/** @brief  Macro to get the USB clock (USBCLK).
1722
/** @brief  Macro to get the USB clock (USBCLK).
1723
  * @retval The clock source can be one of the following values:
1723
  * @retval The clock source can be one of the following values:
1724
  *            @arg RCC_USBCLKSOURCE_PLL_DIV2: PLL clock divided by 2 selected as USB OTG FS clock
1724
  *            @arg @ref RCC_USBCLKSOURCE_PLL_DIV2 PLL clock divided by 2 selected as USB OTG FS clock
1725
  *            @arg RCC_USBCLKSOURCE_PLL_DIV3: PLL clock divided by 3 selected as USB OTG FS clock
1725
  *            @arg @ref RCC_USBCLKSOURCE_PLL_DIV3 PLL clock divided by 3 selected as USB OTG FS clock
1726
  */
1726
  */
1727
#define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_OTGFSPRE)))
1727
#define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_OTGFSPRE)))
1728
 
1728
 
1729
#endif /* STM32F105xC || STM32F107xC */
1729
#endif /* STM32F105xC || STM32F107xC */
1730
 
1730
 
1731
/** @brief  Macro to configure the ADCx clock (x=1 to 3 depending on devices).
1731
/** @brief  Macro to configure the ADCx clock (x=1 to 3 depending on devices).
1732
  * @param  __ADCCLKSOURCE__: specifies the ADC clock source.
1732
  * @param  __ADCCLKSOURCE__ specifies the ADC clock source.
1733
  *          This parameter can be one of the following values:
1733
  *          This parameter can be one of the following values:
1734
  *            @arg RCC_ADCPCLK2_DIV2: PCLK2 clock divided by 2 selected as ADC clock
1734
  *            @arg @ref RCC_ADCPCLK2_DIV2 PCLK2 clock divided by 2 selected as ADC clock
1735
  *            @arg RCC_ADCPCLK2_DIV4: PCLK2 clock divided by 4 selected as ADC clock
1735
  *            @arg @ref RCC_ADCPCLK2_DIV4 PCLK2 clock divided by 4 selected as ADC clock
1736
  *            @arg RCC_ADCPCLK2_DIV6: PCLK2 clock divided by 6 selected as ADC clock
1736
  *            @arg @ref RCC_ADCPCLK2_DIV6 PCLK2 clock divided by 6 selected as ADC clock
1737
  *            @arg RCC_ADCPCLK2_DIV8: PCLK2 clock divided by 8 selected as ADC clock
1737
  *            @arg @ref RCC_ADCPCLK2_DIV8 PCLK2 clock divided by 8 selected as ADC clock
1738
  */
1738
  */
1739
#define __HAL_RCC_ADC_CONFIG(__ADCCLKSOURCE__) \
1739
#define __HAL_RCC_ADC_CONFIG(__ADCCLKSOURCE__) \
1740
                  MODIFY_REG(RCC->CFGR, RCC_CFGR_ADCPRE, (uint32_t)(__ADCCLKSOURCE__))
1740
                  MODIFY_REG(RCC->CFGR, RCC_CFGR_ADCPRE, (uint32_t)(__ADCCLKSOURCE__))
1741
 
1741
 
1742
/** @brief  Macro to get the ADC clock (ADCxCLK, x=1 to 3 depending on devices).
1742
/** @brief  Macro to get the ADC clock (ADCxCLK, x=1 to 3 depending on devices).
1743
  * @retval The clock source can be one of the following values:
1743
  * @retval The clock source can be one of the following values:
1744
  *            @arg RCC_ADCPCLK2_DIV2: PCLK2 clock divided by 2 selected as ADC clock
1744
  *            @arg @ref RCC_ADCPCLK2_DIV2 PCLK2 clock divided by 2 selected as ADC clock
1745
  *            @arg RCC_ADCPCLK2_DIV4: PCLK2 clock divided by 4 selected as ADC clock
1745
  *            @arg @ref RCC_ADCPCLK2_DIV4 PCLK2 clock divided by 4 selected as ADC clock
1746
  *            @arg RCC_ADCPCLK2_DIV6: PCLK2 clock divided by 6 selected as ADC clock
1746
  *            @arg @ref RCC_ADCPCLK2_DIV6 PCLK2 clock divided by 6 selected as ADC clock
1747
  *            @arg RCC_ADCPCLK2_DIV8: PCLK2 clock divided by 8 selected as ADC clock
1747
  *            @arg @ref RCC_ADCPCLK2_DIV8 PCLK2 clock divided by 8 selected as ADC clock
1748
  */
1748
  */
1749
#define __HAL_RCC_GET_ADC_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_ADCPRE)))
1749
#define __HAL_RCC_GET_ADC_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_ADCPRE)))
1750
 
1750
 
1751
/**
1751
/**
1752
  * @}
1752
  * @}
Line 1761... Line 1761...
1761
/**
1761
/**
1762
  * @brief  Macro to configure the PLL2 & PLLI2S Predivision factor.
1762
  * @brief  Macro to configure the PLL2 & PLLI2S Predivision factor.
1763
  * @note   Predivision factor can not be changed if PLL2 is used indirectly as system clock
1763
  * @note   Predivision factor can not be changed if PLL2 is used indirectly as system clock
1764
  *         In this case, you have to select another source of the system clock, disable the PLL2 and PLLI2S and
1764
  *         In this case, you have to select another source of the system clock, disable the PLL2 and PLLI2S and
1765
  *         then change the PREDIV2 factor.
1765
  *         then change the PREDIV2 factor.
1766
  * @param  __HSE_PREDIV2_VALUE__: specifies the PREDIV2 value applied to PLL2 & PLLI2S.
1766
  * @param  __HSE_PREDIV2_VALUE__ specifies the PREDIV2 value applied to PLL2 & PLLI2S.
1767
  *         This parameter must be a number between RCC_HSE_PREDIV2_DIV1 and RCC_HSE_PREDIV2_DIV16.
1767
  *         This parameter must be a number between RCC_HSE_PREDIV2_DIV1 and RCC_HSE_PREDIV2_DIV16.
1768
  */
1768
  */
1769
#define __HAL_RCC_HSE_PREDIV2_CONFIG(__HSE_PREDIV2_VALUE__) \
1769
#define __HAL_RCC_HSE_PREDIV2_CONFIG(__HSE_PREDIV2_VALUE__) \
1770
                  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV2, (uint32_t)(__HSE_PREDIV2_VALUE__))
1770
                  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV2, (uint32_t)(__HSE_PREDIV2_VALUE__))
1771
                 
1771
                 
Line 1797... Line 1797...
1797
#define __HAL_RCC_PLL2_DISABLE()         (*(__IO uint32_t *) RCC_CR_PLL2ON_BB = DISABLE)
1797
#define __HAL_RCC_PLL2_DISABLE()         (*(__IO uint32_t *) RCC_CR_PLL2ON_BB = DISABLE)
1798
 
1798
 
1799
/** @brief macros to configure the main PLL2 multiplication factor.
1799
/** @brief macros to configure the main PLL2 multiplication factor.
1800
  * @note   This function must be used only when the main PLL2 is disabled.
1800
  * @note   This function must be used only when the main PLL2 is disabled.
1801
  *  
1801
  *  
1802
  * @param  __PLL2MUL__: specifies the multiplication factor for PLL2 VCO output clock
1802
  * @param  __PLL2MUL__ specifies the multiplication factor for PLL2 VCO output clock
1803
  *          This parameter can be one of the following values:
1803
  *          This parameter can be one of the following values:
1804
  *             @arg RCC_PLL2_MUL8: PLL2VCO = PLL2 clock entry x 8
1804
  *             @arg @ref RCC_PLL2_MUL8 PLL2VCO = PLL2 clock entry x 8
1805
  *             @arg RCC_PLL2_MUL9: PLL2VCO = PLL2 clock entry x 9
1805
  *             @arg @ref RCC_PLL2_MUL9 PLL2VCO = PLL2 clock entry x 9
1806
  *             @arg RCC_PLL2_MUL10: PLL2VCO = PLL2 clock entry x 10
1806
  *             @arg @ref RCC_PLL2_MUL10 PLL2VCO = PLL2 clock entry x 10
1807
  *             @arg RCC_PLL2_MUL11: PLL2VCO = PLL2 clock entry x 11
1807
  *             @arg @ref RCC_PLL2_MUL11 PLL2VCO = PLL2 clock entry x 11
1808
  *             @arg RCC_PLL2_MUL12: PLL2VCO = PLL2 clock entry x 12
1808
  *             @arg @ref RCC_PLL2_MUL12 PLL2VCO = PLL2 clock entry x 12
1809
  *             @arg RCC_PLL2_MUL13: PLL2VCO = PLL2 clock entry x 13
1809
  *             @arg @ref RCC_PLL2_MUL13 PLL2VCO = PLL2 clock entry x 13
1810
  *             @arg RCC_PLL2_MUL14: PLL2VCO = PLL2 clock entry x 14
1810
  *             @arg @ref RCC_PLL2_MUL14 PLL2VCO = PLL2 clock entry x 14
1811
  *             @arg RCC_PLL2_MUL16: PLL2VCO = PLL2 clock entry x 16
1811
  *             @arg @ref RCC_PLL2_MUL16 PLL2VCO = PLL2 clock entry x 16
1812
  *             @arg RCC_PLL2_MUL20: PLL2VCO = PLL2 clock entry x 20
1812
  *             @arg @ref RCC_PLL2_MUL20 PLL2VCO = PLL2 clock entry x 20
1813
  *  
1813
  *  
1814
  */
1814
  */
1815
#define __HAL_RCC_PLL2_CONFIG(__PLL2MUL__)\
1815
#define __HAL_RCC_PLL2_CONFIG(__PLL2MUL__)\
1816
          MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PLL2MUL,(__PLL2MUL__))
1816
          MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PLL2MUL,(__PLL2MUL__))
1817
 
1817
 
Line 1823... Line 1823...
1823
  * @brief  Macros to configure clock source of I2S peripherals.
1823
  * @brief  Macros to configure clock source of I2S peripherals.
1824
  * @{
1824
  * @{
1825
  */  
1825
  */  
1826
 
1826
 
1827
/** @brief  Macro to configure the I2S2 clock.
1827
/** @brief  Macro to configure the I2S2 clock.
1828
  * @param  __I2S2CLKSOURCE__: specifies the I2S2 clock source.
1828
  * @param  __I2S2CLKSOURCE__ specifies the I2S2 clock source.
1829
  *          This parameter can be one of the following values:
1829
  *          This parameter can be one of the following values:
1830
  *            @arg RCC_I2S2CLKSOURCE_SYSCLK: system clock selected as I2S3 clock entry
1830
  *            @arg @ref RCC_I2S2CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
1831
  *            @arg RCC_I2S2CLKSOURCE_PLLI2S_VCO: PLLI2S VCO clock selected as I2S3 clock entry
1831
  *            @arg @ref RCC_I2S2CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
1832
  */
1832
  */
1833
#define __HAL_RCC_I2S2_CONFIG(__I2S2CLKSOURCE__) \
1833
#define __HAL_RCC_I2S2_CONFIG(__I2S2CLKSOURCE__) \
1834
                  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_I2S2SRC, (uint32_t)(__I2S2CLKSOURCE__))
1834
                  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_I2S2SRC, (uint32_t)(__I2S2CLKSOURCE__))
1835
 
1835
 
1836
/** @brief  Macro to get the I2S2 clock (I2S2CLK).
1836
/** @brief  Macro to get the I2S2 clock (I2S2CLK).
1837
  * @retval The clock source can be one of the following values:
1837
  * @retval The clock source can be one of the following values:
1838
  *            @arg RCC_I2S2CLKSOURCE_SYSCLK: system clock selected as I2S3 clock entry
1838
  *            @arg @ref RCC_I2S2CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
1839
  *            @arg RCC_I2S2CLKSOURCE_PLLI2S_VCO: PLLI2S VCO clock selected as I2S3 clock entry
1839
  *            @arg @ref RCC_I2S2CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
1840
  */
1840
  */
1841
#define __HAL_RCC_GET_I2S2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_I2S2SRC)))
1841
#define __HAL_RCC_GET_I2S2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_I2S2SRC)))
1842
 
1842
 
1843
/** @brief  Macro to configure the I2S3 clock.
1843
/** @brief  Macro to configure the I2S3 clock.
1844
  * @param  __I2S2CLKSOURCE__: specifies the I2S3 clock source.
1844
  * @param  __I2S2CLKSOURCE__ specifies the I2S3 clock source.
1845
  *          This parameter can be one of the following values:
1845
  *          This parameter can be one of the following values:
1846
  *            @arg RCC_I2S3CLKSOURCE_SYSCLK: system clock selected as I2S3 clock entry
1846
  *            @arg @ref RCC_I2S3CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
1847
  *            @arg RCC_I2S3CLKSOURCE_PLLI2S_VCO: PLLI2S VCO clock selected as I2S3 clock entry
1847
  *            @arg @ref RCC_I2S3CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
1848
  */
1848
  */
1849
#define __HAL_RCC_I2S3_CONFIG(__I2S2CLKSOURCE__) \
1849
#define __HAL_RCC_I2S3_CONFIG(__I2S2CLKSOURCE__) \
1850
                  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_I2S3SRC, (uint32_t)(__I2S2CLKSOURCE__))
1850
                  MODIFY_REG(RCC->CFGR2, RCC_CFGR2_I2S3SRC, (uint32_t)(__I2S2CLKSOURCE__))
1851
 
1851
 
1852
/** @brief  Macro to get the I2S3 clock (I2S3CLK).
1852
/** @brief  Macro to get the I2S3 clock (I2S3CLK).
1853
  * @retval The clock source can be one of the following values:
1853
  * @retval The clock source can be one of the following values:
1854
  *            @arg RCC_I2S3CLKSOURCE_SYSCLK: system clock selected as I2S3 clock entry
1854
  *            @arg @ref RCC_I2S3CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
1855
  *            @arg RCC_I2S3CLKSOURCE_PLLI2S_VCO: PLLI2S VCO clock selected as I2S3 clock entry
1855
  *            @arg @ref RCC_I2S3CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
1856
  */
1856
  */
1857
#define __HAL_RCC_GET_I2S3_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_I2S3SRC)))
1857
#define __HAL_RCC_GET_I2S3_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_I2S3SRC)))
1858
 
1858
 
1859
/**
1859
/**
1860
  * @}
1860
  * @}