Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sun May 14 23:18:57 2017 +0000
Revision:
18:6a4db94011d3
Publishing again

Who changed what in which revision?

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