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.c
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 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 "stm32f2xx_hal.h"
sahilmgandhi 18:6a4db94011d3 127
sahilmgandhi 18:6a4db94011d3 128 /** @addtogroup STM32F2xx_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..I) to select the GPIO peripheral.
sahilmgandhi 18:6a4db94011d3 184 * @param GPIO_Init: pointer to a GPIO_InitTypeDef structure that contains
sahilmgandhi 18:6a4db94011d3 185 * the configuration information for the specified GPIO peripheral.
sahilmgandhi 18:6a4db94011d3 186 * @retval None
sahilmgandhi 18:6a4db94011d3 187 */
sahilmgandhi 18:6a4db94011d3 188 void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
sahilmgandhi 18:6a4db94011d3 189 {
sahilmgandhi 18:6a4db94011d3 190 uint32_t position;
sahilmgandhi 18:6a4db94011d3 191 uint32_t ioposition = 0x00U;
sahilmgandhi 18:6a4db94011d3 192 uint32_t iocurrent = 0x00U;
sahilmgandhi 18:6a4db94011d3 193 uint32_t temp = 0x00U;
sahilmgandhi 18:6a4db94011d3 194
sahilmgandhi 18:6a4db94011d3 195 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 196 assert_param(IS_GPIO_ALL_INSTANCE(GPIOx));
sahilmgandhi 18:6a4db94011d3 197 assert_param(IS_GPIO_PIN(GPIO_Init->Pin));
sahilmgandhi 18:6a4db94011d3 198 assert_param(IS_GPIO_MODE(GPIO_Init->Mode));
sahilmgandhi 18:6a4db94011d3 199 assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
sahilmgandhi 18:6a4db94011d3 200
sahilmgandhi 18:6a4db94011d3 201 /* Configure the port pins */
sahilmgandhi 18:6a4db94011d3 202 for(position = 0U; position < GPIO_NUMBER; position++)
sahilmgandhi 18:6a4db94011d3 203 {
sahilmgandhi 18:6a4db94011d3 204 /* Get the IO position */
sahilmgandhi 18:6a4db94011d3 205 ioposition = ((uint32_t)0x01U) << position;
sahilmgandhi 18:6a4db94011d3 206 /* Get the current IO position */
sahilmgandhi 18:6a4db94011d3 207 iocurrent = (uint32_t)(GPIO_Init->Pin) & ioposition;
sahilmgandhi 18:6a4db94011d3 208
sahilmgandhi 18:6a4db94011d3 209 if(iocurrent == ioposition)
sahilmgandhi 18:6a4db94011d3 210 {
sahilmgandhi 18:6a4db94011d3 211 /*--------------------- GPIO Mode Configuration ------------------------*/
sahilmgandhi 18:6a4db94011d3 212 /* In case of Alternate function mode selection */
sahilmgandhi 18:6a4db94011d3 213 if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
sahilmgandhi 18:6a4db94011d3 214 {
sahilmgandhi 18:6a4db94011d3 215 /* Check the Alternate function parameter */
sahilmgandhi 18:6a4db94011d3 216 assert_param(IS_GPIO_AF(GPIO_Init->Alternate));
sahilmgandhi 18:6a4db94011d3 217 /* Configure Alternate function mapped with the current IO */
sahilmgandhi 18:6a4db94011d3 218 temp = GPIOx->AFR[position >> 3U];
sahilmgandhi 18:6a4db94011d3 219 temp &= ~((uint32_t)0xFU << ((uint32_t)(position & (uint32_t)0x07U) * 4U)) ;
sahilmgandhi 18:6a4db94011d3 220 temp |= ((uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & (uint32_t)0x07U) * 4U));
sahilmgandhi 18:6a4db94011d3 221 GPIOx->AFR[position >> 3U] = temp;
sahilmgandhi 18:6a4db94011d3 222 }
sahilmgandhi 18:6a4db94011d3 223
sahilmgandhi 18:6a4db94011d3 224 /* Configure IO Direction mode (Input, Output, Alternate or Analog) */
sahilmgandhi 18:6a4db94011d3 225 temp = GPIOx->MODER;
sahilmgandhi 18:6a4db94011d3 226 temp &= ~(GPIO_MODER_MODER0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 227 temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U));
sahilmgandhi 18:6a4db94011d3 228 GPIOx->MODER = temp;
sahilmgandhi 18:6a4db94011d3 229
sahilmgandhi 18:6a4db94011d3 230 /* In case of Output or Alternate function mode selection */
sahilmgandhi 18:6a4db94011d3 231 if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
sahilmgandhi 18:6a4db94011d3 232 (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
sahilmgandhi 18:6a4db94011d3 233 {
sahilmgandhi 18:6a4db94011d3 234 /* Check the Speed parameter */
sahilmgandhi 18:6a4db94011d3 235 assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
sahilmgandhi 18:6a4db94011d3 236 /* Configure the IO Speed */
sahilmgandhi 18:6a4db94011d3 237 temp = GPIOx->OSPEEDR;
sahilmgandhi 18:6a4db94011d3 238 temp &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 239 temp |= (GPIO_Init->Speed << (position * 2U));
sahilmgandhi 18:6a4db94011d3 240 GPIOx->OSPEEDR = temp;
sahilmgandhi 18:6a4db94011d3 241
sahilmgandhi 18:6a4db94011d3 242 /* Configure the IO Output Type */
sahilmgandhi 18:6a4db94011d3 243 temp = GPIOx->OTYPER;
sahilmgandhi 18:6a4db94011d3 244 temp &= ~(GPIO_OTYPER_OT_0 << position) ;
sahilmgandhi 18:6a4db94011d3 245 temp |= (((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4U) << position);
sahilmgandhi 18:6a4db94011d3 246 GPIOx->OTYPER = temp;
sahilmgandhi 18:6a4db94011d3 247 }
sahilmgandhi 18:6a4db94011d3 248
sahilmgandhi 18:6a4db94011d3 249 /* Activate the Pull-up or Pull down resistor for the current IO */
sahilmgandhi 18:6a4db94011d3 250 temp = GPIOx->PUPDR;
sahilmgandhi 18:6a4db94011d3 251 temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 252 temp |= ((GPIO_Init->Pull) << (position * 2U));
sahilmgandhi 18:6a4db94011d3 253 GPIOx->PUPDR = temp;
sahilmgandhi 18:6a4db94011d3 254
sahilmgandhi 18:6a4db94011d3 255 /*--------------------- EXTI Mode Configuration ------------------------*/
sahilmgandhi 18:6a4db94011d3 256 /* Configure the External Interrupt or event for the current IO */
sahilmgandhi 18:6a4db94011d3 257 if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
sahilmgandhi 18:6a4db94011d3 258 {
sahilmgandhi 18:6a4db94011d3 259 /* Enable SYSCFG Clock */
sahilmgandhi 18:6a4db94011d3 260 __HAL_RCC_SYSCFG_CLK_ENABLE();
sahilmgandhi 18:6a4db94011d3 261
sahilmgandhi 18:6a4db94011d3 262 temp = SYSCFG->EXTICR[position >> 2U];
sahilmgandhi 18:6a4db94011d3 263 temp &= ~(((uint32_t)0x0FU) << (4U * (position & 0x03)));
sahilmgandhi 18:6a4db94011d3 264 temp |= ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U)));
sahilmgandhi 18:6a4db94011d3 265 SYSCFG->EXTICR[position >> 2U] = temp;
sahilmgandhi 18:6a4db94011d3 266
sahilmgandhi 18:6a4db94011d3 267 /* Clear EXTI line configuration */
sahilmgandhi 18:6a4db94011d3 268 temp = EXTI->IMR;
sahilmgandhi 18:6a4db94011d3 269 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 270 if((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
sahilmgandhi 18:6a4db94011d3 271 {
sahilmgandhi 18:6a4db94011d3 272 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 273 }
sahilmgandhi 18:6a4db94011d3 274 EXTI->IMR = temp;
sahilmgandhi 18:6a4db94011d3 275
sahilmgandhi 18:6a4db94011d3 276 temp = EXTI->EMR;
sahilmgandhi 18:6a4db94011d3 277 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 278 if((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
sahilmgandhi 18:6a4db94011d3 279 {
sahilmgandhi 18:6a4db94011d3 280 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 281 }
sahilmgandhi 18:6a4db94011d3 282 EXTI->EMR = temp;
sahilmgandhi 18:6a4db94011d3 283
sahilmgandhi 18:6a4db94011d3 284 /* Clear Rising Falling edge configuration */
sahilmgandhi 18:6a4db94011d3 285 temp = EXTI->RTSR;
sahilmgandhi 18:6a4db94011d3 286 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 287 if((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
sahilmgandhi 18:6a4db94011d3 288 {
sahilmgandhi 18:6a4db94011d3 289 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 290 }
sahilmgandhi 18:6a4db94011d3 291 EXTI->RTSR = temp;
sahilmgandhi 18:6a4db94011d3 292
sahilmgandhi 18:6a4db94011d3 293 temp = EXTI->FTSR;
sahilmgandhi 18:6a4db94011d3 294 temp &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 295 if((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
sahilmgandhi 18:6a4db94011d3 296 {
sahilmgandhi 18:6a4db94011d3 297 temp |= iocurrent;
sahilmgandhi 18:6a4db94011d3 298 }
sahilmgandhi 18:6a4db94011d3 299 EXTI->FTSR = temp;
sahilmgandhi 18:6a4db94011d3 300 }
sahilmgandhi 18:6a4db94011d3 301 }
sahilmgandhi 18:6a4db94011d3 302 }
sahilmgandhi 18:6a4db94011d3 303 }
sahilmgandhi 18:6a4db94011d3 304
sahilmgandhi 18:6a4db94011d3 305 /**
sahilmgandhi 18:6a4db94011d3 306 * @brief De-initializes the GPIOx peripheral registers to their default reset values.
sahilmgandhi 18:6a4db94011d3 307 * @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
sahilmgandhi 18:6a4db94011d3 308 * @param GPIO_Pin: specifies the port bit to be written.
sahilmgandhi 18:6a4db94011d3 309 * This parameter can be one of GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 310 * @retval None
sahilmgandhi 18:6a4db94011d3 311 */
sahilmgandhi 18:6a4db94011d3 312 void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 313 {
sahilmgandhi 18:6a4db94011d3 314 uint32_t position;
sahilmgandhi 18:6a4db94011d3 315 uint32_t ioposition = 0x00U;
sahilmgandhi 18:6a4db94011d3 316 uint32_t iocurrent = 0x00U;
sahilmgandhi 18:6a4db94011d3 317 uint32_t tmp = 0x00U;
sahilmgandhi 18:6a4db94011d3 318
sahilmgandhi 18:6a4db94011d3 319 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 320 assert_param(IS_GPIO_ALL_INSTANCE(GPIOx));
sahilmgandhi 18:6a4db94011d3 321
sahilmgandhi 18:6a4db94011d3 322 /* Configure the port pins */
sahilmgandhi 18:6a4db94011d3 323 for(position = 0U; position < GPIO_NUMBER; position++)
sahilmgandhi 18:6a4db94011d3 324 {
sahilmgandhi 18:6a4db94011d3 325 /* Get the IO position */
sahilmgandhi 18:6a4db94011d3 326 ioposition = ((uint32_t)0x01U) << position;
sahilmgandhi 18:6a4db94011d3 327 /* Get the current IO position */
sahilmgandhi 18:6a4db94011d3 328 iocurrent = (GPIO_Pin) & ioposition;
sahilmgandhi 18:6a4db94011d3 329
sahilmgandhi 18:6a4db94011d3 330 if(iocurrent == ioposition)
sahilmgandhi 18:6a4db94011d3 331 {
sahilmgandhi 18:6a4db94011d3 332 /*------------------------- GPIO Mode Configuration --------------------*/
sahilmgandhi 18:6a4db94011d3 333 /* Configure IO Direction in Input Floating Mode */
sahilmgandhi 18:6a4db94011d3 334 GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 335
sahilmgandhi 18:6a4db94011d3 336 /* Configure the default Alternate Function in current IO */
sahilmgandhi 18:6a4db94011d3 337 GPIOx->AFR[position >> 3U] &= ~((uint32_t)0xFU << ((uint32_t)(position & (uint32_t)0x07U) * 4U)) ;
sahilmgandhi 18:6a4db94011d3 338
sahilmgandhi 18:6a4db94011d3 339 /* Configure the default value for IO Speed */
sahilmgandhi 18:6a4db94011d3 340 GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 341
sahilmgandhi 18:6a4db94011d3 342 /* Configure the default value IO Output Type */
sahilmgandhi 18:6a4db94011d3 343 GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ;
sahilmgandhi 18:6a4db94011d3 344
sahilmgandhi 18:6a4db94011d3 345 /* Deactivate the Pull-up and Pull-down resistor for the current IO */
sahilmgandhi 18:6a4db94011d3 346 GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U));
sahilmgandhi 18:6a4db94011d3 347
sahilmgandhi 18:6a4db94011d3 348 /*------------------------- EXTI Mode Configuration --------------------*/
sahilmgandhi 18:6a4db94011d3 349 tmp = SYSCFG->EXTICR[position >> 2U];
sahilmgandhi 18:6a4db94011d3 350 tmp &= (((uint32_t)0x0FU) << (4U * (position & 0x03U)));
sahilmgandhi 18:6a4db94011d3 351 if(tmp == ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U))))
sahilmgandhi 18:6a4db94011d3 352 {
sahilmgandhi 18:6a4db94011d3 353 /* Configure the External Interrupt or event for the current IO */
sahilmgandhi 18:6a4db94011d3 354 tmp = ((uint32_t)0x0FU) << (4U * (position & 0x03U));
sahilmgandhi 18:6a4db94011d3 355 SYSCFG->EXTICR[position >> 2U] &= ~tmp;
sahilmgandhi 18:6a4db94011d3 356
sahilmgandhi 18:6a4db94011d3 357 /* Clear EXTI line configuration */
sahilmgandhi 18:6a4db94011d3 358 EXTI->IMR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 359 EXTI->EMR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 360
sahilmgandhi 18:6a4db94011d3 361 /* Clear Rising Falling edge configuration */
sahilmgandhi 18:6a4db94011d3 362 EXTI->RTSR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 363 EXTI->FTSR &= ~((uint32_t)iocurrent);
sahilmgandhi 18:6a4db94011d3 364 }
sahilmgandhi 18:6a4db94011d3 365 }
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 /** @defgroup GPIO_Exported_Functions_Group2 IO operation functions
sahilmgandhi 18:6a4db94011d3 374 * @brief GPIO Read and Write
sahilmgandhi 18:6a4db94011d3 375 *
sahilmgandhi 18:6a4db94011d3 376 @verbatim
sahilmgandhi 18:6a4db94011d3 377 ===============================================================================
sahilmgandhi 18:6a4db94011d3 378 ##### IO operation functions #####
sahilmgandhi 18:6a4db94011d3 379 ===============================================================================
sahilmgandhi 18:6a4db94011d3 380
sahilmgandhi 18:6a4db94011d3 381 @endverbatim
sahilmgandhi 18:6a4db94011d3 382 * @{
sahilmgandhi 18:6a4db94011d3 383 */
sahilmgandhi 18:6a4db94011d3 384
sahilmgandhi 18:6a4db94011d3 385 /**
sahilmgandhi 18:6a4db94011d3 386 * @brief Reads the specified input port pin.
sahilmgandhi 18:6a4db94011d3 387 * @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
sahilmgandhi 18:6a4db94011d3 388 * @param GPIO_Pin: specifies the port bit to read.
sahilmgandhi 18:6a4db94011d3 389 * This parameter can be GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 390 * @retval The input port pin value.
sahilmgandhi 18:6a4db94011d3 391 */
sahilmgandhi 18:6a4db94011d3 392 GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 393 {
sahilmgandhi 18:6a4db94011d3 394 GPIO_PinState bitstatus;
sahilmgandhi 18:6a4db94011d3 395
sahilmgandhi 18:6a4db94011d3 396 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 397 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 398
sahilmgandhi 18:6a4db94011d3 399 if((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET)
sahilmgandhi 18:6a4db94011d3 400 {
sahilmgandhi 18:6a4db94011d3 401 bitstatus = GPIO_PIN_SET;
sahilmgandhi 18:6a4db94011d3 402 }
sahilmgandhi 18:6a4db94011d3 403 else
sahilmgandhi 18:6a4db94011d3 404 {
sahilmgandhi 18:6a4db94011d3 405 bitstatus = GPIO_PIN_RESET;
sahilmgandhi 18:6a4db94011d3 406 }
sahilmgandhi 18:6a4db94011d3 407 return bitstatus;
sahilmgandhi 18:6a4db94011d3 408 }
sahilmgandhi 18:6a4db94011d3 409
sahilmgandhi 18:6a4db94011d3 410 /**
sahilmgandhi 18:6a4db94011d3 411 * @brief Sets or clears the selected data port bit.
sahilmgandhi 18:6a4db94011d3 412 *
sahilmgandhi 18:6a4db94011d3 413 * @note This function uses GPIOx_BSRR register to allow atomic read/modify
sahilmgandhi 18:6a4db94011d3 414 * accesses. In this way, there is no risk of an IRQ occurring between
sahilmgandhi 18:6a4db94011d3 415 * the read and the modify access.
sahilmgandhi 18:6a4db94011d3 416 *
sahilmgandhi 18:6a4db94011d3 417 * @param GPIOx: where x can be (A..I) to select the GPIO peripheral for all STM32F2XX devices
sahilmgandhi 18:6a4db94011d3 418 * @param GPIO_Pin: specifies the port bit to be written.
sahilmgandhi 18:6a4db94011d3 419 * This parameter can be one of GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 420 * @param PinState: specifies the value to be written to the selected bit.
sahilmgandhi 18:6a4db94011d3 421 * This parameter can be one of the GPIO_PinState enum values:
sahilmgandhi 18:6a4db94011d3 422 * @arg GPIO_PIN_RESET: to clear the port pin
sahilmgandhi 18:6a4db94011d3 423 * @arg GPIO_PIN_SET: to set the port pin
sahilmgandhi 18:6a4db94011d3 424 * @retval None
sahilmgandhi 18:6a4db94011d3 425 */
sahilmgandhi 18:6a4db94011d3 426 void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
sahilmgandhi 18:6a4db94011d3 427 {
sahilmgandhi 18:6a4db94011d3 428 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 429 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 430 assert_param(IS_GPIO_PIN_ACTION(PinState));
sahilmgandhi 18:6a4db94011d3 431
sahilmgandhi 18:6a4db94011d3 432 if(PinState != GPIO_PIN_RESET)
sahilmgandhi 18:6a4db94011d3 433 {
sahilmgandhi 18:6a4db94011d3 434 GPIOx->BSRR = GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 435 }
sahilmgandhi 18:6a4db94011d3 436 else
sahilmgandhi 18:6a4db94011d3 437 {
sahilmgandhi 18:6a4db94011d3 438 GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U;
sahilmgandhi 18:6a4db94011d3 439 }
sahilmgandhi 18:6a4db94011d3 440 }
sahilmgandhi 18:6a4db94011d3 441
sahilmgandhi 18:6a4db94011d3 442 /**
sahilmgandhi 18:6a4db94011d3 443 * @brief Toggles the specified GPIO pins.
sahilmgandhi 18:6a4db94011d3 444 * @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
sahilmgandhi 18:6a4db94011d3 445 * @param GPIO_Pin: Specifies the pins to be toggled.
sahilmgandhi 18:6a4db94011d3 446 * @retval None
sahilmgandhi 18:6a4db94011d3 447 */
sahilmgandhi 18:6a4db94011d3 448 void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 449 {
sahilmgandhi 18:6a4db94011d3 450 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 451 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 452
sahilmgandhi 18:6a4db94011d3 453 GPIOx->ODR ^= GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 454 }
sahilmgandhi 18:6a4db94011d3 455
sahilmgandhi 18:6a4db94011d3 456 /**
sahilmgandhi 18:6a4db94011d3 457 * @brief Locks GPIO Pins configuration registers.
sahilmgandhi 18:6a4db94011d3 458 * @note The locked registers are GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR,
sahilmgandhi 18:6a4db94011d3 459 * GPIOx_PUPDR, GPIOx_AFRL and GPIOx_AFRH.
sahilmgandhi 18:6a4db94011d3 460 * @note The configuration of the locked GPIO pins can no longer be modified
sahilmgandhi 18:6a4db94011d3 461 * until the next reset.
sahilmgandhi 18:6a4db94011d3 462 * @param GPIOx: where x can be (A..I) to select the GPIO peripheral for STM32F2XX family
sahilmgandhi 18:6a4db94011d3 463 * @param GPIO_Pin: specifies the port bit to be locked.
sahilmgandhi 18:6a4db94011d3 464 * This parameter can be any combination of GPIO_PIN_x where x can be (0..15).
sahilmgandhi 18:6a4db94011d3 465 * @retval None
sahilmgandhi 18:6a4db94011d3 466 */
sahilmgandhi 18:6a4db94011d3 467 HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 468 {
sahilmgandhi 18:6a4db94011d3 469 __IO uint32_t tmp = GPIO_LCKR_LCKK;
sahilmgandhi 18:6a4db94011d3 470
sahilmgandhi 18:6a4db94011d3 471 /* Check the parameters */
sahilmgandhi 18:6a4db94011d3 472 assert_param(IS_GPIO_PIN(GPIO_Pin));
sahilmgandhi 18:6a4db94011d3 473
sahilmgandhi 18:6a4db94011d3 474 /* Apply lock key write sequence */
sahilmgandhi 18:6a4db94011d3 475 tmp |= GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 476 /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */
sahilmgandhi 18:6a4db94011d3 477 GPIOx->LCKR = tmp;
sahilmgandhi 18:6a4db94011d3 478 /* Reset LCKx bit(s): LCKK='0' + LCK[15-0] */
sahilmgandhi 18:6a4db94011d3 479 GPIOx->LCKR = GPIO_Pin;
sahilmgandhi 18:6a4db94011d3 480 /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */
sahilmgandhi 18:6a4db94011d3 481 GPIOx->LCKR = tmp;
sahilmgandhi 18:6a4db94011d3 482 /* Read LCKK bit*/
sahilmgandhi 18:6a4db94011d3 483 tmp = GPIOx->LCKR;
sahilmgandhi 18:6a4db94011d3 484
sahilmgandhi 18:6a4db94011d3 485 if((GPIOx->LCKR & GPIO_LCKR_LCKK) != RESET)
sahilmgandhi 18:6a4db94011d3 486 {
sahilmgandhi 18:6a4db94011d3 487 return HAL_OK;
sahilmgandhi 18:6a4db94011d3 488 }
sahilmgandhi 18:6a4db94011d3 489 else
sahilmgandhi 18:6a4db94011d3 490 {
sahilmgandhi 18:6a4db94011d3 491 return HAL_ERROR;
sahilmgandhi 18:6a4db94011d3 492 }
sahilmgandhi 18:6a4db94011d3 493 }
sahilmgandhi 18:6a4db94011d3 494
sahilmgandhi 18:6a4db94011d3 495 /**
sahilmgandhi 18:6a4db94011d3 496 * @brief This function handles EXTI interrupt request.
sahilmgandhi 18:6a4db94011d3 497 * @param GPIO_Pin: Specifies the pins connected EXTI line
sahilmgandhi 18:6a4db94011d3 498 * @retval None
sahilmgandhi 18:6a4db94011d3 499 */
sahilmgandhi 18:6a4db94011d3 500 void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 501 {
sahilmgandhi 18:6a4db94011d3 502 /* EXTI line interrupt detected */
sahilmgandhi 18:6a4db94011d3 503 if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET)
sahilmgandhi 18:6a4db94011d3 504 {
sahilmgandhi 18:6a4db94011d3 505 __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
sahilmgandhi 18:6a4db94011d3 506 HAL_GPIO_EXTI_Callback(GPIO_Pin);
sahilmgandhi 18:6a4db94011d3 507 }
sahilmgandhi 18:6a4db94011d3 508 }
sahilmgandhi 18:6a4db94011d3 509
sahilmgandhi 18:6a4db94011d3 510 /**
sahilmgandhi 18:6a4db94011d3 511 * @brief EXTI line detection callbacks.
sahilmgandhi 18:6a4db94011d3 512 * @param GPIO_Pin: Specifies the pins connected EXTI line
sahilmgandhi 18:6a4db94011d3 513 * @retval None
sahilmgandhi 18:6a4db94011d3 514 */
sahilmgandhi 18:6a4db94011d3 515 __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
sahilmgandhi 18:6a4db94011d3 516 {
sahilmgandhi 18:6a4db94011d3 517 /* Prevent unused argument(s) compilation warning */
sahilmgandhi 18:6a4db94011d3 518 UNUSED(GPIO_Pin);
sahilmgandhi 18:6a4db94011d3 519 /* NOTE: This function Should not be modified, when the callback is needed,
sahilmgandhi 18:6a4db94011d3 520 the HAL_GPIO_EXTI_Callback could be implemented in the user file
sahilmgandhi 18:6a4db94011d3 521 */
sahilmgandhi 18:6a4db94011d3 522 }
sahilmgandhi 18:6a4db94011d3 523
sahilmgandhi 18:6a4db94011d3 524 /**
sahilmgandhi 18:6a4db94011d3 525 * @}
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 #endif /* HAL_GPIO_MODULE_ENABLED */
sahilmgandhi 18:6a4db94011d3 533 /**
sahilmgandhi 18:6a4db94011d3 534 * @}
sahilmgandhi 18:6a4db94011d3 535 */
sahilmgandhi 18:6a4db94011d3 536
sahilmgandhi 18:6a4db94011d3 537 /**
sahilmgandhi 18:6a4db94011d3 538 * @}
sahilmgandhi 18:6a4db94011d3 539 */
sahilmgandhi 18:6a4db94011d3 540
sahilmgandhi 18:6a4db94011d3 541 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/