STM32G474xx HAL用户手册
stm32g4xx_hal_gpio_ex.h
转至本文件的文档
00001 /**
00002   ******************************************************************************
00003   * @file    stm32g4xx_hal_gpio_ex.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of GPIO 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
00013   * in 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 
00019 
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef STM32G4xx_HAL_GPIO_EX_H
00022 #define STM32G4xx_HAL_GPIO_EX_H
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32g4xx_hal_def.h"
00030 
00031 /** @addtogroup STM32G4xx_HAL_Driver
00032   * @{
00033   */
00034 
00035 /** @defgroup GPIOEx GPIOEx
00036   * @brief GPIO Extended HAL module driver
00037   * @{
00038   */
00039 
00040 /* Exported types ------------------------------------------------------------*/
00041 /* Exported constants --------------------------------------------------------*/
00042 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
00043   * @{
00044   */
00045 
00046 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
00047   * @{
00048   */
00049 
00050 /**
00051   * @brief   AF 0 selection
00052   */
00053 #define GPIO_AF0_RTC_50Hz      ((uint8_t)0x00)  /* RTC_50Hz Alternate Function mapping                       */
00054 #define GPIO_AF0_MCO           ((uint8_t)0x00)  /* MCO (MCO1 and MCO2) Alternate Function mapping            */
00055 #define GPIO_AF0_SWJ           ((uint8_t)0x00)  /* SWJ (SWD and JTAG) Alternate Function mapping             */
00056 #define GPIO_AF0_TRACE         ((uint8_t)0x00)  /* TRACE Alternate Function mapping                          */
00057 
00058 /**
00059   * @brief   AF 1 selection
00060   */
00061 #define GPIO_AF1_TIM2          ((uint8_t)0x01)  /* TIM2 Alternate Function mapping   */
00062 #if defined(TIM5)
00063 #define GPIO_AF1_TIM5          ((uint8_t)0x01)  /* TIM5 Alternate Function mapping   */
00064 #endif /* TIM5 */
00065 #define GPIO_AF1_TIM16         ((uint8_t)0x01)  /* TIM16 Alternate Function mapping  */
00066 #define GPIO_AF1_TIM17         ((uint8_t)0x01)  /* TIM17 Alternate Function mapping  */
00067 #define GPIO_AF1_TIM17_COMP1   ((uint8_t)0x01)  /* TIM17/COMP1 Break in Alternate Function mapping  */
00068 #define GPIO_AF1_TIM15         ((uint8_t)0x01)  /* TIM15 Alternate Function mapping  */
00069 #define GPIO_AF1_LPTIM1        ((uint8_t)0x01)  /* LPTIM1 Alternate Function mapping */
00070 #define GPIO_AF1_IR            ((uint8_t)0x01)  /* IR Alternate Function mapping     */
00071 
00072 /**
00073   * @brief   AF 2 selection
00074   */
00075 #define GPIO_AF2_TIM1          ((uint8_t)0x02)  /* TIM1 Alternate Function mapping  */
00076 #define GPIO_AF2_TIM2          ((uint8_t)0x02)  /* TIM2 Alternate Function mapping  */
00077 #define GPIO_AF2_TIM3          ((uint8_t)0x02)  /* TIM3 Alternate Function mapping  */
00078 #define GPIO_AF2_TIM4          ((uint8_t)0x02)  /* TIM4 Alternate Function mapping  */
00079 #if defined(TIM5)
00080 #define GPIO_AF2_TIM5          ((uint8_t)0x02)  /* TIM5 Alternate Function mapping  */
00081 #endif /* TIM5 */
00082 #define GPIO_AF2_TIM8          ((uint8_t)0x02)  /* TIM8 Alternate Function mapping  */
00083 #define GPIO_AF2_TIM15         ((uint8_t)0x02)  /* TIM15 Alternate Function mapping */
00084 #define GPIO_AF2_TIM16         ((uint8_t)0x02)  /* TIM16 Alternate Function mapping */
00085 #if defined(TIM20)
00086 #define GPIO_AF2_TIM20         ((uint8_t)0x02)  /* TIM20 Alternate Function mapping */
00087 #endif /* TIM20 */
00088 #define GPIO_AF2_TIM1_COMP1    ((uint8_t)0x02)  /* TIM1/COMP1 Break in Alternate Function mapping   */
00089 #define GPIO_AF2_TIM15_COMP1   ((uint8_t)0x02)  /* TIM15/COMP1 Break in Alternate Function mapping  */
00090 #define GPIO_AF2_TIM16_COMP1   ((uint8_t)0x02)  /* TIM16/COMP1 Break in Alternate Function mapping  */
00091 #if defined(TIM20)
00092 #define GPIO_AF2_TIM20_COMP1   ((uint8_t)0x02)  /* TIM20/COMP1 Break in Alternate Function mapping  */
00093 #define GPIO_AF2_TIM20_COMP2   ((uint8_t)0x02)  /* TIM20/COMP2 Break in Alternate Function mapping  */
00094 #endif /* TIM20 */
00095 #define GPIO_AF2_I2C3          ((uint8_t)0x02)  /* I2C3 Alternate Function mapping  */
00096 #define GPIO_AF2_COMP1         ((uint8_t)0x02)  /* COMP1 Alternate Function mapping */
00097 
00098 /**
00099   * @brief   AF 3 selection
00100   */
00101 #define GPIO_AF3_TIM15         ((uint8_t)0x03)  /* TIM15 Alternate Function mapping   */
00102 #if defined(TIM20)
00103 #define GPIO_AF3_TIM20         ((uint8_t)0x03)  /* TIM20 Alternate Function mapping   */
00104 #endif /* TIM20 */
00105 #define GPIO_AF3_UCPD1         ((uint8_t)0x03)  /* UCPD1 Alternate Function mapping   */
00106 #define GPIO_AF3_I2C3          ((uint8_t)0x03)  /* I2C3 Alternate Function mapping    */
00107 #if defined(I2C4)
00108 #define GPIO_AF3_I2C4          ((uint8_t)0x03)  /* I2C4 Alternate Function mapping    */
00109 #endif /* I2C4 */
00110 #if defined(HRTIM1)
00111 #define GPIO_AF3_HRTIM1        ((uint8_t)0x03)  /* HRTIM1 Alternate Function mapping  */
00111 #endif /* HRTIM1 */
00112 #if defined(QUADSPI)
00113 #define GPIO_AF3_QUADSPI       ((uint8_t)0x03)  /* QUADSPI Alternate Function mapping */
00114 #endif /* QUADSPI */
00115 #define GPIO_AF3_TIM8          ((uint8_t)0x03)  /* TIM8 Alternate Function mapping    */
00116 #define GPIO_AF3_SAI1          ((uint8_t)0x03)  /* SAI1 Alternate Function mapping  */
00117 #define GPIO_AF3_COMP3         ((uint8_t)0x03)  /* COMP3 Alternate Function mapping */
00118 
00119 /**
00120   * @brief   AF 4 selection
00121   */
00122 #define GPIO_AF4_TIM1          ((uint8_t)0x04)  /* TIM1 Alternate Function mapping    */
00123 #define GPIO_AF4_TIM8          ((uint8_t)0x04)  /* TIM8 Alternate Function mapping    */
00124 #define GPIO_AF4_TIM16         ((uint8_t)0x04)  /* TIM16 Alternate Function mapping   */
00125 #define GPIO_AF4_TIM17         ((uint8_t)0x04)  /* TIM17 Alternate Function mapping   */
00126 #define GPIO_AF4_TIM8_COMP1    ((uint8_t)0x04)  /* TIM8/COMP1 Break in Alternate Function mapping  */
00127 #define GPIO_AF4_I2C1          ((uint8_t)0x04)  /* I2C1 Alternate Function mapping    */
00128 #define GPIO_AF4_I2C2          ((uint8_t)0x04)  /* I2C2 Alternate Function mapping    */
00129 #define GPIO_AF4_I2C3          ((uint8_t)0x04)  /* I2C3 Alternate Function mapping    */
00130 #if defined(I2C4)
00131 #define GPIO_AF4_I2C4          ((uint8_t)0x04)