Subversion Repositories DashDisplay

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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