Bei Chen Liu / mbed-src

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Thu Mar 12 14:30:49 2015 +0000
Revision:
489:119543c9f674
Synchronized with git revision 051854181516992fb498d51f9ee6e70cbad9e083

Full URL: https://github.com/mbedmicro/mbed/commit/051854181516992fb498d51f9ee6e70cbad9e083/

Fix ksdk mcu HAL - stopbit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32f1xx_hal_gpio_ex.c
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.0.0
mbed_official 489:119543c9f674 6 * @date 15-December-2014
mbed_official 489:119543c9f674 7 * @brief GPIO Extension HAL module driver.
mbed_official 489:119543c9f674 8 * This file provides firmware functions to manage the following
mbed_official 489:119543c9f674 9 * functionalities of the General Purpose Input/Output (GPIO) extension peripheral.
mbed_official 489:119543c9f674 10 * + Extended features functions
mbed_official 489:119543c9f674 11 *
mbed_official 489:119543c9f674 12 @verbatim
mbed_official 489:119543c9f674 13 ==============================================================================
mbed_official 489:119543c9f674 14 ##### GPIO Peripheral extension features #####
mbed_official 489:119543c9f674 15 ==============================================================================
mbed_official 489:119543c9f674 16 [..] GPIO module on STM32F1 family, manage also the AFIO register:
mbed_official 489:119543c9f674 17 (+) Possibility to use the EVENTOUT Cortex feature
mbed_official 489:119543c9f674 18
mbed_official 489:119543c9f674 19 ##### How to use this driver #####
mbed_official 489:119543c9f674 20 ==============================================================================
mbed_official 489:119543c9f674 21 [..] This driver provides functions to use EVENTOUT Cortex feature
mbed_official 489:119543c9f674 22 (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout()
mbed_official 489:119543c9f674 23 (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout()
mbed_official 489:119543c9f674 24 (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout()
mbed_official 489:119543c9f674 25
mbed_official 489:119543c9f674 26 @endverbatim
mbed_official 489:119543c9f674 27 ******************************************************************************
mbed_official 489:119543c9f674 28 * @attention
mbed_official 489:119543c9f674 29 *
mbed_official 489:119543c9f674 30 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 31 *
mbed_official 489:119543c9f674 32 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 33 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 34 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 35 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 36 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 37 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 38 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 39 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 40 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 41 * without specific prior written permission.
mbed_official 489:119543c9f674 42 *
mbed_official 489:119543c9f674 43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 44 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 46 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 49 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 50 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 51 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 53 *
mbed_official 489:119543c9f674 54 ******************************************************************************
mbed_official 489:119543c9f674 55 */
mbed_official 489:119543c9f674 56
mbed_official 489:119543c9f674 57 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 58 #include "stm32f1xx_hal.h"
mbed_official 489:119543c9f674 59
mbed_official 489:119543c9f674 60 /** @addtogroup STM32F1xx_HAL_Driver
mbed_official 489:119543c9f674 61 * @{
mbed_official 489:119543c9f674 62 */
mbed_official 489:119543c9f674 63
mbed_official 489:119543c9f674 64 /** @defgroup GPIOEx GPIOEx
mbed_official 489:119543c9f674 65 * @brief GPIO HAL module driver
mbed_official 489:119543c9f674 66 * @{
mbed_official 489:119543c9f674 67 */
mbed_official 489:119543c9f674 68
mbed_official 489:119543c9f674 69 #ifdef HAL_GPIO_MODULE_ENABLED
mbed_official 489:119543c9f674 70
mbed_official 489:119543c9f674 71 /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions
mbed_official 489:119543c9f674 72 * @{
mbed_official 489:119543c9f674 73 */
mbed_official 489:119543c9f674 74
mbed_official 489:119543c9f674 75 /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions
mbed_official 489:119543c9f674 76 * @brief Extended features functions
mbed_official 489:119543c9f674 77 *
mbed_official 489:119543c9f674 78 @verbatim
mbed_official 489:119543c9f674 79 ==============================================================================
mbed_official 489:119543c9f674 80 ##### Extended features functions #####
mbed_official 489:119543c9f674 81 ==============================================================================
mbed_official 489:119543c9f674 82 [..] This section provides functions allowing to:
mbed_official 489:119543c9f674 83 (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout()
mbed_official 489:119543c9f674 84 (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout()
mbed_official 489:119543c9f674 85 (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout()
mbed_official 489:119543c9f674 86
mbed_official 489:119543c9f674 87 @endverbatim
mbed_official 489:119543c9f674 88 * @{
mbed_official 489:119543c9f674 89 */
mbed_official 489:119543c9f674 90
mbed_official 489:119543c9f674 91 /**
mbed_official 489:119543c9f674 92 * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected.
mbed_official 489:119543c9f674 93 * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal.
mbed_official 489:119543c9f674 94 * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT.
mbed_official 489:119543c9f674 95 * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal.
mbed_official 489:119543c9f674 96 * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN.
mbed_official 489:119543c9f674 97 * @retval None
mbed_official 489:119543c9f674 98 */
mbed_official 489:119543c9f674 99 void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource)
mbed_official 489:119543c9f674 100 {
mbed_official 489:119543c9f674 101 /* Verify the parameters */
mbed_official 489:119543c9f674 102 assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource));
mbed_official 489:119543c9f674 103 assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource));
mbed_official 489:119543c9f674 104
mbed_official 489:119543c9f674 105 /* Apply the new configuration */
mbed_official 489:119543c9f674 106 MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT)|(AFIO_EVCR_PIN), (GPIO_PortSource)|(GPIO_PinSource));
mbed_official 489:119543c9f674 107 }
mbed_official 489:119543c9f674 108
mbed_official 489:119543c9f674 109 /**
mbed_official 489:119543c9f674 110 * @brief Enables the Event Output.
mbed_official 489:119543c9f674 111 * @retval None
mbed_official 489:119543c9f674 112 */
mbed_official 489:119543c9f674 113 void HAL_GPIOEx_EnableEventout(void)
mbed_official 489:119543c9f674 114 {
mbed_official 489:119543c9f674 115 SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE);
mbed_official 489:119543c9f674 116 }
mbed_official 489:119543c9f674 117
mbed_official 489:119543c9f674 118 /**
mbed_official 489:119543c9f674 119 * @brief Disables the Event Output.
mbed_official 489:119543c9f674 120 * @retval None
mbed_official 489:119543c9f674 121 */
mbed_official 489:119543c9f674 122 void HAL_GPIOEx_DisableEventout(void)
mbed_official 489:119543c9f674 123 {
mbed_official 489:119543c9f674 124 CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE);
mbed_official 489:119543c9f674 125 }
mbed_official 489:119543c9f674 126
mbed_official 489:119543c9f674 127 /**
mbed_official 489:119543c9f674 128 * @}
mbed_official 489:119543c9f674 129 */
mbed_official 489:119543c9f674 130
mbed_official 489:119543c9f674 131 /**
mbed_official 489:119543c9f674 132 * @}
mbed_official 489:119543c9f674 133 */
mbed_official 489:119543c9f674 134
mbed_official 489:119543c9f674 135 #endif /* HAL_GPIO_MODULE_ENABLED */
mbed_official 489:119543c9f674 136
mbed_official 489:119543c9f674 137 /**
mbed_official 489:119543c9f674 138 * @}
mbed_official 489:119543c9f674 139 */
mbed_official 489:119543c9f674 140
mbed_official 489:119543c9f674 141 /**
mbed_official 489:119543c9f674 142 * @}
mbed_official 489:119543c9f674 143 */
mbed_official 489:119543c9f674 144
mbed_official 489:119543c9f674 145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/