Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 18 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /** |
1 | /** |
2 | ****************************************************************************** |
2 | ****************************************************************************** |
3 | * @file stm32f1xx_hal_gpio_ex.c |
3 | * @file stm32f1xx_hal_gpio_ex.c |
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @brief GPIO Extension HAL module driver. |
5 | * @brief GPIO Extension HAL module driver. |
6 | * This file provides firmware functions to manage the following |
6 | * This file provides firmware functions to manage the following |
7 | * functionalities of the General Purpose Input/Output (GPIO) extension peripheral. |
7 | * functionalities of the General Purpose Input/Output (GPIO) extension peripheral. |
8 | * + Extended features functions |
8 | * + Extended features functions |
9 | * |
9 | * |
10 | @verbatim |
10 | ****************************************************************************** |
11 | ============================================================================== |
11 | * @attention |
12 | ##### GPIO Peripheral extension features ##### |
12 | * |
13 | ============================================================================== |
13 | * Copyright (c) 2016 STMicroelectronics. |
14 | [..] GPIO module on STM32F1 family, manage also the AFIO register: |
14 | * All rights reserved. |
15 | (+) Possibility to use the EVENTOUT Cortex feature |
15 | * |
16 | 16 | * This software is licensed under terms that can be found in the LICENSE file |
|
17 | ##### How to use this driver ##### |
17 | * in the root directory of this software component. |
18 | ============================================================================== |
18 | * If no LICENSE file comes with this software, it is provided AS-IS. |
19 | [..] This driver provides functions to use EVENTOUT Cortex feature |
19 | * |
20 | (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() |
20 | ****************************************************************************** |
21 | (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() |
21 | @verbatim |
22 | (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() |
22 | ============================================================================== |
23 | 23 | ##### GPIO Peripheral extension features ##### |
|
24 | @endverbatim |
24 | ============================================================================== |
25 | ****************************************************************************** |
25 | [..] GPIO module on STM32F1 family, manage also the AFIO register: |
26 | * @attention |
26 | (+) Possibility to use the EVENTOUT Cortex feature |
27 | * |
27 | |
28 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
28 | ##### How to use this driver ##### |
29 | * All rights reserved.</center></h2> |
29 | ============================================================================== |
30 | * |
30 | [..] This driver provides functions to use EVENTOUT Cortex feature |
31 | * This software component is licensed by ST under BSD 3-Clause license, |
31 | (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() |
32 | * the "License"; You may not use this file except in compliance with the |
32 | (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() |
33 | * License. You may obtain a copy of the License at: |
33 | (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() |
34 | * opensource.org/licenses/BSD-3-Clause |
34 | |
35 | * |
35 | @endverbatim |
36 | ****************************************************************************** |
36 | ****************************************************************************** |
37 | */ |
37 | */ |
38 | 38 | ||
39 | /* Includes ------------------------------------------------------------------*/ |
39 | /* Includes ------------------------------------------------------------------*/ |
40 | #include "stm32f1xx_hal.h" |
40 | #include "stm32f1xx_hal.h" |
41 | 41 | ||
42 | /** @addtogroup STM32F1xx_HAL_Driver |
42 | /** @addtogroup STM32F1xx_HAL_Driver |
43 | * @{ |
43 | * @{ |
44 | */ |
44 | */ |
45 | 45 | ||
46 | /** @defgroup GPIOEx GPIOEx |
46 | /** @defgroup GPIOEx GPIOEx |
47 | * @brief GPIO HAL module driver |
47 | * @brief GPIO HAL module driver |
48 | * @{ |
48 | * @{ |
49 | */ |
49 | */ |
50 | 50 | ||
51 | #ifdef HAL_GPIO_MODULE_ENABLED |
51 | #ifdef HAL_GPIO_MODULE_ENABLED |
52 | 52 | ||
53 | /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions |
53 | /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions |
54 | * @{ |
54 | * @{ |
55 | */ |
55 | */ |
56 | 56 | ||
57 | /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions |
57 | /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions |
58 | * @brief Extended features functions |
58 | * @brief Extended features functions |
59 | * |
59 | * |
60 | @verbatim |
60 | @verbatim |
61 | ============================================================================== |
61 | ============================================================================== |
62 | ##### Extended features functions ##### |
62 | ##### Extended features functions ##### |
63 | ============================================================================== |
63 | ============================================================================== |
64 | [..] This section provides functions allowing to: |
64 | [..] This section provides functions allowing to: |
65 | (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() |
65 | (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() |
66 | (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() |
66 | (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() |
67 | (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() |
67 | (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() |
68 | 68 | ||
69 | @endverbatim |
69 | @endverbatim |
70 | * @{ |
70 | * @{ |
71 | */ |
71 | */ |
72 | 72 | ||
73 | /** |
73 | /** |
74 | * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected. |
74 | * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected. |
75 | * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal. |
75 | * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal. |
76 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT. |
76 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT. |
77 | * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal. |
77 | * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal. |
78 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN. |
78 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN. |
79 | * @retval None |
79 | * @retval None |
80 | */ |
80 | */ |
81 | void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource) |
81 | void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource) |
82 | { |
82 | { |
83 | /* Verify the parameters */ |
83 | /* Verify the parameters */ |
84 | assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource)); |
84 | assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource)); |
85 | assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource)); |
85 | assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource)); |
86 | 86 | ||
87 | /* Apply the new configuration */ |
87 | /* Apply the new configuration */ |
88 | MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (GPIO_PortSource) | (GPIO_PinSource)); |
88 | MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (GPIO_PortSource) | (GPIO_PinSource)); |
89 | } |
89 | } |
90 | 90 | ||
91 | /** |
91 | /** |
92 | * @brief Enables the Event Output. |
92 | * @brief Enables the Event Output. |
93 | * @retval None |
93 | * @retval None |
94 | */ |
94 | */ |
95 | void HAL_GPIOEx_EnableEventout(void) |
95 | void HAL_GPIOEx_EnableEventout(void) |
96 | { |
96 | { |
97 | SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); |
97 | SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); |
98 | } |
98 | } |
99 | 99 | ||
100 | /** |
100 | /** |
101 | * @brief Disables the Event Output. |
101 | * @brief Disables the Event Output. |
102 | * @retval None |
102 | * @retval None |
103 | */ |
103 | */ |
104 | void HAL_GPIOEx_DisableEventout(void) |
104 | void HAL_GPIOEx_DisableEventout(void) |
105 | { |
105 | { |
106 | CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); |
106 | CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); |
107 | } |
107 | } |
108 | 108 | ||
109 | /** |
109 | /** |
110 | * @} |
110 | * @} |
111 | */ |
111 | */ |
112 | 112 | ||
113 | /** |
113 | /** |
114 | * @} |
114 | * @} |
115 | */ |
115 | */ |
116 | 116 | ||
117 | #endif /* HAL_GPIO_MODULE_ENABLED */ |
117 | #endif /* HAL_GPIO_MODULE_ENABLED */ |
118 | 118 | ||
119 | /** |
119 | /** |
120 | * @} |
120 | * @} |
121 | */ |
121 | */ |
122 | 122 | ||
123 | /** |
123 | /** |
124 | * @} |
124 | * @} |
125 | */ |
125 | */ |
126 | 126 | ||
127 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
- |