HAL库——stm32f1xx_hal_gpio.c

 ##### How to use this driver #####
00052   ==============================================================================  
00053  [..]             
00054    (#) Enable the GPIO APB2 clock using the following function : __HAL_GPIOx_CLK_ENABLE(). 
00055    
00056    (#) Configure the GPIO pin(s) using HAL_GPIO_Init().
00057        (++) Configure the IO mode using "Mode" member from GPIO_InitTypeDef structure
00058        (++) Activate Pull-up, Pull-down resistor using "Pull" member from GPIO_InitTypeDef 
00059             structure.
00060        (++) In case of Output or alternate function mode selection: the speed is 
00061             configured through "Speed" member from GPIO_InitTypeDef structure
00062        (++) Analog mode is required when a pin is to be used as ADC channel 
00063             or DAC output.
00064        (++) In case of external interrupt/event selection the "Mode" member from 
00065             GPIO_InitTypeDef structure select the type (interrupt or event) and 
00066             the corresponding trigger event (rising or falling or both).
00067    
00068    (#) In case of external interrupt/event mode selection, configure NVIC IRQ priority 
00069        mapped to the EXTI line using HAL_NVIC_SetPriority() and enable it using
00070        HAL_NVIC_EnableIRQ().
00071          
00072    (#) To get the level of a pin configured in input mode use HAL_GPIO_ReadPin().
00073             
00074    (#) To set/reset the level of a pin configured in output mode use 
00075        HAL_GPIO_WritePin()/HAL_GPIO_TogglePin().
00076   
00077    (#) To lock pin configuration until next reset use HAL_GPIO_LockPin().
00078                  
00079    (#) During and just after reset, the alternate functions are not 
00080        active and the GPIO pins are configured in input floating mode (except JTAG
00081        pins).
00082   
00083    (#) The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general purpose 
00084        (PC14 and PC15, respectively) when the LSE oscillator is off. The LSE has 
00085        priority over the GPIO function.
00086   
00087    (#) The HSE oscillator pins OSC_IN/OSC_OUT can be used as 
00088        general purpose PD0 and PD1, respectively, when the HSE oscillator is off. 
00089        The HSE has priority over the GPIO function.

你可能感兴趣的:(HAL库——stm32f1xx_hal_gpio.c)