EasyManuals Logo

ST STM32F31xx User Manual

ST STM32F31xx
584 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 #236 background imageLoading...
Page #236 background image
General-purpose I/Os (GPIO)
UM1581
236/584
DocID023800 Rev 1
 Input: Floating, Pull-up, Pull-down.
 Output: Push-Pull (Pull-up, Pull-down or no Pull), Open Drain (Pull-up, Pull-down
or no Pull). In output mode, the speed is configurable: Low, Medium, Fast or
High.
 Alternate Function: Push-Pull (Pull-up, Pull-down or no Pull), Open Drain (Pull-
up, Pull-down or no Pull).
 Analog: required mode when a pin is to be used as ADC channel, DAC output or
comparator input.
3. Peripherals alternate function:
 For ADC, DAC and comparators, configure the desired pin in analog mode using
GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AN
 For other peripherals (TIM, USART...):
 Connect the pin to the desired peripherals' Alternate Function (AF) using
GPIO_PinAFConfig() function.
 Configure the desired pin in alternate function mode using GPIO_InitStruct-
>GPIO_Mode = GPIO_Mode_AF
 Select the type, pull-up/pull-down and output speed via GPIO_PuPd,
GPIO_OType and GPIO_Speed members.
 Call GPIO_Init() function.
4. To get the level of a pin configured in input mode use GPIO_ReadInputDataBit()
5. To set/reset the level of a pin configured in output mode use
GPIO_SetBits()/GPIO_ResetBits()
6. During and just after reset, the alternate functions are not active and the GPIO pins
are configured in input floating mode (except JTAG pins).
7. The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general-
purpose (PC14 and PC15, respectively) when the LSE oscillator is off. The LSE has
priority over the GPIO function.
8. The HSE oscillator pins OSC_IN/OSC_OUT can be used as general-purpose (PF0
and PF1 respectively) when the HSE oscillator is off. The HSE has the priority over
the GPIO function.
12.2.2 Initialization and Configuration
ï‚· GPIO_DeInit()
ï‚· GPIO_Init()
ï‚· GPIO_StructInit()
ï‚· GPIO_PinLockConfig()
12.2.3 GPIO Read and Write
ï‚· GPIO_ReadInputDataBit()
ï‚· GPIO_ReadInputData()
ï‚· GPIO_ReadOutputDataBit()
ï‚· GPIO_ReadOutputData()
ï‚· GPIO_SetBits()
ï‚· GPIO_ResetBits()
ï‚· GPIO_WriteBit()
ï‚· GPIO_Write()
12.2.4 GPIO Alternate functions configuration functions

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

ST STM32F31xx Specifications

General IconGeneral
BrandST
ModelSTM32F31xx
CategoryMicrocontrollers
LanguageEnglish

Related product manuals