STM32F103xB HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f1xx_hal_gpio_ex.h 00004 * @author MCD Application Team 00005 * @brief Header file of GPIO HAL Extension module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© Copyright (c) 2016 STMicroelectronics. 00010 * All rights reserved.</center></h2> 00011 * 00012 * This software component is licensed by ST under BSD 3-Clause license, 00013 * the "License"; You may not use this file except in compliance with the 00014 * License. You may obtain a copy of the License at: 00015 * opensource.org/licenses/BSD-3-Clause 00016 * 00017 ****************************************************************************** 00018 */ 00019 00020 /* Define to prevent recursive inclusion -------------------------------------*/ 00021 #ifndef STM32F1xx_HAL_GPIO_EX_H 00022 #define STM32F1xx_HAL_GPIO_EX_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /* Includes ------------------------------------------------------------------*/ 00029 #include "stm32f1xx_hal_def.h" 00030 00031 /** @addtogroup STM32F1xx_HAL_Driver 00032 * @{ 00033 */ 00034 00035 /** @defgroup GPIOEx GPIOEx 00036 * @{ 00037 */ 00038 /* Exported types ------------------------------------------------------------*/ 00039 /* Exported constants --------------------------------------------------------*/ 00040 00041 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants 00042 * @{ 00043 */ 00044 00045 /** @defgroup GPIOEx_EVENTOUT EVENTOUT Cortex Configuration 00046 * @brief This section propose definition to use the Cortex EVENTOUT signal. 00047 * @{ 00048 */ 00049 00050 /** @defgroup GPIOEx_EVENTOUT_PIN EVENTOUT Pin 00051 * @{ 00052 */ 00053 00054 #define AFIO_EVENTOUT_PIN_0 AFIO_EVCR_PIN_PX0 /*!< EVENTOUT on pin 0 */ 00055 #define AFIO_EVENTOUT_PIN_1 AFIO_EVCR_PIN_PX1 /*!< EVENTOUT on pin 1 */ 00056 #define AFIO_EVENTOUT_PIN_2 AFIO_EVCR_PIN_PX2 /*!< EVENTOUT on pin 2 */ 00057 #define AFIO_EVENTOUT_PIN_3 AFIO_EVCR_PIN_PX3 /*!< EVENTOUT on pin 3 */ 00058 #define AFIO_EVENTOUT_PIN_4 AFIO_EVCR_PIN_PX4 /*!< EVENTOUT on pin 4 */ 00059 #define AFIO_EVENTOUT_PIN_5 AFIO_EVCR_PIN_PX5 /*!< EVENTOUT on pin 5 */ 00060 #define AFIO_EVENTOUT_PIN_6 AFIO_EVCR_PIN_PX6 /*!< EVENTOUT on pin 6 */ 00061 #define AFIO_EVENTOUT_PIN_7 AFIO_EVCR_PIN_PX7 /*!< EVENTOUT on pin 7 */ 00062 #define AFIO_EVENTOUT_PIN_8 AFIO_EVCR_PIN_PX8 /*!< EVENTOUT on pin 8 */ 00063 #define AFIO_EVENTOUT_PIN_9 AFIO_EVCR_PIN_PX9 /*!< EVENTOUT on pin 9 */ 00064 #define AFIO_EVENTOUT_PIN_10 AFIO_EVCR_PIN_PX10 /*!< EVENTOUT on pin 10 */ 00065 #define AFIO_EVENTOUT_PIN_11 AFIO_EVCR_PIN_PX11 /*!< EVENTOUT on pin 11 */ 00066 #define AFIO_EVENTOUT_PIN_12 AFIO_EVCR_PIN_PX12 /*!< EVENTOUT on pin 12 */ 00067 #define AFIO_EVENTOUT_PIN_13 AFIO_EVCR_PIN_PX13 /*!< EVENTOUT on pin 13 */ 00068 #define AFIO_EVENTOUT_PIN_14 AFIO_EVCR_PIN_PX14 /*!< EVENTOUT on pin 14 */ 00069 #define AFIO_EVENTOUT_PIN_15 AFIO_EVCR_PIN_PX15 /*!< EVENTOUT on pin 15 */ 00070 00071 #define IS_AFIO_EVENTOUT_PIN(__PIN__) (((__PIN__) == AFIO_EVENTOUT_PIN_0) || \ 00072 ((__PIN__) == AFIO_EVENTOUT_PIN_1) || \ 00073 ((__PIN__) == AFIO_EVENTOUT_PIN_2) || \ 00074 ((__PIN__) == AFIO_EVENTOUT_PIN_3) || \ 00075 ((__PIN__) == AFIO_EVENTOUT_PIN_4) || \ 00076 ((__PIN__) == AFIO_EVENTOUT_PIN_5) || \ 00077 ((__PIN__) == AFIO_EVENTOUT_PIN_6) || \ 00078 ((__PIN__) == AFIO_EVENTOUT_PIN_7) || \ 00079 ((__PIN__) == AFIO_EVENTOUT_PIN_8) || \ 00080 ((__PIN__) == AFIO_EVENTOUT_PIN_9) || \ 00081 ((__PIN__) == AFIO_EVENTOUT_PIN_10) || \ 00082 ((__PIN__) == AFIO_EVENTOUT_PIN_11) || \ 00083 ((__PIN__) == AFIO_EVENTOUT_PIN_12) || \ 00084 ((__PIN__) == AFIO_EVENTOUT_PIN_13) || \ 00085 ((__PIN__) == AFIO_EVENTOUT_PIN_14) || \ 00086 ((__PIN__) == AFIO_EVENTOUT_PIN_15)) 00087 /** 00088 * @} 00089 */ 00090 00091 /** @defgroup GPIOEx_EVENTOUT_PORT EVENTOUT Port 00092 * @{ 00093 */ 00094 00095 #define AFIO_EVENTOUT_PORT_A AFIO_EVCR_PORT_PA /*!< EVENTOUT on port A */ 00096 #define AFIO_EVENTOUT_PORT_B AFIO_EVCR_PORT_PB /*!< EVENTOUT on port B */ 00097 #define AFIO_EVENTOUT_PORT_C AFIO_EVCR_PORT_PC /*!< EVENTOUT on port C */ 00098 #define AFIO_EVENTOUT_PORT_D AFIO_EVCR_PORT_PD /*!< EVENTOUT on port D */ 00099 #define AFIO_EVENTOUT_PORT_E AFIO_EVCR_PORT_PE /*!< EVENTOUT on port E */ 00100 00101 #define IS_AFIO_EVENTOUT_PORT(__PORT__) (((__PORT__) == AFIO_EVENTOUT_PORT_A) || \ 00102 ((__PORT__) == AFIO_EVENTOUT_PORT_B) || \ 00103 ((__PORT__) == AFIO_EVENTOUT_PORT_C) || \ 00104 ((__PORT__) == AFIO_EVENTOUT_PORT_D) || \ 00105 ((__PORT__) == AFIO_EVENTOUT_PORT_E)) 00106 /** 00107 * @} 00108 */ 00109 00110 /** 00111 * @} 00112 */ 00113 00114 /** @defgroup GPIOEx_AFIO_AF_REMAPPING Alternate Function Remapping 00115 * @brief This section propose definition to remap the alternate function to some other port/pins. 00116 * @{ 00117 */ 00118 00119 /** 00120 * @brief Enable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI. 00121 * @note ENABLE: Remap (NSS/PA15, SCK/PB3, MISO/PB4, MOSI/PB5) 00122 * @retval None 00123 */ 00124 #define __HAL_AFIO_REMAP_SPI1_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_SPI1_REMAP) 00125 00126 /** 00127 * @brief Disable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI. 00128 * @note DISABLE: No remap (NSS/PA4, SCK/PA5, MISO/PA6, MOSI/PA7) 00129 * @retval None 00130 */ 00131 #define __HAL_AFIO_REMAP_SPI1_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_SPI1_REMAP) 00132 00133 /** 00134 * @brief Enable the remapping of I2C1 alternate function SCL and SDA. 00135 * @note ENABLE: Remap (SCL/PB8, SDA/PB9) 00136 * @retval None 00137 */ 00138 #define __HAL_AFIO_REMAP_I2C1_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_I2C1_REMAP) 00139 00140 /** 00141 * @brief Disable the remapping of I2C1 alternate function SCL and SDA. 00142 * @note DISABLE: No remap (SCL/PB6, SDA/PB7) 00143 * @retval None 00144 */ 00145 #define __HAL_AFIO_REMAP_I2C1_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_I2C1_REMAP) 00146 00147 /** 00148 * @brief Enable the remapping of USART1 alternate function TX and RX. 00149 * @note ENABLE: Remap (TX/PB6, RX/PB7) 00150 * @retval None 00151 */ 00152 #define __HAL_AFIO_REMAP_USART1_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_USART1_REMAP) 00153 00154 /** 00155 * @brief Disable the remapping of USART1 alternate function TX and RX. 00156 * @note DISABLE: No remap (TX/PA9, RX/PA10) 00157 * @retval None 00158 */ 00159 #define __HAL_AFIO_REMAP_USART1_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_USART1_REMAP) 00160 00161 /** 00162 * @brief Enable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX. 00163 * @note ENABLE: Remap (CTS/PD3, RTS/PD4, TX/PD5, RX/PD6, CK/PD7) 00164 * @retval None 00165 */ 00166 #define __HAL_AFIO_REMAP_USART2_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_USART2_REMAP) 00167 00168 /** 00169 * @brief Disable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX. 00170 * @note DISABLE: No remap (CTS/PA0, RTS/PA1, TX/PA2, RX/PA3, CK/PA4) 00171 * @retval None 00172 */ 00173 #define __HAL_AFIO_REMAP_USART2_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_USART2_REMAP) 00174 00175 /** 00176 * @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX. 00177 * @note ENABLE: Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12) 00178 * @retval None 00179 */ 00180 #define __HAL_AFIO_REMAP_USART3_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_USART3_REMAP_FULLREMAP, AFIO_MAPR_USART3_REMAP_FULLREMAP) 00181 00182 /** 00183 * @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX. 00184 * @note PARTIAL: Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14) 00185 * @retval None 00186 */ 00187 #define __HAL_AFIO_REMAP_USART3_PARTIAL() AFIO_REMAP_PARTIAL(AFIO_MAPR_USART3_REMAP_PARTIALREMAP, AFIO_MAPR_USART3_REMAP_FULLREMAP) 00188 00189 /** 00190 * @brief Disable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX. 00191 * @note DISABLE: No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14) 00192 * @retval None 00193 */ 00194 #define __HAL_AFIO_REMAP_USART3_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_USART3_REMAP_NOREMAP, AFIO_MAPR_USART3_REMAP_FULLREMAP) 00195 00196 /** 00197 * @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN) 00198 * @note ENABLE: Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12) 00199 * @retval None 00200 */ 00201 #define __HAL_AFIO_REMAP_TIM1_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM1_REMAP_FULLREMAP, AFIO_MAPR_TIM1_REMAP_FULLREMAP) 00202 00203 /** 00204 * @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN) 00205 * @note PARTIAL: Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1) 00206 * @retval None 00207 */ 00208 #define __HAL_AFIO_REMAP_TIM1_PARTIAL() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM1_REMAP_PARTIALREMAP, AFIO_MAPR_TIM1_REMAP_FULLREMAP) 00209 00210 /** 00211 * @brief Disable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN) 00212 * @note DISABLE: No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15) 00213 * @retval None 00214 */ 00215 #define __HAL_AFIO_REMAP_TIM1_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM1_REMAP_NOREMAP, AFIO_MAPR_TIM1_REMAP_FULLREMAP) 00216 00217 /** 00218 * @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR) 00219 * @note ENABLE: Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11) 00220 * @retval None 00221 */ 00222 #define __HAL_AFIO_REMAP_TIM2_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_FULLREMAP, AFIO_MAPR_TIM2_REMAP_FULLREMAP) 00223 00224 /** 00225 * @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR) 00226 * @note PARTIAL_2: Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11) 00227 * @retval None 00228 */ 00229 #define __HAL_AFIO_REMAP_TIM2_PARTIAL_2() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2, AFIO_MAPR_TIM2_REMAP_FULLREMAP) 00230 00231 /** 00232 * @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR) 00233 * @note PARTIAL_1: Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3) 00234 * @retval None 00235 */ 00236 #define __HAL_AFIO_REMAP_TIM2_PARTIAL_1() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1, AFIO_MAPR_TIM2_REMAP_FULLREMAP) 00237 00238 /** 00239 * @brief Disable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR) 00240 * @note DISABLE: No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3) 00241 * @retval None 00242 */ 00243 #define __HAL_AFIO_REMAP_TIM2_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_NOREMAP, AFIO_MAPR_TIM2_REMAP_FULLREMAP) 00244 00245 /** 00246 * @brief Enable the remapping of TIM3 alternate function channels 1 to 4 00247 * @note ENABLE: Full remap (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9) 00248 * @note TIM3_ETR on PE0 is not re-mapped. 00249 * @retval None 00250 */ 00251 #define __HAL_AFIO_REMAP_TIM3_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM3_REMAP_FULLREMAP, AFIO_MAPR_TIM3_REMAP_FULLREMAP) 00252 00253 /** 00254 * @brief Enable the remapping of TIM3 alternate function channels 1 to 4 00255 * @note PARTIAL: Partial remap (CH1/PB4, CH2/PB5, CH3/PB0, CH4/PB1) 00256 * @note TIM3_ETR on PE0 is not re-mapped. 00257 * @retval None 00258 */ 00259 #define __HAL_AFIO_REMAP_TIM3_PARTIAL() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM3_REMAP_PARTIALREMAP, AFIO_MAPR_TIM3_REMAP_FULLREMAP) 00260 00261 /** 00262 * @brief Disable the remapping of TIM3 alternate function channels 1 to 4 00263 * @note DISABLE: No remap (CH1/PA6, CH2/PA7, CH3/PB0, CH4/PB1) 00264 * @note TIM3_ETR on PE0 is not re-mapped. 00265 * @retval None 00266 */ 00267 #define __HAL_AFIO_REMAP_TIM3_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM3_REMAP_NOREMAP, AFIO_MAPR_TIM3_REMAP_FULLREMAP) 00268 00269 /** 00270 * @brief Enable the remapping of TIM4 alternate function channels 1 to 4. 00271 * @note ENABLE: Full remap (TIM4_CH1/PD12, TIM4_CH2/PD13, TIM4_CH3/PD14, TIM4_CH4/PD15) 00272 * @note TIM4_ETR on PE0 is not re-mapped. 00273 * @retval None 00274 */ 00275 #define __HAL_AFIO_REMAP_TIM4_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_TIM4_REMAP) 00276 00277 /** 00278 * @brief Disable the remapping of TIM4 alternate function channels 1 to 4. 00279 * @note DISABLE: No remap (TIM4_CH1/PB6, TIM4_CH2/PB7, TIM4_CH3/PB8, TIM4_CH4/PB9) 00280 * @note TIM4_ETR on PE0 is not re-mapped. 00281 * @retval None 00282 */ 00283 #define __HAL_AFIO_REMAP_TIM4_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_TIM4_REMAP) 00284 00285 #if defined(AFIO_MAPR_CAN_REMAP_REMAP1) 00286 00287 /** 00288 * @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface. 00289 * @note CASE 1: CAN_RX mapped to PA11, CAN_TX mapped to PA12 00290 * @retval None 00291 */ 00292 #define __HAL_AFIO_REMAP_CAN1_1() AFIO_REMAP_PARTIAL(AFIO_MAPR_CAN_REMAP_REMAP1, AFIO_MAPR_CAN_REMAP) 00293 00294 /** 00295 * @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface. 00296 * @note CASE 2: CAN_RX mapped to PB8, CAN_TX mapped to PB9 (not available on 36-pin package) 00297 * @retval None 00298 */ 00299 #define __HAL_AFIO_REMAP_CAN1_2() AFIO_REMAP_PARTIAL(AFIO_MAPR_CAN_REMAP_REMAP2, AFIO_MAPR_CAN_REMAP) 00300 00301 /** 00302 * @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface. 00303 * @note CASE 3: CAN_RX mapped to PD0, CAN_TX mapped to PD1 00304 * @retval None 00305 */ 00306 #define __HAL_AFIO_REMAP_CAN1_3() AFIO_REMAP_PARTIAL(AFIO_MAPR_CAN_REMAP_REMAP3, AFIO_MAPR_CAN_REMAP) 00307 00308 #endif 00309 00310 /** 00311 * @brief Enable the remapping of PD0 and PD1. When the HSE oscillator is not used 00312 * (application running on internal 8 MHz RC) PD0 and PD1 can be mapped on OSC_IN and 00313 * OSC_OUT. This is available only on 36, 48 and 64 pins packages (PD0 and PD1 are available 00314 * on 100-pin and 144-pin packages, no need for remapping). 00315 * @note ENABLE: PD0 remapped on OSC_IN, PD1 remapped on OSC_OUT. 00316 * @retval None 00317 */ 00318 #define __HAL_AFIO_REMAP_PD01_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_PD01_REMAP) 00319 00320 /** 00321 * @brief Disable the remapping of PD0 and PD1. When the HSE oscillator is not used 00322 * (application running on internal 8 MHz RC) PD0 and PD1 can be mapped on OSC_IN and 00323 * OSC_OUT. This is available only on 36, 48 and 64 pins packages (PD0 and PD1 are available 00324 * on 100-pin and 144-pin packages, no need for remapping). 00325 * @note DISABLE: No remapping of PD0 and PD1 00326 * @retval None 00327 */ 00328 #define __HAL_AFIO_REMAP_PD01_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_PD01_REMAP) 00329 00330 #if defined(AFIO_MAPR_TIM5CH4_IREMAP) 00331 /** 00332 * @brief Enable the remapping of TIM5CH4. 00333 * @note ENABLE: LSI internal clock is connected to TIM5_CH4 input for calibration purpose. 00334 * @note This function is available only in high density value line devices. 00335 * @retval None 00336 */ 00337 #define __HAL_AFIO_REMAP_TIM5CH4_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_TIM5CH4_IREMAP) 00338 00339 /** 00340 * @brief Disable the remapping of TIM5CH4. 00341 * @note DISABLE: TIM5_CH4 is connected to PA3 00342 * @note This function is available only in high density value line devices. 00343 * @retval None 00344 */ 00345 #define __HAL_AFIO_REMAP_TIM5CH4_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_TIM5CH4_IREMAP) 00346 #endif 00347 00348 #if defined(AFIO_MAPR_ETH_REMAP) 00349 /** 00350 * @brief Enable the remapping of Ethernet MAC connections with the PHY. 00351 * @note ENABLE: Remap (RX_DV-CRS_DV/PD8, RXD0/PD9, RXD1/PD10, RXD2/PD11, RXD3/PD12) 00352 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00353 * @retval None 00354 */ 00355 #define __HAL_AFIO_REMAP_ETH_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ETH_REMAP) 00356 00357 /** 00358 * @brief Disable the remapping of Ethernet MAC connections with the PHY. 00359 * @note DISABLE: No remap (RX_DV-CRS_DV/PA7, RXD0/PC4, RXD1/PC5, RXD2/PB0, RXD3/PB1) 00360 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00361 * @retval None 00362 */ 00363 #define __HAL_AFIO_REMAP_ETH_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ETH_REMAP) 00364 #endif 00365 00366 #if defined(AFIO_MAPR_CAN2_REMAP) 00367 00368 /** 00369 * @brief Enable the remapping of CAN2 alternate function CAN2_RX and CAN2_TX. 00370 * @note ENABLE: Remap (CAN2_RX/PB5, CAN2_TX/PB6) 00371 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00372 * @retval None 00373 */ 00374 #define __HAL_AFIO_REMAP_CAN2_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_CAN2_REMAP) 00375 00376 /** 00377 * @brief Disable the remapping of CAN2 alternate function CAN2_RX and CAN2_TX. 00378 * @note DISABLE: No remap (CAN2_RX/PB12, CAN2_TX/PB13) 00379 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00380 * @retval None 00381 */ 00382 #define __HAL_AFIO_REMAP_CAN2_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_CAN2_REMAP) 00383 #endif 00384 00385 #if defined(AFIO_MAPR_MII_RMII_SEL) 00386 /** 00387 * @brief Configures the Ethernet MAC internally for use with an external MII or RMII PHY. 00388 * @note ETH_RMII: Configure Ethernet MAC for connection with an RMII PHY 00389 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00390 * @retval None 00391 */ 00392 #define __HAL_AFIO_ETH_RMII() AFIO_REMAP_ENABLE(AFIO_MAPR_MII_RMII_SEL) 00393 00394 /** 00395 * @brief Configures the Ethernet MAC internally for use with an external MII or RMII PHY. 00396 * @note ETH_MII: Configure Ethernet MAC for connection with an MII PHY 00397 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00398 * @retval None 00399 */ 00400 #define __HAL_AFIO_ETH_MII() AFIO_REMAP_DISABLE(AFIO_MAPR_MII_RMII_SEL) 00401 #endif 00402 00403 /** 00404 * @brief Enable the remapping of ADC1_ETRGINJ (ADC 1 External trigger injected conversion). 00405 * @note ENABLE: ADC1 External Event injected conversion is connected to TIM8 Channel4. 00406 * @retval None 00407 */ 00408 #define __HAL_AFIO_REMAP_ADC1_ETRGINJ_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC1_ETRGINJ_REMAP) 00409 00410 /** 00411 * @brief Disable the remapping of ADC1_ETRGINJ (ADC 1 External trigger injected conversion). 00412 * @note DISABLE: ADC1 External trigger injected conversion is connected to EXTI15 00413 * @retval None 00414 */ 00415 #define __HAL_AFIO_REMAP_ADC1_ETRGINJ_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC1_ETRGINJ_REMAP) 00416 00417 /** 00418 * @brief Enable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion). 00419 * @note ENABLE: ADC1 External Event regular conversion is connected to TIM8 TRG0. 00420 * @retval None 00421 */ 00422 #define __HAL_AFIO_REMAP_ADC1_ETRGREG_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC1_ETRGREG_REMAP) 00423 00424 /** 00425 * @brief Disable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion). 00426 * @note DISABLE: ADC1 External trigger regular conversion is connected to EXTI11 00427 * @retval None 00428 */ 00429 #define __HAL_AFIO_REMAP_ADC1_ETRGREG_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC1_ETRGREG_REMAP) 00430 00431 #if defined(AFIO_MAPR_ADC2_ETRGINJ_REMAP) 00432 00433 /** 00434 * @brief Enable the remapping of ADC2_ETRGREG (ADC 2 External trigger injected conversion). 00435 * @note ENABLE: ADC2 External Event injected conversion is connected to TIM8 Channel4. 00436 * @retval None 00437 */ 00438 #define __HAL_AFIO_REMAP_ADC2_ETRGINJ_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC2_ETRGINJ_REMAP) 00439 00440 /** 00441 * @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger injected conversion). 00442 * @note DISABLE: ADC2 External trigger injected conversion is connected to EXTI15 00443 * @retval None 00444 */ 00445 #define __HAL_AFIO_REMAP_ADC2_ETRGINJ_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC2_ETRGINJ_REMAP) 00446 #endif 00447 00448 #if defined (AFIO_MAPR_ADC2_ETRGREG_REMAP) 00449 00450 /** 00451 * @brief Enable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion). 00452 * @note ENABLE: ADC2 External Event regular conversion is connected to TIM8 TRG0. 00453 * @retval None 00454 */ 00455 #define __HAL_AFIO_REMAP_ADC2_ETRGREG_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC2_ETRGREG_REMAP) 00456 00457 /** 00458 * @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion). 00459 * @note DISABLE: ADC2 External trigger regular conversion is connected to EXTI11 00460 * @retval None 00461 */ 00462 #define __HAL_AFIO_REMAP_ADC2_ETRGREG_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC2_ETRGREG_REMAP) 00463 #endif 00464 00465 /** 00466 * @brief Enable the Serial wire JTAG configuration 00467 * @note ENABLE: Full SWJ (JTAG-DP + SW-DP): Reset State 00468 * @retval None 00469 */ 00470 #define __HAL_AFIO_REMAP_SWJ_ENABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_RESET) 00471 00472 /** 00473 * @brief Enable the Serial wire JTAG configuration 00474 * @note NONJTRST: Full SWJ (JTAG-DP + SW-DP) but without NJTRST 00475 * @retval None 00476 */ 00477 #define __HAL_AFIO_REMAP_SWJ_NONJTRST() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_NOJNTRST) 00478 00479 /** 00480 * @brief Enable the Serial wire JTAG configuration 00481 * @note NOJTAG: JTAG-DP Disabled and SW-DP Enabled 00482 * @retval None 00483 */ 00484 00485 #define __HAL_AFIO_REMAP_SWJ_NOJTAG() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_JTAGDISABLE) 00486 00487 /** 00488 * @brief Disable the Serial wire JTAG configuration 00489 * @note DISABLE: JTAG-DP Disabled and SW-DP Disabled 00490 * @retval None 00491 */ 00492 #define __HAL_AFIO_REMAP_SWJ_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_DISABLE) 00493 00494 #if defined(AFIO_MAPR_SPI3_REMAP) 00495 00496 /** 00497 * @brief Enable the remapping of SPI3 alternate functions SPI3_NSS/I2S3_WS, SPI3_SCK/I2S3_CK, SPI3_MISO, SPI3_MOSI/I2S3_SD. 00498 * @note ENABLE: Remap (SPI3_NSS-I2S3_WS/PA4, SPI3_SCK-I2S3_CK/PC10, SPI3_MISO/PC11, SPI3_MOSI-I2S3_SD/PC12) 00499 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00500 * @retval None 00501 */ 00502 #define __HAL_AFIO_REMAP_SPI3_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_SPI3_REMAP) 00503 00504 /** 00505 * @brief Disable the remapping of SPI3 alternate functions SPI3_NSS/I2S3_WS, SPI3_SCK/I2S3_CK, SPI3_MISO, SPI3_MOSI/I2S3_SD. 00506 * @note DISABLE: No remap (SPI3_NSS-I2S3_WS/PA15, SPI3_SCK-I2S3_CK/PB3, SPI3_MISO/PB4, SPI3_MOSI-I2S3_SD/PB5). 00507 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00508 * @retval None 00509 */ 00510 #define __HAL_AFIO_REMAP_SPI3_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_SPI3_REMAP) 00511 #endif 00512 00513 #if defined(AFIO_MAPR_TIM2ITR1_IREMAP) 00514 00515 /** 00516 * @brief Control of TIM2_ITR1 internal mapping. 00517 * @note TO_USB: Connect USB OTG SOF (Start of Frame) output to TIM2_ITR1 for calibration purposes. 00518 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00519 * @retval None 00520 */ 00521 #define __HAL_AFIO_TIM2ITR1_TO_USB() AFIO_REMAP_ENABLE(AFIO_MAPR_TIM2ITR1_IREMAP) 00522 00523 /** 00524 * @brief Control of TIM2_ITR1 internal mapping. 00525 * @note TO_ETH: Connect TIM2_ITR1 internally to the Ethernet PTP output for calibration purposes. 00526 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00527 * @retval None 00528 */ 00529 #define __HAL_AFIO_TIM2ITR1_TO_ETH() AFIO_REMAP_DISABLE(AFIO_MAPR_TIM2ITR1_IREMAP) 00530 #endif 00531 00532 #if defined(AFIO_MAPR_PTP_PPS_REMAP) 00533 00534 /** 00535 * @brief Enable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion). 00536 * @note ENABLE: PTP_PPS is output on PB5 pin. 00537 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00538 * @retval None 00539 */ 00540 #define __HAL_AFIO_ETH_PTP_PPS_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_PTP_PPS_REMAP) 00541 00542 /** 00543 * @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion). 00544 * @note DISABLE: PTP_PPS not output on PB5 pin. 00545 * @note This bit is available only in connectivity line devices and is reserved otherwise. 00546 * @retval None 00547 */ 00548 #define __HAL_AFIO_ETH_PTP_PPS_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_PTP_PPS_REMAP) 00549 #endif 00550 00551 #if defined(AFIO_MAPR2_TIM9_REMAP) 00552 00553 /** 00554 * @brief Enable the remapping of TIM9_CH1 and TIM9_CH2. 00555 * @note ENABLE: Remap (TIM9_CH1 on PE5 and TIM9_CH2 on PE6). 00556 * @retval None 00557 */ 00558 #define __HAL_AFIO_REMAP_TIM9_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM9_REMAP) 00559 00560 /** 00561 * @brief Disable the remapping of TIM9_CH1 and TIM9_CH2. 00562 * @note DISABLE: No remap (TIM9_CH1 on PA2 and TIM9_CH2 on PA3). 00563 * @retval None 00564 */ 00565 #define __HAL_AFIO_REMAP_TIM9_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM9_REMAP) 00566 #endif 00567 00568 #if defined(AFIO_MAPR2_TIM10_REMAP) 00569 00570 /** 00571 * @brief Enable the remapping of TIM10_CH1. 00572 * @note ENABLE: Remap (TIM10_CH1 on PF6). 00573 * @retval None 00574 */ 00575 #define __HAL_AFIO_REMAP_TIM10_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM10_REMAP) 00576 00577 /** 00578 * @brief Disable the remapping of TIM10_CH1. 00579 * @note DISABLE: No remap (TIM10_CH1 on PB8). 00580 * @retval None 00581 */ 00582 #define __HAL_AFIO_REMAP_TIM10_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM10_REMAP) 00583 #endif 00584 00585 #if defined(AFIO_MAPR2_TIM11_REMAP) 00586 /** 00587 * @brief Enable the remapping of TIM11_CH1. 00588 * @note ENABLE: Remap (TIM11_CH1 on PF7). 00589 * @retval None 00590 */ 00591 #define __HAL_AFIO_REMAP_TIM11_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM11_REMAP) 00592 00593 /** 00594 * @brief Disable the remapping of TIM11_CH1. 00595 * @note DISABLE: No remap (TIM11_CH1 on PB9). 00596 * @retval None 00597 */ 00598 #define __HAL_AFIO_REMAP_TIM11_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM11_REMAP) 00599 #endif 00600 00601 #if defined(AFIO_MAPR2_TIM13_REMAP) 00602 00603 /** 00604 * @brief Enable the remapping of TIM13_CH1. 00605 * @note ENABLE: Remap STM32F100:(TIM13_CH1 on PF8). Others:(TIM13_CH1 on PB0). 00606 * @retval None 00607 */ 00608 #define __HAL_AFIO_REMAP_TIM13_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM13_REMAP) 00609 00610 /** 00611 * @brief Disable the remapping of TIM13_CH1. 00612 * @note DISABLE: No remap STM32F100:(TIM13_CH1 on PA6). Others:(TIM13_CH1 on PC8). 00613 * @retval None 00614 */ 00615 #define __HAL_AFIO_REMAP_TIM13_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM13_REMAP) 00616 #endif 00617 00618 #if defined(AFIO_MAPR2_TIM14_REMAP) 00619 00620 /** 00621 * @brief Enable the remapping of TIM14_CH1. 00622 * @note ENABLE: Remap STM32F100:(TIM14_CH1 on PB1). Others:(TIM14_CH1 on PF9). 00623 * @retval None 00624 */ 00625 #define __HAL_AFIO_REMAP_TIM14_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM14_REMAP) 00626 00627 /** 00628 * @brief Disable the remapping of TIM14_CH1. 00629 * @note DISABLE: No remap STM32F100:(TIM14_CH1 on PC9). Others:(TIM14_CH1 on PA7). 00630 * @retval None 00631 */ 00632 #define __HAL_AFIO_REMAP_TIM14_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM14_REMAP) 00633 #endif 00634 00635 #if defined(AFIO_MAPR2_FSMC_NADV_REMAP) 00636 00637 /** 00638 * @brief Controls the use of the optional FSMC_NADV signal. 00639 * @note DISCONNECTED: The NADV signal is not connected. The I/O pin can be used by another peripheral. 00640 * @retval None 00641 */ 00642 #define __HAL_AFIO_FSMCNADV_DISCONNECTED() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_FSMC_NADV_REMAP) 00643 00644 /** 00645 * @brief Controls the use of the optional FSMC_NADV signal. 00646 * @note CONNECTED: The NADV signal is connected to the output (default). 00647 * @retval None 00648 */ 00649 #define __HAL_AFIO_FSMCNADV_CONNECTED() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_FSMC_NADV_REMAP) 00650 #endif 00651 00652 #if defined(AFIO_MAPR2_TIM15_REMAP) 00653 00654 /** 00655 * @brief Enable the remapping of TIM15_CH1 and TIM15_CH2. 00656 * @note ENABLE: Remap (TIM15_CH1 on PB14 and TIM15_CH2 on PB15). 00657 * @retval None 00658 */ 00659 #define __HAL_AFIO_REMAP_TIM15_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM15_REMAP) 00660 00661 /** 00662 * @brief Disable the remapping of TIM15_CH1 and TIM15_CH2. 00663 * @note DISABLE: No remap (TIM15_CH1 on PA2 and TIM15_CH2 on PA3). 00664 * @retval None 00665 */ 00666 #define __HAL_AFIO_REMAP_TIM15_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM15_REMAP) 00667 #endif 00668 00669 #if defined(AFIO_MAPR2_TIM16_REMAP) 00670 00671 /** 00672 * @brief Enable the remapping of TIM16_CH1. 00673 * @note ENABLE: Remap (TIM16_CH1 on PA6). 00674 * @retval None 00675 */ 00676 #define __HAL_AFIO_REMAP_TIM16_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM16_REMAP) 00677 00678 /** 00679 * @brief Disable the remapping of TIM16_CH1. 00680 * @note DISABLE: No remap (TIM16_CH1 on PB8). 00681 * @retval None 00682 */ 00683 #define __HAL_AFIO_REMAP_TIM16_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM16_REMAP) 00684 #endif 00685 00686 #if defined(AFIO_MAPR2_TIM17_REMAP) 00687 00688 /** 00689 * @brief Enable the remapping of TIM17_CH1. 00690 * @note ENABLE: Remap (TIM17_CH1 on PA7). 00691 * @retval None 00692 */ 00693 #define __HAL_AFIO_REMAP_TIM17_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM17_REMAP) 00694 00695 /** 00696 * @brief Disable the remapping of TIM17_CH1. 00697 * @note DISABLE: No remap (TIM17_CH1 on PB9). 00698 * @retval None 00699 */ 00700 #define __HAL_AFIO_REMAP_TIM17_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM17_REMAP) 00701 #endif 00702 00703 #if defined(AFIO_MAPR2_CEC_REMAP) 00704 00705 /** 00706 * @brief Enable the remapping of CEC. 00707 * @note ENABLE: Remap (CEC on PB10). 00708 * @retval None 00709 */ 00710 #define __HAL_AFIO_REMAP_CEC_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_CEC_REMAP) 00711 00712 /** 00713 * @brief Disable the remapping of CEC. 00714 * @note DISABLE: No remap (CEC on PB8). 00715 * @retval None 00716 */ 00717 #define __HAL_AFIO_REMAP_CEC_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_CEC_REMAP) 00718 #endif 00719 00720 #if defined(AFIO_MAPR2_TIM1_DMA_REMAP) 00721 00722 /** 00723 * @brief Controls the mapping of the TIM1_CH1 TIM1_CH2 DMA requests onto the DMA1 channels. 00724 * @note ENABLE: Remap (TIM1_CH1 DMA request/DMA1 Channel6, TIM1_CH2 DMA request/DMA1 Channel6) 00725 * @retval None 00726 */ 00727 #define __HAL_AFIO_REMAP_TIM1DMA_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM1_DMA_REMAP) 00728 00729 /** 00730 * @brief Controls the mapping of the TIM1_CH1 TIM1_CH2 DMA requests onto the DMA1 channels. 00731 * @note DISABLE: No remap (TIM1_CH1 DMA request/DMA1 Channel2, TIM1_CH2 DMA request/DMA1 Channel3). 00732 * @retval None 00733 */ 00734 #define __HAL_AFIO_REMAP_TIM1DMA_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM1_DMA_REMAP) 00735 #endif 00736 00737 #if defined(AFIO_MAPR2_TIM67_DAC_DMA_REMAP) 00738 00739 /** 00740 * @brief Controls the mapping of the TIM6_DAC1 and TIM7_DAC2 DMA requests onto the DMA1 channels. 00741 * @note ENABLE: Remap (TIM6_DAC1 DMA request/DMA1 Channel3, TIM7_DAC2 DMA request/DMA1 Channel4) 00742 * @retval None 00743 */ 00744 #define __HAL_AFIO_REMAP_TIM67DACDMA_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM67_DAC_DMA_REMAP) 00745 00746 /** 00747 * @brief Controls the mapping of the TIM6_DAC1 and TIM7_DAC2 DMA requests onto the DMA1 channels. 00748 * @note DISABLE: No remap (TIM6_DAC1 DMA request/DMA2 Channel3, TIM7_DAC2 DMA request/DMA2 Channel4) 00749 * @retval None 00750 */ 00751 #define __HAL_AFIO_REMAP_TIM67DACDMA_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM67_DAC_DMA_REMAP) 00752 #endif 00753 00754 #if defined(AFIO_MAPR2_TIM12_REMAP) 00755 00756 /** 00757 * @brief Enable the remapping of TIM12_CH1 and TIM12_CH2. 00758 * @note ENABLE: Remap (TIM12_CH1 on PB12 and TIM12_CH2 on PB13). 00759 * @note This bit is available only in high density value line devices. 00760 * @retval None 00761 */ 00762 #define __HAL_AFIO_REMAP_TIM12_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM12_REMAP) 00763 00764 /** 00765 * @brief Disable the remapping of TIM12_CH1 and TIM12_CH2. 00766 * @note DISABLE: No remap (TIM12_CH1 on PC4 and TIM12_CH2 on PC5). 00767 * @note This bit is available only in high density value line devices. 00768 * @retval None 00769 */ 00770 #define __HAL_AFIO_REMAP_TIM12_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_TIM12_REMAP) 00771 #endif 00772 00773 #if defined(AFIO_MAPR2_MISC_REMAP) 00774 00775 /** 00776 * @brief Miscellaneous features remapping. 00777 * This bit is set and cleared by software. It controls miscellaneous features. 00778 * The DMA2 channel 5 interrupt position in the vector table. 00779 * The timer selection for DAC trigger 3 (TSEL[2:0] = 011, for more details refer to the DAC_CR register). 00780 * @note ENABLE: DMA2 channel 5 interrupt is mapped separately at position 60 and TIM15 TRGO event is 00781 * selected as DAC Trigger 3, TIM15 triggers TIM1/3. 00782 * @note This bit is available only in high density value line devices. 00783 * @retval None 00784 */ 00785 #define __HAL_AFIO_REMAP_MISC_ENABLE() SET_BIT(AFIO->MAPR2, AFIO_MAPR2_MISC_REMAP) 00786 00787 /** 00788 * @brief Miscellaneous features remapping. 00789 * This bit is set and cleared by software. It controls miscellaneous features. 00790 * The DMA2 channel 5 interrupt position in the vector table. 00791 * The timer selection for DAC trigger 3 (TSEL[2:0] = 011, for more details refer to the DAC_CR register). 00792 * @note DISABLE: DMA2 channel 5 interrupt is mapped with DMA2 channel 4 at position 59, TIM5 TRGO 00793 * event is selected as DAC Trigger 3, TIM5 triggers TIM1/3. 00794 * @note This bit is available only in high density value line devices. 00795 * @retval None 00796 */ 00797 #define __HAL_AFIO_REMAP_MISC_DISABLE() CLEAR_BIT(AFIO->MAPR2, AFIO_MAPR2_MISC_REMAP) 00798 #endif 00799 00800 /** 00801 * @} 00802 */ 00803 00804 /** 00805 * @} 00806 */ 00807 00808 /** @defgroup GPIOEx_Private_Macros GPIOEx Private Macros 00809 * @{ 00810 */ 00811 #if defined(STM32F101x6) || defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6) 00812 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\ 00813 ((__GPIOx__) == (GPIOB))? 1uL :\ 00814 ((__GPIOx__) == (GPIOC))? 2uL :3uL) 00815 #elif defined(STM32F100xB) || defined(STM32F101xB) || defined(STM32F103xB) || defined(STM32F105xC) || defined(STM32F107xC) 00816 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\ 00817 ((__GPIOx__) == (GPIOB))? 1uL :\ 00818 ((__GPIOx__) == (GPIOC))? 2uL :\ 00819 ((__GPIOx__) == (GPIOD))? 3uL :4uL) 00820 #elif defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG) 00821 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\ 00822 ((__GPIOx__) == (GPIOB))? 1uL :\ 00823 ((__GPIOx__) == (GPIOC))? 2uL :\ 00824 ((__GPIOx__) == (GPIOD))? 3uL :\ 00825 ((__GPIOx__) == (GPIOE))? 4uL :\ 00826 ((__GPIOx__) == (GPIOF))? 5uL :6uL) 00827 #endif 00828 00829 #define AFIO_REMAP_ENABLE(REMAP_PIN) do{ uint32_t tmpreg = AFIO->MAPR; \ 00830 tmpreg |= AFIO_MAPR_SWJ_CFG; \ 00831 tmpreg |= REMAP_PIN; \ 00832 AFIO->MAPR = tmpreg; \ 00833 }while(0u) 00834 00835 #define AFIO_REMAP_DISABLE(REMAP_PIN) do{ uint32_t tmpreg = AFIO->MAPR; \ 00836 tmpreg |= AFIO_MAPR_SWJ_CFG; \ 00837 tmpreg &= ~REMAP_PIN; \ 00838 AFIO->MAPR = tmpreg; \ 00839 }while(0u) 00840 00841 #define AFIO_REMAP_PARTIAL(REMAP_PIN, REMAP_PIN_MASK) do{ uint32_t tmpreg = AFIO->MAPR; \ 00842 tmpreg &= ~REMAP_PIN_MASK; \ 00843 tmpreg |= AFIO_MAPR_SWJ_CFG; \ 00844 tmpreg |= REMAP_PIN; \ 00845 AFIO->MAPR = tmpreg; \ 00846 }while(0u) 00847 00848 #define AFIO_DBGAFR_CONFIG(DBGAFR_SWJCFG) do{ uint32_t tmpreg = AFIO->MAPR; \ 00849 tmpreg &= ~AFIO_MAPR_SWJ_CFG_Msk; \ 00850 tmpreg |= DBGAFR_SWJCFG; \ 00851 AFIO->MAPR = tmpreg; \ 00852 }while(0u) 00853 00854 /** 00855 * @} 00856 */ 00857 00858 /* Exported macro ------------------------------------------------------------*/ 00859 /* Exported functions --------------------------------------------------------*/ 00860 00861 /** @addtogroup GPIOEx_Exported_Functions 00862 * @{ 00863 */ 00864 00865 /** @addtogroup GPIOEx_Exported_Functions_Group1 00866 * @{ 00867 */ 00868 void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource); 00869 void HAL_GPIOEx_EnableEventout(void); 00870 void HAL_GPIOEx_DisableEventout(void); 00871 00872 /** 00873 * @} 00874 */ 00875 00876 /** 00877 * @} 00878 */ 00879 00880 /** 00881 * @} 00882 */ 00883 00884 /** 00885 * @} 00886 */ 00887 00888 #ifdef __cplusplus 00889 } 00890 #endif 00891 00892 #endif /* STM32F1xx_HAL_GPIO_EX_H */ 00893 00894 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/