1515 * opensource.org/licenses/BSD-3-Clause
1616 *
1717 ******************************************************************************
18- */
18+ */
1919
2020/* Define to prevent recursive inclusion -------------------------------------*/
2121#ifndef __STM32L0xx_HAL_GPIO_H
2222#define __STM32L0xx_HAL_GPIO_H
2323
2424#ifdef __cplusplus
25- extern "C" {
25+ extern "C" {
2626#endif
2727
2828/* Includes ------------------------------------------------------------------*/
3434
3535/** @defgroup GPIO GPIO
3636 * @{
37- */
37+ */
3838/******************************************************************************/
3939/* Exported types ------------------------------------------------------------*/
4040/******************************************************************************/
4646/** @defgroup GPIO_Init_Configuration GPIO init configuration structure
4747 * @{
4848 */
49- /**
50- * @brief GPIO Init structure definition
51- */
49+ /**
50+ * @brief GPIO Init structure definition
51+ */
5252typedef struct
5353{
5454 uint32_t Pin ; /*!< Specifies the GPIO pins to be configured.
@@ -63,24 +63,24 @@ typedef struct
6363 uint32_t Speed ; /*!< Specifies the speed for the selected pins.
6464 This parameter can be a value of @ref GPIO_speed_define */
6565
66- uint32_t Alternate ; /*!< Peripheral to be connected to the selected pins
66+ uint32_t Alternate ; /*!< Peripheral to be connected to the selected pins
6767 This parameter can be a value of @ref GPIOEx_Alternate_function_selection */
68- }GPIO_InitTypeDef ;
68+ } GPIO_InitTypeDef ;
6969/**
7070 * @}
7171 */
7272
7373/** @defgroup GPIO_SetReset_Definition GPIO set reset definition
7474 * @{
7575 */
76- /**
77- * @brief GPIO Bit SET and Bit RESET enumeration
76+ /**
77+ * @brief GPIO Bit SET and Bit RESET enumeration
7878 */
7979typedef enum
8080{
8181 GPIO_PIN_RESET = 0U ,
8282 GPIO_PIN_SET
83- }GPIO_PinState ;
83+ } GPIO_PinState ;
8484/**
8585 * @}
8686 */
@@ -124,31 +124,31 @@ typedef enum
124124 */
125125
126126#define GPIO_PIN_MASK ((uint32_t)0x0000FFFFU) /* PIN mask for assert test */
127- #define IS_GPIO_PIN (__PIN__ ) ((((__PIN__) & GPIO_PIN_MASK) != (uint32_t)0x00) &&\
128- (((__PIN__) & ~GPIO_PIN_MASK) == (uint32_t)0x00))
127+ #define IS_GPIO_PIN (__PIN__ ) ((((uint32_t)( __PIN__) & GPIO_PIN_MASK) != (uint32_t)0x00) &&\
128+ (((uint32_t)( __PIN__) & ~GPIO_PIN_MASK) == (uint32_t)0x00))
129129
130130/** @defgroup GPIO_mode_define Mode definition
131- * @brief GPIO Configuration Mode
131+ * @brief GPIO Configuration Mode
132132 * Elements values convention: 0xX0yz00YZ
133133 * - X : GPIO mode or EXTI Mode
134- * - y : External IT or Event trigger detection
134+ * - y : External IT or Event trigger detection
135135 * - z : IO configuration on External IT or Event
136136 * - Y : Output type (Push Pull or Open Drain)
137137 * - Z : IO Direction mode (Input, Output, Alternate or Analog)
138138 * @{
139- */
139+ */
140140#define GPIO_MODE_INPUT ((uint32_t)0x00000000U) /*!< Input Floating Mode */
141141#define GPIO_MODE_OUTPUT_PP ((uint32_t)0x00000001U) /*!< Output Push Pull Mode */
142142#define GPIO_MODE_OUTPUT_OD ((uint32_t)0x00000011U) /*!< Output Open Drain Mode */
143143#define GPIO_MODE_AF_PP ((uint32_t)0x00000002U) /*!< Alternate Function Push Pull Mode */
144144#define GPIO_MODE_AF_OD ((uint32_t)0x00000012U) /*!< Alternate Function Open Drain Mode */
145145
146146#define GPIO_MODE_ANALOG ((uint32_t)0x00000003U) /*!< Analog Mode */
147-
147+
148148#define GPIO_MODE_IT_RISING ((uint32_t)0x10110000U) /*!< External Interrupt Mode with Rising edge trigger detection */
149149#define GPIO_MODE_IT_FALLING ((uint32_t)0x10210000U) /*!< External Interrupt Mode with Falling edge trigger detection */
150150#define GPIO_MODE_IT_RISING_FALLING ((uint32_t)0x10310000U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
151-
151+
152152#define GPIO_MODE_EVT_RISING ((uint32_t)0x10120000U) /*!< External Event Mode with Rising edge trigger detection */
153153#define GPIO_MODE_EVT_FALLING ((uint32_t)0x10220000U) /*!< External Event Mode with Falling edge trigger detection */
154154#define GPIO_MODE_EVT_RISING_FALLING ((uint32_t)0x10320000U) /*!< External Event Mode with Rising/Falling edge trigger detection */
@@ -174,7 +174,7 @@ typedef enum
174174/** @defgroup GPIO_speed_define Speed definition
175175 * @brief GPIO Output Maximum frequency
176176 * @{
177- */
177+ */
178178#define GPIO_SPEED_FREQ_LOW ((uint32_t)0x00000000U) /*!< range up to 0.4 MHz, please refer to the product datasheet */
179179#define GPIO_SPEED_FREQ_MEDIUM ((uint32_t)0x00000001U) /*!< range 0.4 MHz to 2 MHz, please refer to the product datasheet */
180180#define GPIO_SPEED_FREQ_HIGH ((uint32_t)0x00000002U) /*!< range 2 MHz to 10 MHz, please refer to the product datasheet */
@@ -188,10 +188,10 @@ typedef enum
188188 ((__SPEED__) == GPIO_SPEED_FREQ_HIGH ) || ((__SPEED__) == GPIO_SPEED_FREQ_VERY_HIGH))
189189
190190
191- /** @defgroup GPIO_pull_define Pull definition
192- * @brief GPIO Pull-Up or Pull-Down Activation
193- * @{
194- */
191+ /** @defgroup GPIO_pull_define Pull definition
192+ * @brief GPIO Pull-Up or Pull-Down Activation
193+ * @{
194+ */
195195#define GPIO_NOPULL ((uint32_t)0x00000000U) /*!< No Pull-up or Pull-down activation */
196196#define GPIO_PULLUP ((uint32_t)0x00000001U) /*!< Pull-up activation */
197197#define GPIO_PULLDOWN ((uint32_t)0x00000002U) /*!< Pull-down activation */
@@ -203,7 +203,7 @@ typedef enum
203203#define IS_GPIO_PULL (__PULL__ ) (((__PULL__) == GPIO_NOPULL) || ((__PULL__) == GPIO_PULLUP) || \
204204 ((__PULL__) == GPIO_PULLDOWN))
205205
206-
206+
207207/**
208208 * @}
209209 */
@@ -283,10 +283,10 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
283283/** @defgroup GPIO_Exported_Functions_Group2 IO operation functions
284284 * @{
285285 */
286- GPIO_PinState HAL_GPIO_ReadPin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin );
287- void HAL_GPIO_WritePin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin , GPIO_PinState PinState );
288- void HAL_GPIO_TogglePin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin );
289- HAL_StatusTypeDef HAL_GPIO_LockPin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin );
286+ GPIO_PinState HAL_GPIO_ReadPin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin );
287+ void HAL_GPIO_WritePin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin , GPIO_PinState PinState );
288+ void HAL_GPIO_TogglePin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin );
289+ HAL_StatusTypeDef HAL_GPIO_LockPin (GPIO_TypeDef * GPIOx , uint16_t GPIO_Pin );
290290void HAL_GPIO_EXTI_IRQHandler (uint16_t GPIO_Pin );
291291void HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin );
292292/**
@@ -310,11 +310,11 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
310310
311311/**
312312 * @}
313- */
313+ */
314314
315315/**
316316 * @}
317- */
317+ */
318318
319319#ifdef __cplusplus
320320}
0 commit comments