STM32F103xB HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f1xx_hal_gpio_ex.c 00004 * @author MCD Application Team 00005 * @brief GPIO Extension HAL module driver. 00006 * This file provides firmware functions to manage the following 00007 * functionalities of the General Purpose Input/Output (GPIO) extension peripheral. 00008 * + Extended features functions 00009 * 00010 @verbatim 00011 ============================================================================== 00012 ##### GPIO Peripheral extension features ##### 00013 ============================================================================== 00014 [..] GPIO module on STM32F1 family, manage also the AFIO register: 00015 (+) Possibility to use the EVENTOUT Cortex feature 00016 00017 ##### How to use this driver ##### 00018 ============================================================================== 00019 [..] This driver provides functions to use EVENTOUT Cortex feature 00020 (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() 00021 (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() 00022 (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() 00023 00024 @endverbatim 00025 ****************************************************************************** 00026 * @attention 00027 * 00028 * <h2><center>© Copyright (c) 2016 STMicroelectronics. 00029 * All rights reserved.</center></h2> 00030 * 00031 * This software component is licensed by ST under BSD 3-Clause license, 00032 * the "License"; You may not use this file except in compliance with the 00033 * License. You may obtain a copy of the License at: 00034 * opensource.org/licenses/BSD-3-Clause 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Includes ------------------------------------------------------------------*/ 00040 #include "stm32f1xx_hal.h" 00041 00042 /** @addtogroup STM32F1xx_HAL_Driver 00043 * @{ 00044 */ 00045 00046 /** @defgroup GPIOEx GPIOEx 00047 * @brief GPIO HAL module driver 00048 * @{ 00049 */ 00050 00051 #ifdef HAL_GPIO_MODULE_ENABLED 00052 00053 /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions 00054 * @{ 00055 */ 00056 00057 /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions 00058 * @brief Extended features functions 00059 * 00060 @verbatim 00061 ============================================================================== 00062 ##### Extended features functions ##### 00063 ============================================================================== 00064 [..] This section provides functions allowing to: 00065 (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() 00066 (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() 00067 (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() 00068 00069 @endverbatim 00070 * @{ 00071 */ 00072 00073 /** 00074 * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected. 00075 * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal. 00076 * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT. 00077 * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal. 00078 * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN. 00079 * @retval None 00080 */ 00081 void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource) 00082 { 00083 /* Verify the parameters */ 00084 assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource)); 00085 assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource)); 00086 00087 /* Apply the new configuration */ 00088 MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (GPIO_PortSource) | (GPIO_PinSource)); 00089 } 00090 00091 /** 00092 * @brief Enables the Event Output. 00093 * @retval None 00094 */ 00095 void HAL_GPIOEx_EnableEventout(void) 00096 { 00097 SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); 00098 } 00099 00100 /** 00101 * @brief Disables the Event Output. 00102 * @retval None 00103 */ 00104 void HAL_GPIOEx_DisableEventout(void) 00105 { 00106 CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); 00107 } 00108 00109 /** 00110 * @} 00111 */ 00112 00113 /** 00114 * @} 00115 */ 00116 00117 #endif /* HAL_GPIO_MODULE_ENABLED */ 00118 00119 /** 00120 * @} 00121 */ 00122 00123 /** 00124 * @} 00125 */ 00126 00127 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/