Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /**
sahilmgandhi 18:6a4db94011d3 2 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 3 * @file stm32f4xx_hal_gpio.c
sahilmgandhi 18:6a4db94011d3 4 * @author MCD Application Team
sahilmgandhi 18:6a4db94011d3 5 * @version V1.5.0
sahilmgandhi 18:6a4db94011d3 6 * @date 06-May-2016
sahilmgandhi 18:6a4db94011d3 7 * @brief GPIO HAL module driver.
sahilmgandhi 18:6a4db94011d3 8 * This file provides firmware functions to manage the following
sahilmgandhi 18:6a4db94011d3 9 * functionalities of the General Purpose Input/Output (GPIO) peripheral:
sahilmgandhi 18:6a4db94011d3 10 * + Initialization and de-initialization functions
sahilmgandhi 18:6a4db94011d3 11 * + IO operation functions
sahilmgandhi 18:6a4db94011d3 12 *
sahilmgandhi 18:6a4db94011d3 13 @verbatim
sahilmgandhi 18:6a4db94011d3 14 ==============================================================================
sahilmgandhi 18:6a4db94011d3 15 ##### GPIO Peripheral features #####
sahilmgandhi 18:6a4db94011d3 16 ==============================================================================
sahilmgandhi 18:6a4db94011d3 17 [..]
sahilmgandhi 18:6a4db94011d3 18 Subject to the specific hardware characteristics of each I/O port listed in the datasheet, each
sahilmgandhi 18:6a4db94011d3 19 port bit of the General Purpose IO (GPIO) Ports, can be individually configured by software
sahilmgandhi 18:6a4db94011d3 20 in several modes:
sahilmgandhi 18:6a4db94011d3 21 (+) Input mode
sahilmgandhi 18:6a4db94011d3 22 (+) Analog mode
sahilmgandhi 18:6a4db94011d3 23 (+) Output mode
sahilmgandhi 18:6a4db94011d3 24 (+) Alternate function mode
sahilmgandhi 18:6a4db94011d3 25 (+) External interrupt/event lines
sahilmgandhi 18:6a4db94011d3 26
sahilmgandhi 18:6a4db94011d3 27 [..]
sahilmgandhi 18:6a4db94011d3 28 During and just after reset, the alternate functions and external interrupt
sahilmgandhi 18:6a4db94011d3 29 lines are not active and the I/O ports are configured in input floating mode.
sahilmgandhi 18:6a4db94011d3 30
sahilmgandhi 18:6a4db94011d3 31 [..]
sahilmgandhi 18:6a4db94011d3 32 All GPIO pins have weak internal pull-up and pull-down resistors, which can be
sahilmgandhi 18:6a4db94011d3 33 activated or not.
sahilmgandhi 18:6a4db94011d3 34
sahilmgandhi 18:6a4db94011d3 35 [..]
sahilmgandhi 18:6a4db94011d3 36 In Output or Alternate mode, each IO can be configured on open-drain or push-pull
sahilmgandhi 18:6a4db94011d3 37 type and the IO speed can be selected depending on the VDD value.
sahilmgandhi 18:6a4db94011d3 38
sahilmgandhi 18:6a4db94011d3 39 [..]
sahilmgandhi 18:6a4db94011d3 40 All ports have external interrupt/event capability. To use external interrupt
sahilmgandhi 18:6a4db94011d3 41 lines, the port must be configured in input mode. All available GPIO pins are
sahilmgandhi 18:6a4db94011d3 42 connected to the 16 external interrupt/event lines from EXTI0 to EXTI15.
sahilmgandhi 18:6a4db94011d3 43
sahilmgandhi 18:6a4db94011d3 44 [..]
sahilmgandhi 18:6a4db94011d3 45 The external interrupt/event controller consists of up to 23 edge detectors
sahilmgandhi 18:6a4db94011d3 46 (16 lines are connected to GPIO) for generating event/interrupt requests (each
sahilmgandhi 18:6a4db94011d3 47 input line can be independently configured to select the type (interrupt or event)
sahilmgandhi 18:6a4db94011d3 48 and the corresponding trigger event (rising or falling or both). Each line can
sahilmgandhi 18:6a4db94011d3 49 also be masked independently.
sahilmgandhi 18:6a4db94011d3 50
sahilmgandhi 18:6a4db94011d3 51 ##### How to use this driver #####
sahilmgandhi 18:6a4db94011d3 52 ==============================================================================
sahilmgandhi 18:6a4db94011d3 53 [..]
sahilmgandhi 18:6a4db94011d3 54 (#) Enable the GPIO AHB clock using the following function: __HAL_RCC_GPIOx_CLK_ENABLE().
sahilmgandhi 18:6a4db94011d3 55
sahilmgandhi 18:6a4db94011d3 56 (#) Configure the GPIO pin(s) using HAL_GPIO_Init().
sahilmgandhi 18:6a4db94011d3 57 (++) Configure the IO mode using "Mode" member from GPIO_InitTypeDef structure
sahilmgandhi 18:6a4db94011d3 58 (++) Activate Pull-up, Pull-down resistor using "Pull" member from GPIO_InitTypeDef
sahilmgandhi 18:6a4db94011d3 59 structure.
sahilmgandhi 18:6a4db94011d3 60 (++) In case of Output or alternate function mode selection: the speed is
sahilmgandhi 18:6a4db94011d3 61 configured through "Speed" member from GPIO_InitTypeDef structure.
sahilmgandhi 18:6a4db94011d3 62 (++) In alternate mode is selection, the alternate function connected to the IO
sahilmgandhi 18:6a4db94011d3 63 is configured through "Alternate" member from GPIO_InitTypeDef structure.
sahilmgandhi 18:6a4db94011d3 64 (++) Analog mode is required when a pin is to be used as ADC channel
sahilmgandhi 18:6a4db94011d3 65 or DAC output.
sahilmgandhi 18:6a4db94011d3 66 (++) In case of external interrupt/event selection the "Mode" member from
sahilmgandhi 18:6a4db94011d3 67 GPIO_InitTypeDef structure select the type (interrupt or event) and
sahilmgandhi 18:6a4db94011d3 68 the corresponding trigger event (rising or falling or both).
sahilmgandhi 18:6a4db94011d3 69
sahilmgandhi 18:6a4db94011d3 70 (#) In case of external interrupt/event mode selection, configure NVIC IRQ priority
sahilmgandhi 18:6a4db94011d3 71 mapped to the EXTI line using HAL_NVIC_SetPriority() and enable it using
sahilmgandhi 18:6a4db94011d3 72 HAL_NVIC_EnableIRQ().
sahilmgandhi 18:6a4db94011d3 73
sahilmgandhi 18:6a4db94011d3 74 (#) To get the level of a pin configured in input mode use HAL_GPIO_ReadPin().
sahilmgandhi 18:6a4db94011d3 75
sahilmgandhi 18:6a4db94011d3 76 (#) To set/reset the level of a pin configured in output mode use
sahilmgandhi 18:6a4db94011d3 77 HAL_GPIO_WritePin()/HAL_GPIO_TogglePin().
sahilmgandhi 18:6a4db94011d3 78
sahilmgandhi 18:6a4db94011d3 79 (#) To lock pin configuration until next reset use HAL_GPIO_LockPin().
sahilmgandhi 18:6a4db94011d3 80
sahilmgandhi 18:6a4db94011d3 81
sahilmgandhi 18:6a4db94011d3 82 (#) During and just after reset, the alternate functions are not
sahilmgandhi 18:6a4db94011d3 83 active and the GPIO pins are configured in input floating mode (except JTAG
sahilmgandhi 18:6a4db94011d3 84 pins).
sahilmgandhi 18:6a4db94011d3 85
sahilmgandhi 18:6a4db94011d3 86 (#) The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general purpose
sahilmgandhi 18:6a4db94011d3 87 (PC14 and PC15, respectively) when the LSE oscillator is off. The LSE has
sahilmgandhi 18:6a4db94011d3 88 priority over the GPIO function.
sahilmgandhi 18:6a4db94011d3 89
sahilmgandhi 18:6a4db94011d3 90 (#) The HSE oscillator pins OSC_IN/OSC_OUT can be used as
sahilmgandhi 18:6a4db94011d3 91 general purpose PH0 and PH1, respectively, when the HSE oscillator is off.
sahilmgandhi 18:6a4db94011d3 92 The HSE has priority over the GPIO function.
sahilmgandhi 18:6a4db94011d3 93
sahilmgandhi 18:6a4db94011d3 94 @endverbatim
sahilmgandhi 18:6a4db94011d3 95 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 96 * @attention
sahilmgandhi 18:6a4db94011d3 97 *
sahilmgandhi 18:6a4db94011d3 98 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
sahilmgandhi 18:6a4db94011d3 99 *
sahilmgandhi 18:6a4db94011d3 100 * Redistribution and use in source and binary forms, with or without modification,
sahilmgandhi 18:6a4db94011d3 101 * are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 102 * 1. Redistributions of source code must retain the above copyright notice,
sahilmgandhi 18:6a4db94011d3 103 * this list of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 104 * 2. Redistributions in binary form must reproduce the above copyright notice,
sahilmgandhi 18:6a4db94011d3 105 * this list of conditions and the following disclaimer in the documentation
sahilmgandhi 18:6a4db94011d3 106 * and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 107 * 3. Neither the name of STMicroelectronics nor the names of its contributors
sahilmgandhi 18:6a4db94011d3 108 * may be used to endorse or promote products derived from this software
sahilmgandhi 18:6a4db94011d3 109 * without specific prior written permission.
sahilmgandhi 18:6a4db94011d3 110 *
sahilmgandhi 18:6a4db94011d3 111 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
sahilmgandhi 18:6a4db94011d3 112 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sahilmgandhi 18:6a4db94011d3 113 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
sahilmgandhi 18:6a4db94011d3 114 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
sahilmgandhi 18:6a4db94011d3 115 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sahilmgandhi 18:6a4db94011d3 116 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
sahilmgandhi 18:6a4db94011d3 117 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
sahilmgandhi 18:6a4db94011d3 118 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
sahilmgandhi 18:6a4db94011d3 119 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
sahilmgandhi 18:6a4db94011d3 120 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 121 *
sahilmgandhi 18:6a4db94011d3 122 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 123 */
sahilmgandhi 18:6a4db94011d3 124
sahilmgandhi 18:6a4db94011d3 125 /* Includes ------------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 126 #include "stm32f4xx_hal.h"
sahilmgandhi 18:6a4db94011d3 127
sahilmgandhi 18:6a4db94011d3 128 /** @addtogroup STM32F4xx_HAL_Driver
sahilmgandhi 18:6a4db94011d3 129 * @{
sahilmgandhi 18:6a4db94011d3 130 */
sahilmgandhi 18:6a4db94011d3 131
sahilmgandhi 18:6a4db94011d3 132 /** @defgroup GPIO GPIO
sahilmgandhi 18:6a4db94011d3 133 * @brief GPIO HAL module driver
sahilmgandhi 18:6a4db94011d3 134 * @{
sahilmgandhi 18:6a4db94011d3 135 */
sahilmgandhi 18:6a4db94011d3 136
sahilmgandhi 18:6a4db94011d3 137 #ifdef HAL_GPIO_MODULE_ENABLED
sahilmgandhi 18:6a4db94011d3 138
sahilmgandhi 18:6a4db94011d3 139 /* Private typedef -----------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 140 /* Private define ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 141 /** @addtogroup GPIO_Private_Constants GPIO Private Constants
sahilmgandhi 18:6a4db94011d3 142 * @{
sahilmgandhi 18:6a4db94011d3 143 */
sahilmgandhi 18:6a4db94011d3 144 #define GPIO_MODE ((uint32_t)0x00000003U)
sahilmgandhi 18:6a4db94011d3 145 #define EXTI_MODE ((uint32_t)0x10000000U)
sahilmgandhi 18:6a4db94011d3 146 #define GPIO_MODE_IT ((uint32_t)0x00010000U)
sahilmgandhi 18:6a4db94011d3 147 #define GPIO_MODE_EVT ((uint32_t)0x00020000U)
sahilmgandhi 18:6a4db94011d3 148 #define RISING_EDGE ((uint32_t)0x00100000U)
sahilmgandhi 18:6a4db94011d3 149 #define FALLING_EDGE ((uint32_t)0x00200000U)
sahilmgandhi 18:6a4db94011d3 150 #define GPIO_OUTPUT_TYPE ((uint32_t)0x00000010U)
sahilmgandhi 18:6a4db94011d3 151
sahilmgandhi 18:6a4db94011d3 152 #define GPIO_NUMBER ((uint32_t)16U)
sahilmgandhi 18:6a4db94011d3 153 /**
sahilmgandhi 18:6a4db94011d3 154 * @}
sahilmgandhi 18:6a4db94011d3 155 */
sahilmgandhi 18:6a4db94011d3 156 /* Private macro -------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 157 /* Private variables ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 158 /* Private function prototypes -----------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 159 /* Private functions ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 160 /* Exported functions --------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 161 /** @defgroup GPIO_Exported_Functions GPIO Exported Functions
sahilmgandhi 18:6a4db94011d3 162 * @{
sahilmgandhi 18:6a4db94011d3 163 */
sahilmgandhi 18:6a4db94011d3 164
sahilmgandhi 18:6a4db94011d3 165 /** @defgroup GPIO_Exported_Functions_Group1 Initialization and de-initialization functions
sahilmgandhi 18:6a4db94011d3 166 * @brief Initialization and Configuration functions
sahilmgandhi 18:6a4db94011d3 167 *
sahilmgandhi 18:6a4db94011d3 168 @verbatim
sahilmgandhi 18:6a4db94011d3 169 ===============================================================================
sahilmgandhi 18:6a4db94011d3 170 ##### Initialization and de-initialization functions #####
sahilmgandhi 18:6a4db94011d3 171 ===============================================================================
sahilmgandhi 18:6a4db94011d3 172 [..]
sahilmgandhi 18:6a4db94011d3 173 This section provides functions allowing to initialize and de-initialize the GPIOs
sahilmgandhi 18:6a4db94011d3 174 to be ready for use.
sahilmgandhi 18:6a4db94011d3 175
sahilmgandhi 18:6a4db94011d3 176 @endverbatim
sahilmgandhi 18:6a4db94011d3 177 * @{
sahilmgandhi 18:6a4db94011d3 178 */
sahilmgandhi 18:6a4db94011d3 179
sahilmgandhi 18:6a4db94011d3 180
sahilmgandhi 18:6a4db94011d3 181 /**
sahilmgandhi 18:6a4db94011d3 182 * @brief Initializes the GPIOx peripheral according to the specified parameters in the GPIO_Init.
sahilmgandhi 18:6a4db94011d3 183 * @param GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32F429X device or
sahilmgandhi 18:6a4db94011d3 184 * x can be (A..I) to select the GPIO peripheral for STM32F40XX and STM32F427X devices.
sahilmgandhi 18:6a4db94011d3 185 * @param GPIO_Init: pointer to a GPIO_InitTypeDef structure that contains
sahilmgandhi 18:6a4db94011d3 186 * the configuration information for the specified GPIO peripheral.
sahilmgandhi 18:6a4db94011d3 187 * @retval None
sahilmgandhi 18:6a4db94011d3 188 */
sahilmgandhi 18:6a4db94011d3 189 void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
sahilmgandhi 18:6a4db94011d3 190 {
sahilmgandhi 18:6a4db94011d3 191 uint32_t position;
sahilmgandhi 18:6a4db94011d3 192 uint32_t ioposition = 0x00U;
sahilmgandhi 18:6a4db94011d3 193 uint32_t iocurrent = 0x00U;
sahilmgandhi 18:6a4db94011d3 194 uint32_t temp = 0x00U;
sahilmgandhi 18:6a4db94011d3 195
sahilmgandhi 18:6a4db94011d3 196 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 197 assert_param(IS_GPIO_ALL_INSTANCE(GPIOx));
sahilmgandhi 18:6a4db94011d3 198 assert_param(IS_GPIO_PIN(GPIO_Init->Pin));
sahilmgandhi 18:6a4db94011d3 199 assert_param(IS_GPIO_MODE(GPIO_Init->Mode));
sahilmgandhi 18:6a4db94011d3 200 assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
sahilmgandhi 18:6a4db94011d3 201
sahilmgandhi 18:6a4db94011d3 202 /* Configure the port pins */
sahilmgandhi 18:6a4db94011d3 203 for(position = 0U; position < GPIO_NUMBER; position++)
sahilmgandhi 18:6a4db94011d3 204 {
sahilmgandhi 18:6a4db94011d3 205 /* Get the IO position */
sahilmgandhi 18:6a4db94011d3 206 ioposition = ((uint32_t)0x01U) << position;
sahilmgandhi 18:6a4db94011d3 207 /* Get the current IO position */
sahilmgandhi 18:6a4db94011d3 208 iocurrent = (uint32_t)(GPIO_Init->Pin) & ioposition;
sahilmgandhi 18:6a4db94011d3 209
sahilmgandhi 18:6a4db94011d3 210 if(iocurrent == ioposition)
sahilmgandhi 18:6a4db94011d3 211 {
sahilmgandhi 18:6a4db94011d3 212 /*--------------------- GPIO Mode Configuration ------------------------*/
sahilmgandhi 18:6a4db94011d3 213 /* In case of Alternate function mode selection */
sahilmgandhi 18:6a4db94011d3 214 if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
sahilmgandhi 18:6a4db94011d3 215 {
sahilmgandhi 18:6a4db94011d3 216 /* Check the Alternate function parameter */
sahilmgandhi 18:6a4db94011d3 217 assert_param(IS_GPIO_AF(GPIO_Init->Alternate));
sahilmgandhi 18:6a4db94011d3 218 /* Configure Alternate function mapped with the current IO */
sahilmgandhi 18:6a4db94011d3 219 temp = GPIOx->AFR[position >> 3U];
sahilmgandhi 18:6a4db94011d3 220 temp &= ~((uint32_t)0xFU << ((uint32_t)(position & (uint32_t)0x07U) * 4U)) ;
sahilmgandhi 18:6a4db94011d3 221 temp |= ((uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & (uint32_t)0x07U) * 4U));
sahilmgandhi 18:6a4db94011d3 222 GPIOx->AFR[position >> 3U] = temp;
sahilmgandhi 18:6a4db94011d3 223 }
sahilmgandhi 18:6a4db94011d3 224
sahilmgandhi 18:6a4db94011d3 225 /* Configure IO Direction mode (Input, Output, Alternate or Analog) */
sahilmgandhi 18:6a4db94011d3 226 temp = GPIOx->MODER;
sahilmgandhi 18:6a4db94011d3 227 temp &= ~(GPIO_MODER_MODER0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 228 temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U));
sahilmgandhi 18:6a4db94011d3 229 GPIOx->MODER = temp;
sahilmgandhi 18:6a4db94011d3 230
sahilmgandhi 18:6a4db94011d3 231 /* In case of Output or Alternate function mode selection */
sahilmgandhi 18:6a4db94011d3 232 if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
sahilmgandhi 18:6a4db94011d3 233 (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
sahilmgandhi 18:6a4db94011d3 234 {
sahilmgandhi 18:6a4db94011d3 235 /* Check the Speed parameter */
sahilmgandhi 18:6a4db94011d3 236 assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
sahilmgandhi 18:6a4db94011d3 237 /* Configure the IO Speed */
sahilmgandhi 18:6a4db94011d3 238 temp = GPIOx->OSPEEDR;
sahilmgandhi 18:6a4db94011d3 239 temp &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 240 temp |= (GPIO_Init->Speed << (position * 2U));
sahilmgandhi 18:6a4db94011d3 241 GPIOx->OSPEEDR = temp;
sahilmgandhi 18:6a4db94011d3 242
sahilmgandhi 18:6a4db94011d3 243 /* Configure the IO Output Type */
sahilmgandhi 18:6a4db94011d3 244 temp = GPIOx->OTYPER;
sahilmgandhi 18:6a4db94011d3 245 temp &= ~(GPIO_OTYPER_OT_0 << position) ;
sahilmgandhi 18:6a4db94011d3 246 temp |= (((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4U) << position);
sahilmgandhi 18:6a4db94011d3 247 GPIOx->OTYPER = temp;
sahilmgandhi 18:6a4db94011d3 248 }
sahilmgandhi 18:6a4db94011d3 249
sahilmgandhi 18:6a4db94011d3 250 /* Activate the Pull-up or Pull down resistor for the current IO */
sahilmgandhi 18:6a4db94011d3 251 temp = GPIOx->PUPDR;
sahilmgandhi 18:6a4db94011d3 252 temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 253 temp |= ((GPIO_Init->Pull) << (position * 2U));
sahilmgandhi 18:6a4db94011d3 254 GPIOx->PUPDR = temp;
sahilmgandhi 18:6a4db94011d3 255
sahilmgandhi 18:6a4db94011d3 256 /*--------------------- EXTI Mode Configuration ------------------------*/
sahilmgandhi 18:6a4db94011d3 257 /* Configure the External Interrupt or event for the current IO */
sahilmgandhi 18:6a4db94011d3 258 if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
sahilmgandhi 18:6a4db94011d3 259 {
sahilmgandhi 18:6a4db94011d3 260 /* Enable SYSCFG Clock */
sahilmgandhi 18:6a4db94011d3 261 __HAL_RCC_SYSCFG_CLK_ENABLE();
sahilmgandhi 18:6a4db94011d3 262
sahilmgandhi 18:6a4db94011d3 263 temp = SYSCFG->EXTICR[position >> 2U];
sahilmgandhi 18:6a4db94011d3 264 temp &= ~(((uint32_t)0x0FU) << (4U * (position & 0x03U)));
sahilmgandhi 18:6a4db94011d3 265 temp |= ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U)));
sahilmgandhi 18:6a4db94011d3 266 SYSCFG->EXTICR[position >> 2U] = temp;
sahilmgandhi 18:6a4db94011d3 267
sahilmgandhi 18:6a4db94011d3 268 /* Clear EXTI line configuration */
sahilmgandhi 18:6a4db94011d3 269 temp = EXTI->IMR;
sahilmgandhi 18:6a4db94011d3 270 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 271 if((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
sahilmgandhi 18:6a4db94011d3 272 {
sahilmgandhi 18:6a4db94011d3 273 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 274 }
sahilmgandhi 18:6a4db94011d3 275 EXTI->IMR = temp;
sahilmgandhi 18:6a4db94011d3 276
sahilmgandhi 18:6a4db94011d3 277 temp = EXTI->EMR;
sahilmgandhi 18:6a4db94011d3 278 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 279 if((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
sahilmgandhi 18:6a4db94011d3 280 {
sahilmgandhi 18:6a4db94011d3 281 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 282 }
sahilmgandhi 18:6a4db94011d3 283 EXTI->EMR = temp;
sahilmgandhi 18:6a4db94011d3 284
sahilmgandhi 18:6a4db94011d3 285 /* Clear Rising Falling edge configuration */
sahilmgandhi 18:6a4db94011d3 286 temp = EXTI->RTSR;
sahilmgandhi 18:6a4db94011d3 287 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 288 if((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
sahilmgandhi 18:6a4db94011d3 289 {
sahilmgandhi 18:6a4db94011d3 290 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 291 }
sahilmgandhi 18:6a4db94011d3 292 EXTI->RTSR = temp;
sahilmgandhi 18:6a4db94011d3 293
sahilmgandhi 18:6a4db94011d3 294 temp = EXTI->FTSR;
sahilmgandhi 18:6a4db94011d3 295 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 296 if((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
sahilmgandhi 18:6a4db94011d3 297 {
sahilmgandhi 18:6a4db94011d3 298 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 299 }
sahilmgandhi 18:6a4db94011d3 300 EXTI->FTSR = temp;
sahilmgandhi 18:6a4db94011d3 301 }
sahilmgandhi 18:6a4db94011d3 302 }
sahilmgandhi 18:6a4db94011d3 303 }
sahilmgandhi 18:6a4db94011d3 304 }
sahilmgandhi 18:6a4db94011d3 305
sahilmgandhi 18:6a4db94011d3 306 /**
sahilmgandhi 18:6a4db94011d3 307 * @brief De-initializes the GPIOx peripheral registers to their default reset values.
sahilmgandhi 18:6a4db94011d3 308 * @param GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32F429X device or
sahilmgandhi 18:6a4db94011d3 309 * x can be (A..I) to select the GPIO peripheral for STM32F40XX and STM32F427X devices.
sahilmgandhi 18:6a4db94011d3 310 * @param GPIO_Pin: specifies the port bit to be written.
sahilmgandhi 18:6a4db94011d3 311 * This parameter can be one of GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 312 * @retval None
sahilmgandhi 18:6a4db94011d3 313 */
sahilmgandhi 18:6a4db94011d3 314 void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 315 {
sahilmgandhi 18:6a4db94011d3 316 uint32_t position;
sahilmgandhi 18:6a4db94011d3 317 uint32_t ioposition = 0x00U;
sahilmgandhi 18:6a4db94011d3 318 uint32_t iocurrent = 0x00U;
sahilmgandhi 18:6a4db94011d3 319 uint32_t tmp = 0x00U;
sahilmgandhi 18:6a4db94011d3 320
sahilmgandhi 18:6a4db94011d3 321 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 322 assert_param(IS_GPIO_ALL_INSTANCE(GPIOx));
sahilmgandhi 18:6a4db94011d3 323
sahilmgandhi 18:6a4db94011d3 324 /* Configure the port pins */
sahilmgandhi 18:6a4db94011d3 325 for(position = 0U; position < GPIO_NUMBER; position++)
sahilmgandhi 18:6a4db94011d3 326 {
sahilmgandhi 18:6a4db94011d3 327 /* Get the IO position */
sahilmgandhi 18:6a4db94011d3 328 ioposition = ((uint32_t)0x01U) << position;
sahilmgandhi 18:6a4db94011d3 329 /* Get the current IO position */
sahilmgandhi 18:6a4db94011d3 330 iocurrent = (GPIO_Pin) & ioposition;
sahilmgandhi 18:6a4db94011d3 331
sahilmgandhi 18:6a4db94011d3 332 if(iocurrent == ioposition)
sahilmgandhi 18:6a4db94011d3 333 {
sahilmgandhi 18:6a4db94011d3 334 /*------------------------- GPIO Mode Configuration --------------------*/
sahilmgandhi 18:6a4db94011d3 335 /* Configure IO Direction in Input Floating Mode */
sahilmgandhi 18:6a4db94011d3 336 GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 337
sahilmgandhi 18:6a4db94011d3 338 /* Configure the default Alternate Function in current IO */
sahilmgandhi 18:6a4db94011d3 339 GPIOx->AFR[position >> 3U] &= ~((uint32_t)0xFU << ((uint32_t)(position & (uint32_t)0x07U) * 4U)) ;
sahilmgandhi 18:6a4db94011d3 340
sahilmgandhi 18:6a4db94011d3 341 /* Configure the default value for IO Speed */
sahilmgandhi 18:6a4db94011d3 342 GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 343
sahilmgandhi 18:6a4db94011d3 344 /* Configure the default value IO Output Type */
sahilmgandhi 18:6a4db94011d3 345 GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ;
sahilmgandhi 18:6a4db94011d3 346
sahilmgandhi 18:6a4db94011d3 347 /* Deactivate the Pull-up and Pull-down resistor for the current IO */
sahilmgandhi 18:6a4db94011d3 348 GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 349
sahilmgandhi 18:6a4db94011d3 350 /*------------------------- EXTI Mode Configuration --------------------*/
sahilmgandhi 18:6a4db94011d3 351 tmp = SYSCFG->EXTICR[position >> 2U];
sahilmgandhi 18:6a4db94011d3 352 tmp &= (((uint32_t)0x0FU) << (4U * (position & 0x03U)));
sahilmgandhi 18:6a4db94011d3 353 if(tmp == ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U))))
sahilmgandhi 18:6a4db94011d3 354 {
sahilmgandhi 18:6a4db94011d3 355 /* Configure the External Interrupt or event for the current IO */
sahilmgandhi 18:6a4db94011d3 356 tmp = ((uint32_t)0x0FU) << (4U * (position & 0x03U));
sahilmgandhi 18:6a4db94011d3 357 SYSCFG->EXTICR[position >> 2U] &= ~tmp;
sahilmgandhi 18:6a4db94011d3 358
sahilmgandhi 18:6a4db94011d3 359 /* Clear EXTI line configuration */
sahilmgandhi 18:6a4db94011d3 360 EXTI->IMR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 361 EXTI->EMR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 362
sahilmgandhi 18:6a4db94011d3 363 /* Clear Rising Falling edge configuration */
sahilmgandhi 18:6a4db94011d3 364 EXTI->RTSR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 365 EXTI->FTSR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 366 }
sahilmgandhi 18:6a4db94011d3 367 }
sahilmgandhi 18:6a4db94011d3 368 }
sahilmgandhi 18:6a4db94011d3 369 }
sahilmgandhi 18:6a4db94011d3 370
sahilmgandhi 18:6a4db94011d3 371 /**
sahilmgandhi 18:6a4db94011d3 372 * @}
sahilmgandhi 18:6a4db94011d3 373 */
sahilmgandhi 18:6a4db94011d3 374
sahilmgandhi 18:6a4db94011d3 375 /** @defgroup GPIO_Exported_Functions_Group2 IO operation functions
sahilmgandhi 18:6a4db94011d3 376 * @brief GPIO Read and Write
sahilmgandhi 18:6a4db94011d3 377 *
sahilmgandhi 18:6a4db94011d3 378 @verbatim
sahilmgandhi 18:6a4db94011d3 379 ===============================================================================
sahilmgandhi 18:6a4db94011d3 380 ##### IO operation functions #####
sahilmgandhi 18:6a4db94011d3 381 ===============================================================================
sahilmgandhi 18:6a4db94011d3 382
sahilmgandhi 18:6a4db94011d3 383 @endverbatim
sahilmgandhi 18:6a4db94011d3 384 * @{
sahilmgandhi 18:6a4db94011d3 385 */
sahilmgandhi 18:6a4db94011d3 386
sahilmgandhi 18:6a4db94011d3 387 /**
sahilmgandhi 18:6a4db94011d3 388 * @brief Reads the specified input port pin.
sahilmgandhi 18:6a4db94011d3 389 * @param GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32F429X device or
sahilmgandhi 18:6a4db94011d3 390 * x can be (A..I) to select the GPIO peripheral for STM32F40XX and STM32F427X devices.
sahilmgandhi 18:6a4db94011d3 391 * @param GPIO_Pin: specifies the port bit to read.
sahilmgandhi 18:6a4db94011d3 392 * This parameter can be GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 393 * @retval The input port pin value.
sahilmgandhi 18:6a4db94011d3 394 */
sahilmgandhi 18:6a4db94011d3 395 GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 396 {
sahilmgandhi 18:6a4db94011d3 397 GPIO_PinState bitstatus;
sahilmgandhi 18:6a4db94011d3 398
sahilmgandhi 18:6a4db94011d3 399 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 400 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 401
sahilmgandhi 18:6a4db94011d3 402 if((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET)
sahilmgandhi 18:6a4db94011d3 403 {
sahilmgandhi 18:6a4db94011d3 404 bitstatus = GPIO_PIN_SET;
sahilmgandhi 18:6a4db94011d3 405 }
sahilmgandhi 18:6a4db94011d3 406 else
sahilmgandhi 18:6a4db94011d3 407 {
sahilmgandhi 18:6a4db94011d3 408 bitstatus = GPIO_PIN_RESET;
sahilmgandhi 18:6a4db94011d3 409 }
sahilmgandhi 18:6a4db94011d3 410 return bitstatus;
sahilmgandhi 18:6a4db94011d3 411 }
sahilmgandhi 18:6a4db94011d3 412
sahilmgandhi 18:6a4db94011d3 413 /**
sahilmgandhi 18:6a4db94011d3 414 * @brief Sets or clears the selected data port bit.
sahilmgandhi 18:6a4db94011d3 415 *
sahilmgandhi 18:6a4db94011d3 416 * @note This function uses GPIOx_BSRR register to allow atomic read/modify
sahilmgandhi 18:6a4db94011d3 417 * accesses. In this way, there is no risk of an IRQ occurring between
sahilmgandhi 18:6a4db94011d3 418 * the read and the modify access.
sahilmgandhi 18:6a4db94011d3 419 *
sahilmgandhi 18:6a4db94011d3 420 * @param GPIOx: where x can be (A..K) to select the GPIO peripheral for STM32F429X device or
sahilmgandhi 18:6a4db94011d3 421 * x can be (A..I) to select the GPIO peripheral for STM32F40XX and STM32F427X devices.
sahilmgandhi 18:6a4db94011d3 422 * @param GPIO_Pin: specifies the port bit to be written.
sahilmgandhi 18:6a4db94011d3 423 * This parameter can be one of GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 424 * @param PinState: specifies the value to be written to the selected bit.
sahilmgandhi 18:6a4db94011d3 425 * This parameter can be one of the GPIO_PinState enum values:
sahilmgandhi 18:6a4db94011d3 426 * @arg GPIO_PIN_RESET: to clear the port pin
sahilmgandhi 18:6a4db94011d3 427 * @arg GPIO_PIN_SET: to set the port pin
sahilmgandhi 18:6a4db94011d3 428 * @retval None
sahilmgandhi 18:6a4db94011d3 429 */
sahilmgandhi 18:6a4db94011d3 430 void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
sahilmgandhi 18:6a4db94011d3 431 {
sahilmgandhi 18:6a4db94011d3 432 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 433 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 434 assert_param(IS_GPIO_PIN_ACTION(PinState));
sahilmgandhi 18:6a4db94011d3 435
sahilmgandhi 18:6a4db94011d3 436 if(PinState != GPIO_PIN_RESET)
sahilmgandhi 18:6a4db94011d3 437 {
sahilmgandhi 18:6a4db94011d3 438 GPIOx->BSRR = GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 439 }
sahilmgandhi 18:6a4db94011d3 440 else
sahilmgandhi 18:6a4db94011d3 441 {
sahilmgandhi 18:6a4db94011d3 442 GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U;
sahilmgandhi 18:6a4db94011d3 443 }
sahilmgandhi 18:6a4db94011d3 444 }
sahilmgandhi 18:6a4db94011d3 445
sahilmgandhi 18:6a4db94011d3 446 /**
sahilmgandhi 18:6a4db94011d3 447 * @brief Toggles the specified GPIO pins.
sahilmgandhi 18:6a4db94011d3 448 * @param GPIOx: Where x can be (A..K) to select the GPIO peripheral for STM32F429X device or
sahilmgandhi 18:6a4db94011d3 449 * x can be (A..I) to select the GPIO peripheral for STM32F40XX and STM32F427X devices.
sahilmgandhi 18:6a4db94011d3 450 * @param GPIO_Pin: Specifies the pins to be toggled.
sahilmgandhi 18:6a4db94011d3 451 * @retval None
sahilmgandhi 18:6a4db94011d3 452 */
sahilmgandhi 18:6a4db94011d3 453 void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 454 {
sahilmgandhi 18:6a4db94011d3 455 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 456 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 457
sahilmgandhi 18:6a4db94011d3 458 GPIOx->ODR ^= GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 459 }
sahilmgandhi 18:6a4db94011d3 460
sahilmgandhi 18:6a4db94011d3 461 /**
sahilmgandhi 18:6a4db94011d3 462 * @brief Locks GPIO Pins configuration registers.
sahilmgandhi 18:6a4db94011d3 463 * @note The locked registers are GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR,
sahilmgandhi 18:6a4db94011d3 464 * GPIOx_PUPDR, GPIOx_AFRL and GPIOx_AFRH.
sahilmgandhi 18:6a4db94011d3 465 * @note The configuration of the locked GPIO pins can no longer be modified
sahilmgandhi 18:6a4db94011d3 466 * until the next reset.
sahilmgandhi 18:6a4db94011d3 467 * @param GPIOx: where x can be (A..F) to select the GPIO peripheral for STM32F4 family
sahilmgandhi 18:6a4db94011d3 468 * @param GPIO_Pin: specifies the port bit to be locked.
sahilmgandhi 18:6a4db94011d3 469 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 470 * @retval None
sahilmgandhi 18:6a4db94011d3 471 */
sahilmgandhi 18:6a4db94011d3 472 HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 473 {
sahilmgandhi 18:6a4db94011d3 474 __IO uint32_t tmp = GPIO_LCKR_LCKK;
sahilmgandhi 18:6a4db94011d3 475
sahilmgandhi 18:6a4db94011d3 476 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 477 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 478
sahilmgandhi 18:6a4db94011d3 479 /* Apply lock key write sequence */
sahilmgandhi 18:6a4db94011d3 480 tmp |= GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 481 /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */
sahilmgandhi 18:6a4db94011d3 482 GPIOx->LCKR = tmp;
sahilmgandhi 18:6a4db94011d3 483 /* Reset LCKx bit(s): LCKK='0' + LCK[15-0] */
sahilmgandhi 18:6a4db94011d3 484 GPIOx->LCKR = GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 485 /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */
sahilmgandhi 18:6a4db94011d3 486 GPIOx->LCKR = tmp;
sahilmgandhi 18:6a4db94011d3 487 /* Read LCKK bit*/
sahilmgandhi 18:6a4db94011d3 488 tmp = GPIOx->LCKR;
sahilmgandhi 18:6a4db94011d3 489
sahilmgandhi 18:6a4db94011d3 490 if((GPIOx->LCKR & GPIO_LCKR_LCKK) != RESET)
sahilmgandhi 18:6a4db94011d3 491 {
sahilmgandhi 18:6a4db94011d3 492 return HAL_OK;
sahilmgandhi 18:6a4db94011d3 493 }
sahilmgandhi 18:6a4db94011d3 494 else
sahilmgandhi 18:6a4db94011d3 495 {
sahilmgandhi 18:6a4db94011d3 496 return HAL_ERROR;
sahilmgandhi 18:6a4db94011d3 497 }
sahilmgandhi 18:6a4db94011d3 498 }
sahilmgandhi 18:6a4db94011d3 499
sahilmgandhi 18:6a4db94011d3 500 /**
sahilmgandhi 18:6a4db94011d3 501 * @brief This function handles EXTI interrupt request.
sahilmgandhi 18:6a4db94011d3 502 * @param GPIO_Pin: Specifies the pins connected EXTI line
sahilmgandhi 18:6a4db94011d3 503 * @retval None
sahilmgandhi 18:6a4db94011d3 504 */
sahilmgandhi 18:6a4db94011d3 505 void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 506 {
sahilmgandhi 18:6a4db94011d3 507 /* EXTI line interrupt detected */
sahilmgandhi 18:6a4db94011d3 508 if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET)
sahilmgandhi 18:6a4db94011d3 509 {
sahilmgandhi 18:6a4db94011d3 510 __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
sahilmgandhi 18:6a4db94011d3 511 HAL_GPIO_EXTI_Callback(GPIO_Pin);
sahilmgandhi 18:6a4db94011d3 512 }
sahilmgandhi 18:6a4db94011d3 513 }
sahilmgandhi 18:6a4db94011d3 514
sahilmgandhi 18:6a4db94011d3 515 /**
sahilmgandhi 18:6a4db94011d3 516 * @brief EXTI line detection callbacks.
sahilmgandhi 18:6a4db94011d3 517 * @param GPIO_Pin: Specifies the pins connected EXTI line
sahilmgandhi 18:6a4db94011d3 518 * @retval None
sahilmgandhi 18:6a4db94011d3 519 */
sahilmgandhi 18:6a4db94011d3 520 __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 521 {
sahilmgandhi 18:6a4db94011d3 522 /* Prevent unused argument(s) compilation warning */
sahilmgandhi 18:6a4db94011d3 523 UNUSED(GPIO_Pin);
sahilmgandhi 18:6a4db94011d3 524 /* NOTE: This function Should not be modified, when the callback is needed,
sahilmgandhi 18:6a4db94011d3 525 the HAL_GPIO_EXTI_Callback could be implemented in the user file
sahilmgandhi 18:6a4db94011d3 526 */
sahilmgandhi 18:6a4db94011d3 527 }
sahilmgandhi 18:6a4db94011d3 528
sahilmgandhi 18:6a4db94011d3 529 /**
sahilmgandhi 18:6a4db94011d3 530 * @}
sahilmgandhi 18:6a4db94011d3 531 */
sahilmgandhi 18:6a4db94011d3 532
sahilmgandhi 18:6a4db94011d3 533
sahilmgandhi 18:6a4db94011d3 534 /**
sahilmgandhi 18:6a4db94011d3 535 * @}
sahilmgandhi 18:6a4db94011d3 536 */
sahilmgandhi 18:6a4db94011d3 537
sahilmgandhi 18:6a4db94011d3 538 #endif /* HAL_GPIO_MODULE_ENABLED */
sahilmgandhi 18:6a4db94011d3 539 /**
sahilmgandhi 18:6a4db94011d3 540 * @}
sahilmgandhi 18:6a4db94011d3 541 */
sahilmgandhi 18:6a4db94011d3 542
sahilmgandhi 18:6a4db94011d3 543 /**
sahilmgandhi 18:6a4db94011d3 544 * @}
sahilmgandhi 18:6a4db94011d3 545 */
sahilmgandhi 18:6a4db94011d3 546
sahilmgandhi 18:6a4db94011d3 547 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/