Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
stm32f1xx_hal_gpio_ex.c
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f1xx_hal_gpio_ex.c 00004 * @author MCD Application Team 00005 * @version V1.0.4 00006 * @date 29-April-2016 00007 * @brief GPIO Extension HAL module driver. 00008 * This file provides firmware functions to manage the following 00009 * functionalities of the General Purpose Input/Output (GPIO) extension peripheral. 00010 * + Extended features functions 00011 * 00012 @verbatim 00013 ============================================================================== 00014 ##### GPIO Peripheral extension features ##### 00015 ============================================================================== 00016 [..] GPIO module on STM32F1 family, manage also the AFIO register: 00017 (+) Possibility to use the EVENTOUT Cortex feature 00018 00019 ##### How to use this driver ##### 00020 ============================================================================== 00021 [..] This driver provides functions to use EVENTOUT Cortex feature 00022 (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() 00023 (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() 00024 (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() 00025 00026 @endverbatim 00027 ****************************************************************************** 00028 * @attention 00029 * 00030 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00031 * 00032 * Redistribution and use in source and binary forms, with or without modification, 00033 * are permitted provided that the following conditions are met: 00034 * 1. Redistributions of source code must retain the above copyright notice, 00035 * this list of conditions and the following disclaimer. 00036 * 2. Redistributions in binary form must reproduce the above copyright notice, 00037 * this list of conditions and the following disclaimer in the documentation 00038 * and/or other materials provided with the distribution. 00039 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00040 * may be used to endorse or promote products derived from this software 00041 * without specific prior written permission. 00042 * 00043 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00044 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00045 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00046 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00047 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00048 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00049 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00050 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00051 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00052 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00053 * 00054 ****************************************************************************** 00055 */ 00056 00057 /* Includes ------------------------------------------------------------------*/ 00058 #include "stm32f1xx_hal.h" 00059 00060 /** @addtogroup STM32F1xx_HAL_Driver 00061 * @{ 00062 */ 00063 00064 /** @defgroup GPIOEx GPIOEx 00065 * @brief GPIO HAL module driver 00066 * @{ 00067 */ 00068 00069 #ifdef HAL_GPIO_MODULE_ENABLED 00070 00071 /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions 00072 * @{ 00073 */ 00074 00075 /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions 00076 * @brief Extended features functions 00077 * 00078 @verbatim 00079 ============================================================================== 00080 ##### Extended features functions ##### 00081 ============================================================================== 00082 [..] This section provides functions allowing to: 00083 (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() 00084 (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() 00085 (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() 00086 00087 @endverbatim 00088 * @{ 00089 */ 00090 00091 /** 00092 * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected. 00093 * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal. 00094 * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT. 00095 * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal. 00096 * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN. 00097 * @retval None 00098 */ 00099 void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource) 00100 { 00101 /* Verify the parameters */ 00102 assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource)); 00103 assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource)); 00104 00105 /* Apply the new configuration */ 00106 MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT)|(AFIO_EVCR_PIN), (GPIO_PortSource)|(GPIO_PinSource)); 00107 } 00108 00109 /** 00110 * @brief Enables the Event Output. 00111 * @retval None 00112 */ 00113 void HAL_GPIOEx_EnableEventout(void) 00114 { 00115 SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); 00116 } 00117 00118 /** 00119 * @brief Disables the Event Output. 00120 * @retval None 00121 */ 00122 void HAL_GPIOEx_DisableEventout(void) 00123 { 00124 CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); 00125 } 00126 00127 /** 00128 * @} 00129 */ 00130 00131 /** 00132 * @} 00133 */ 00134 00135 #endif /* HAL_GPIO_MODULE_ENABLED */ 00136 00137 /** 00138 * @} 00139 */ 00140 00141 /** 00142 * @} 00143 */ 00144 00145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 15:37:23 by
1.7.2