STM32G474xx HAL用户手册
stm32g4xx_hal_rcc_ex.h
转到此文件的文档。
00001 /**
00002   ******************************************************************************
00003   * @file    stm32g4xx_hal_rcc_ex.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of RCC HAL Extended module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * Copyright (c) 2019 STMicroelectronics.
00010   * All rights reserved.
00011   *
00012   * This software is licensed under terms that can be found in the LICENSE file in
00013   * the root directory of this software component.
00014   * If no LICENSE file comes with this software, it is provided AS-IS.
00015   ******************************************************************************
00016   */
00017
00018 /* Define to prevent recursive inclusion -------------------------------------*/
00019 #ifndef STM32G4xx_HAL_RCC_EX_H
00020 #define STM32G4xx_HAL_RCC_EX_H
00021 
00022 #ifdef __cplusplus
00023  extern "C" {
00024 #endif
00025 
00026 /* Includes ------------------------------------------------------------------*/
00027 #include "stm32g4xx_hal_def.h"
00028 
00029 /** @addtogroup STM32G4xx_HAL_Driver
00030   * @{
00031   */
00032 
00033 /** @addtogroup RCCEx
00034   * @{
00035   */
00036
00037 /* Exported types ------------------------------------------------------------*/
00038 
00039 /** @defgroup RCCEx_Exported_Types RCCEx Exported Types
00040   * @{
00041   */
00042 
00043 /**
00044   * @brief  RCC extended clocks structure definition
00045   */
00046 typedef struct
00047 {
00048   uint32_ t PeriphClockSelection;   /*!< The Extended Clock to be configured.
00049                                         This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */
00050
00051   uint32_ t Usart1ClockSelection;   /*!< Specifies USART1 clock source.
00052                                         This parameter can be a value of @ref RCCEx_USART1_Clock_Source */
00053
00054   uint32_ t Usart2ClockSelection;   /*!< Specifies USART2 clock source.
00055                                         This parameter can be a value of @ref RCCEx_USART2_Clock_Source */
00056 #if defined(USART3)
00057   uint32_ t Usart3ClockSelection;   /*!< Specifies USART3 clock source.
00058                                         This parameter can be a value of @ref RCCEx_USART3_Clock_Source */
00059 #endif /* UART3 */
00060
00061 #if defined(UART4)
00062   uint32_ t Uart4ClockSelection;    /*!< Specifies UART4 clock source.
00063                                         This parameter can be a value of @ref RCCEx_UART4_Clock_Source */
00064 #endif /* UART4 */
00065
00066 #if defined(UART5)
00067   uint32_ t Uart5ClockSelection;    /*!< Specifies UART5 clock source.
00068                                         This parameter can be a value of @ref RCCEx_UART5_Clock_Source */
00069
00070 #endif /* UART5 */
00071
00072   uint32_ t Lpuart1ClockSelection;  /*!< Specifies LPUART1 clock source.
00073                                         This parameter can be a value of @ref RCCEx_LPUART1_Clock_Source */
00074
00075   uint32_ t I2c1ClockSelection;     /*!< Specifies I2C1 clock source.
00076                                         This parameter can be a value of @ref RCCEx_I2C1_Clock_Source */
00077
00078   uint32_ t I2c2ClockSelection;     /*!< Specifies I2C2 clock source.
00079                                         This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */
00080
00081   uint32_ t I2c3ClockSelection;     /*!< Specifies I2C3 clock source.
00082                                         This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */
00083
00084 #if defined(I2C4)
00085 
00086   uint32_ t I2c4ClockSelection;     /*!< Specifies I2C4 clock source.
00087                                         This parameter can be a value of @ref RCCEx_I2C4_Clock_Source */
00088 #endif /* I2C4 */
00089
00090   uint32_ t Lptim1ClockSelection;   /*!< Specifies LPTIM1 clock source.
00091                                         This parameter can be a value of @ref RCCEx_LPTIM1_Clock_Source */
00092
00093   uint32_ t Sai1ClockSelection;     /*!< Specifies SAI1 clock source.
00094                                         This parameter can be a value of @ref RCCEx_SAI1_Clock_Source */
00095
00096   uint32_ t I2sClockSelection;     /*!< Specifies I2S clock source.
00097                                         This parameter can be a value of @ref RCCEx_I2S_Clock_Source */
00098 #if defined(FDCAN1)
00099 
00100   uint32_ t FdcanClockSelection;     /*!< Specifies FDCAN clock source.
00101                                         This parameter can be a value of @ref RCCEx_FDCAN_Clock_Source */
00102 #endif /* FDCAN1 */
00103 #if defined(USB)
00104 
00105   uint32_ t UsbClockSelection;      /*!< Specifies USB clock source (warning: same source for RNG).
00106                                         This parameter can be a value of @ref RCCEx_USB_Clock_Source */
00107 #endif /* USB */
00108
00109   uint32_ t RngClockSelection;      /*!< Specifies RNG clock source (warning: same source for USB).
00110                                         This parameter can be a value of @ref RCCEx_RNG_Clock_Source */
00111
00112   uint32_ t Adc12ClockSelection;    /*!< Specifies ADC12 interface clock source.
00113                                         This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */
00114
00115 #if defined(ADC345_COMMON)
00116   uint32_ t Adc345ClockSelection;   /*!< Specifies ADC345 interface clock source.
00117                                         This parameter can be a value of @ref RCCEx_ADC345_Clock_Source */
00118 #endif /* ADC345_COMMON */
00119
00120 #if defined(QUADSPI)
00121   uint32_ t QspiClockSelection;     /*!< Specifies QuadSPI clock source.
00122                                         This parameter can be a value of @ref RCCEx_QSPI_Clock_Source */
00123 #endif
00124 
00125   uint32_ t RTCClockSelection;      /*!< Specifies RTC clock source.
00126                                         This parameter can be a value of @ref RCC_RTC_Clock_Source */
00127 }RCC_PeriphCLKInitTypeDef;
00128 
00129 /**
00130   * @brief RCC_CRS Init structure definition
00131   */
00132 typedef struct
00133 {
00134   uint32_ t Prescaler;             /*!< Specifies the division factor of the SYNC signal.
00135                                        This parameter can be a value of @ref RCCEx_CRS_SynchroDivider */
00136
00137   uint32_ t Source;                /*!< Specifies the SYNC signal source.
00138                                        This parameter can be a value of @ref RCCEx_CRS_SynchroSource */
00139
00140   uint32_ t Polarity;              /*!< Specifies the input polarity for the SYNC signal source.
00141                                        This parameter can be a value of @ref RCCEx_CRS_SynchroPolarity */
00142
00143   uint32_ t ReloadValue;           /*!< Specifies the value to be loaded in the frequency error counter with each SYNC event.
00144                                        It can be calculated in using macro __HAL_RCC_CRS_RELOADVALUE_CALCULATE(__FTARGET__, __FSYNC__)
00145                                        This parameter must be a number between 0 and 0xFFFF or a value of @ref RCCEx_CRS_ReloadValueDefault .*/
00146
00147   uint32_ t ErrorLimitValue;       /*!< Specifies the value to be used to evaluate the captured frequency error value.
00148                                        This parameter must be a number between 0 and 0xFF or a value of @ref RCCEx_CRS_ErrorLimitDefault */
00149
00150   uint32_ t HSI48CalibrationValue; /*!< Specifies a user-programmable trimming value to the HSI48 oscillator.
00151                                        This parameter must be a number between 0 and 0x7F or a value of @ref RCCEx_CRS_HSI48CalibrationDefault */
00152
00153 }RCC_CRSInitTypeDef;
00154 
00155 /**
00156   * @brief RCC_CRS Synchronization structure definition
00157   */
00158 typedef struct
00159 {
00160   uint32_ t ReloadValue;           /*!< Specifies the value loaded in the Counter reload value.
00161                                        This parameter must be a number between 0 and 0xFFFF */
00162
00163   uint32_ t HSI48CalibrationValue; /*!< Specifies value loaded in HSI48 oscillator smooth trimming.
00164                                        This parameter must be a number between 0 and 0x7F */
00165
00166   uint32_ t FreqErrorCapture;      /*!< Specifies the value loaded in the .FECAP, the frequency error counter
00167                                        value latched in the time of the last SYNC event.
00168                                        This parameter must be a number between 0 and 0xFFFF */
00169
00170   uint32_ t FreqErrorDirection;    /*!< Specifies the value loaded in the .FEDIR, the counting direction of the
00171                                        frequency error counter latched in the time of the last SYNC event.
00172                                        It shows whether the actual frequency is below or above the target.
00173                                        This parameter must be a value of @ref RCCEx_CRS_FreqErrorDirection*/
00174
00175 }RCC_CRSSynchroInfoTypeDef;
00176 
00177 /**
00178   * @}
00179   */
00180
00181 /* Exported constants --------------------------------------------------------*/