EasyManuals Logo

ST STM32F2 User Manual

ST STM32F2
1371 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #47 background imageLoading...
Page #47 background image
UM1940
Overview of HAL drivers
DocID028236 Rev 2
47/1371
Table 12: Description of GPIO_InitTypeDef structure
Structure
field
Description
Pin
Specifies the GPIO pins to be configured.
Possible values: GPIO_PIN_x or GPIO_PIN_All, where x[0..15]
Mode
Specifies the operating mode for the selected pins: GPIO mode or EXTI mode.
Possible values are:
GPIO mode
GPIO_MODE_INPUT : Input floating
GPIO_MODE_OUTPUT_PP : Output push-pull
GPIO_MODE_OUTPUT_OD : Output open drain
GPIO_MODE_AF_PP : Alternate function push-pull
GPIO_MODE_AF_OD : Alternate function open drain
GPIO_MODE_ANALOG : Analog mode
External Interrupt mode
GPIO_MODE_IT_RISING : Rising edge trigger detection
GPIO_MODE_IT_FALLING : Falling edge trigger detection
GPIO_MODE_IT_RISING_FALLING : Rising/Falling edge trigger
detection
External Event mode
GPIO_MODE_EVT_RISING : Rising edge trigger detection
GPIO_MODE_EVT_FALLING : Falling edge trigger detection
GPIO_MODE_EVT_RISING_FALLING: Rising/Falling edge trigger
detection
Pull
Specifies the Pull-up or Pull-down activation for the selected pins.
Possible values are:
GPIO_NOPULL
GPIO_PULLUP
GPIO_PULLDOWN
Speed
Specifies the speed for the selected pins
Possible values are:
GPIO_SPEED_LOW
GPIO_SPEED_MEDIUM
GPIO_SPEED_HIGH
Please find below typical GPIO configuration examples:
Configuring GPIOs as output push-pull to drive external LEDs
GPIO_InitStruct.Pin = GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_MEDIUM;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
Configuring PA0 as external interrupt with falling edge sensitivity:
GPIO_InitStructure.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Pin = GPIO_PIN_0;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F2 and is the answer not in the manual?

ST STM32F2 Specifications

General IconGeneral
BrandST
ModelSTM32F2
CategoryMicrocontrollers
LanguageEnglish

Related product manuals