add exti4(sys_reset_pin)

master
ThinkPad-T460P 2021-01-06 12:25:02 +08:00
parent 93fc34a75c
commit 4946bf03d1
2 changed files with 10 additions and 16 deletions

View File

@ -176,6 +176,7 @@ void ISP_Judge();
#define SYS_SWO_GPIO_Port GPIOB
#define SOM_SYS_RESET_Pin GPIO_PIN_4
#define SOM_SYS_RESET_GPIO_Port GPIOB
#define SOM_SYS_RESET_EXTI_IRQn EXTI4_IRQn
#define SOM_MOD_SLEEP_Pin GPIO_PIN_5
#define SOM_MOD_SLEEP_GPIO_Port GPIOB
#define IIC1_SCL_Pin GPIO_PIN_8

View File

@ -6,7 +6,7 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
@ -79,9 +79,6 @@ void MX_GPIO_Init(void)
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOD, SOM_SLEEP_WAKE_Pin|SOM_FORCE_RECOVERY_Pin, GPIO_PIN_SET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(SOM_SYS_RESET_GPIO_Port, SOM_SYS_RESET_Pin, GPIO_PIN_SET);
/*Configure GPIO pins : PEPin PEPin PEPin PEPin
PEPin */
GPIO_InitStruct.Pin = SYS_POWER_LED_CTL_Pin|PMB_PS_ON_Pin|SYS_FAN_CTL_1_Pin|SYS_FAN_CTL_2_Pin
@ -131,9 +128,9 @@ void MX_GPIO_Init(void)
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/*Configure GPIO pins : PBPin PBPin PBPin PBPin
PBPin PBPin PBPin */
PBPin PBPin */
GPIO_InitStruct.Pin = IIC2_SCL_Pin|IIC2_SDA_Pin|USB2_VBUS_CTL_1_Pin|USB2_VBUS_CTL_2_Pin
|USB2_VBUS_CTL_3_Pin|USB2_VBUS_CTL_4_Pin|SOM_SYS_RESET_Pin;
|USB2_VBUS_CTL_3_Pin|USB2_VBUS_CTL_4_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
@ -171,22 +168,18 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(SOM_SHUTDOWN_REQ_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : PtPin */
GPIO_InitStruct.Pin = SOM_SYS_RESET_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(SOM_SYS_RESET_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : PtPin */
GPIO_InitStruct.Pin = SOM_MOD_SLEEP_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(SOM_MOD_SLEEP_GPIO_Port, &GPIO_InitStruct);
/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
}
/* USER CODE BEGIN 2 */