annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_gpio.h @ 82:a6f0881074a4 kittz

+i2c analog noise filtering spi more stable
author Dmitry Romanov <kitt@bk.ru>
date Tue, 20 Nov 2018 12:08:19 +0300
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_hal_gpio.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of GPIO HAL module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_HAL_GPIO_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_GPIO_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "stm32f4xx_hal_def.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL_Driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 /** @addtogroup GPIO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 /** @defgroup GPIO_Exported_Types GPIO Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 * @brief GPIO Init structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 This parameter can be any value of @ref GPIO_pins_define */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 This parameter can be a value of @ref GPIO_mode_define */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 uint32_t Pull; /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 This parameter can be a value of @ref GPIO_pull_define */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint32_t Speed; /*!< Specifies the speed for the selected pins.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 This parameter can be a value of @ref GPIO_speed_define */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 uint32_t Alternate; /*!< Peripheral to be connected to the selected pins.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 This parameter can be a value of @ref GPIO_Alternate_function_selection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 }GPIO_InitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 * @brief GPIO Bit SET and Bit RESET enumeration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 GPIO_PIN_RESET = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 GPIO_PIN_SET
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 }GPIO_PinState;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 /** @defgroup GPIO_Exported_Constants GPIO Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 /** @defgroup GPIO_pins_define GPIO pins define
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 #define GPIO_PIN_0 ((uint16_t)0x0001) /* Pin 0 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 #define GPIO_PIN_1 ((uint16_t)0x0002) /* Pin 1 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 #define GPIO_PIN_2 ((uint16_t)0x0004) /* Pin 2 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 #define GPIO_PIN_3 ((uint16_t)0x0008) /* Pin 3 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 #define GPIO_PIN_4 ((uint16_t)0x0010) /* Pin 4 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 #define GPIO_PIN_5 ((uint16_t)0x0020) /* Pin 5 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 #define GPIO_PIN_6 ((uint16_t)0x0040) /* Pin 6 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 #define GPIO_PIN_7 ((uint16_t)0x0080) /* Pin 7 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 #define GPIO_PIN_8 ((uint16_t)0x0100) /* Pin 8 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 #define GPIO_PIN_9 ((uint16_t)0x0200) /* Pin 9 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 #define GPIO_PIN_10 ((uint16_t)0x0400) /* Pin 10 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 #define GPIO_PIN_11 ((uint16_t)0x0800) /* Pin 11 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 #define GPIO_PIN_12 ((uint16_t)0x1000) /* Pin 12 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 #define GPIO_PIN_13 ((uint16_t)0x2000) /* Pin 13 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 #define GPIO_PIN_14 ((uint16_t)0x4000) /* Pin 14 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 #define GPIO_PIN_15 ((uint16_t)0x8000) /* Pin 15 selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 #define GPIO_PIN_All ((uint16_t)0xFFFF) /* All pins selected */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 #define GPIO_PIN_MASK ((uint32_t)0x0000FFFF) /* PIN mask for assert test */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 /** @defgroup GPIO_mode_define GPIO mode define
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 * @brief GPIO Configuration Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 * Elements values convention: 0xX0yz00YZ
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 * - X : GPIO mode or EXTI Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 * - y : External IT or Event trigger detection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 * - z : IO configuration on External IT or Event
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 * - Y : Output type (Push Pull or Open Drain)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 * - Z : IO Direction mode (Input, Output, Alternate or Analog)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 #define GPIO_MODE_INPUT ((uint32_t)0x00000000) /*!< Input Floating Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 #define GPIO_MODE_OUTPUT_PP ((uint32_t)0x00000001) /*!< Output Push Pull Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 #define GPIO_MODE_OUTPUT_OD ((uint32_t)0x00000011) /*!< Output Open Drain Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 #define GPIO_MODE_AF_PP ((uint32_t)0x00000002) /*!< Alternate Function Push Pull Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 #define GPIO_MODE_AF_OD ((uint32_t)0x00000012) /*!< Alternate Function Open Drain Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 #define GPIO_MODE_ANALOG ((uint32_t)0x00000003) /*!< Analog Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 #define GPIO_MODE_IT_RISING ((uint32_t)0x10110000) /*!< External Interrupt Mode with Rising edge trigger detection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 #define GPIO_MODE_IT_FALLING ((uint32_t)0x10210000) /*!< External Interrupt Mode with Falling edge trigger detection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 #define GPIO_MODE_IT_RISING_FALLING ((uint32_t)0x10310000) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 #define GPIO_MODE_EVT_RISING ((uint32_t)0x10120000) /*!< External Event Mode with Rising edge trigger detection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 #define GPIO_MODE_EVT_FALLING ((uint32_t)0x10220000) /*!< External Event Mode with Falling edge trigger detection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 #define GPIO_MODE_EVT_RISING_FALLING ((uint32_t)0x10320000) /*!< External Event Mode with Rising/Falling edge trigger detection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 /** @defgroup GPIO_speed_define GPIO speed define
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 * @brief GPIO Output Maximum frequency
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 #define GPIO_SPEED_LOW ((uint32_t)0x00000000) /*!< Low speed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 #define GPIO_SPEED_MEDIUM ((uint32_t)0x00000001) /*!< Medium speed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 #define GPIO_SPEED_FAST ((uint32_t)0x00000002) /*!< Fast speed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 #define GPIO_SPEED_HIGH ((uint32_t)0x00000003) /*!< High speed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 /** @defgroup GPIO_pull_define GPIO pull define
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 * @brief GPIO Pull-Up or Pull-Down Activation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 #define GPIO_NOPULL ((uint32_t)0x00000000) /*!< No Pull-up or Pull-down activation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 #define GPIO_PULLUP ((uint32_t)0x00000001) /*!< Pull-up activation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 #define GPIO_PULLDOWN ((uint32_t)0x00000002) /*!< Pull-down activation */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 /** @defgroup GPIO_Exported_Macros GPIO Exported Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 * @brief Checks whether the specified EXTI line flag is set or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 * @param __EXTI_LINE__: specifies the EXTI line flag to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 * This parameter can be GPIO_PIN_x where x can be(0..15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 * @retval The new state of __EXTI_LINE__ (SET or RESET).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 #define __HAL_GPIO_EXTI_GET_FLAG(__EXTI_LINE__) (EXTI->PR & (__EXTI_LINE__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 * @brief Clears the EXTI's line pending flags.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 * @param __EXTI_LINE__: specifies the EXTI lines flags to clear.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 #define __HAL_GPIO_EXTI_CLEAR_FLAG(__EXTI_LINE__) (EXTI->PR = (__EXTI_LINE__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 * @brief Checks whether the specified EXTI line is asserted or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 * @param __EXTI_LINE__: specifies the EXTI line to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 * This parameter can be GPIO_PIN_x where x can be(0..15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 * @retval The new state of __EXTI_LINE__ (SET or RESET).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 #define __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__) (EXTI->PR & (__EXTI_LINE__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 * @brief Clears the EXTI's line pending bits.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 * @param __EXTI_LINE__: specifies the EXTI lines to clear.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 #define __HAL_GPIO_EXTI_CLEAR_IT(__EXTI_LINE__) (EXTI->PR = (__EXTI_LINE__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 * @brief Generates a Software interrupt on selected EXTI line.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 * @param __EXTI_LINE__: specifies the EXTI line to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 * This parameter can be GPIO_PIN_x where x can be(0..15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 #define __HAL_GPIO_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 /* Include GPIO HAL Extension module */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 #include "stm32f4xx_hal_gpio_ex.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 /** @addtogroup GPIO_Exported_Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 /** @addtogroup GPIO_Exported_Functions_Group1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 /* Initialization and de-initialization functions *****************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 /** @addtogroup GPIO_Exported_Functions_Group2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 /* IO operation functions *****************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 /* Private constants ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 /** @defgroup GPIO_Private_Constants GPIO Private Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 /* Private macros ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 /** @defgroup GPIO_Private_Macros GPIO Private Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 #define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 #define IS_GPIO_PIN(PIN) (((PIN) & GPIO_PIN_MASK ) != (uint32_t)0x00)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 #define IS_GPIO_MODE(MODE) (((MODE) == GPIO_MODE_INPUT) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 ((MODE) == GPIO_MODE_OUTPUT_PP) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 ((MODE) == GPIO_MODE_OUTPUT_OD) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 ((MODE) == GPIO_MODE_AF_PP) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 ((MODE) == GPIO_MODE_AF_OD) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 ((MODE) == GPIO_MODE_IT_RISING) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 ((MODE) == GPIO_MODE_IT_FALLING) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 ((MODE) == GPIO_MODE_IT_RISING_FALLING) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 ((MODE) == GPIO_MODE_EVT_RISING) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 ((MODE) == GPIO_MODE_EVT_FALLING) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 ((MODE) == GPIO_MODE_EVT_RISING_FALLING) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 ((MODE) == GPIO_MODE_ANALOG))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 #define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_SPEED_LOW) || ((SPEED) == GPIO_SPEED_MEDIUM) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 ((SPEED) == GPIO_SPEED_FAST) || ((SPEED) == GPIO_SPEED_HIGH))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 #define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 ((PULL) == GPIO_PULLDOWN))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 /** @defgroup GPIO_Private_Functions GPIO Private Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 #endif /* __STM32F4xx_HAL_GPIO_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/