Browse Source

cubemx配置PE2为外部中断

external_Interrupt
tianjialong 2 years ago
parent
commit
519fd46b76
  1. 4
      LWIP.ioc
  2. 2
      Src/gpio.c

4
LWIP.ioc

@ -141,7 +141,7 @@ PD3.GPIO_Label=ETH_RST
PD3.Locked=true PD3.Locked=true
PD3.Signal=GPIO_Output PD3.Signal=GPIO_Output
PE2.Locked=true PE2.Locked=true
PE2.Signal=GPIO_Input
PE2.Signal=GPXTI2
PE3.GPIOParameters=GPIO_PuPd PE3.GPIOParameters=GPIO_PuPd
PE3.GPIO_PuPd=GPIO_PULLUP PE3.GPIO_PuPd=GPIO_PULLUP
PE3.Locked=true PE3.Locked=true
@ -228,6 +228,8 @@ RCC.VCOI2SOutputFreq_Value=384000000
RCC.VCOInputFreq_Value=2000000 RCC.VCOInputFreq_Value=2000000
RCC.VCOOutputFreq_Value=336000000 RCC.VCOOutputFreq_Value=336000000
RCC.VcooutputI2S=192000000 RCC.VcooutputI2S=192000000
SH.GPXTI2.0=GPIO_EXTI2
SH.GPXTI2.ConfNb=1
SH.S_TIM4_CH1.0=TIM4_CH1,Encoder_Interface SH.S_TIM4_CH1.0=TIM4_CH1,Encoder_Interface
SH.S_TIM4_CH1.ConfNb=1 SH.S_TIM4_CH1.ConfNb=1
SH.S_TIM4_CH2.0=TIM4_CH2,Encoder_Interface SH.S_TIM4_CH2.0=TIM4_CH2,Encoder_Interface

2
Src/gpio.c

@ -61,7 +61,7 @@ void MX_GPIO_Init(void)
/*Configure GPIO pin : PE2 */ /*Configure GPIO pin : PE2 */
GPIO_InitStruct.Pin = GPIO_PIN_2; GPIO_InitStruct.Pin = GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);

Loading…
Cancel
Save