2020-02-20 11:42:50 +08:00
|
|
|
/* USER CODE BEGIN Header */
|
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @file : main.h
|
|
|
|
* @brief : Header for main.c file.
|
|
|
|
* This file contains the common defines of the application.
|
|
|
|
******************************************************************************
|
|
|
|
* @attention
|
|
|
|
*
|
|
|
|
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
|
|
|
|
* All rights reserved.</center></h2>
|
|
|
|
*
|
|
|
|
* This software component is licensed by ST under BSD 3-Clause license,
|
|
|
|
* the "License"; You may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at:
|
|
|
|
* opensource.org/licenses/BSD-3-Clause
|
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
/* USER CODE END Header */
|
|
|
|
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
|
|
#ifndef __MAIN_H
|
|
|
|
#define __MAIN_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
|
|
#include "stm32f1xx_hal.h"
|
|
|
|
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN Includes */
|
|
|
|
|
|
|
|
/* USER CODE END Includes */
|
|
|
|
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN ET */
|
|
|
|
|
|
|
|
/* USER CODE END ET */
|
|
|
|
|
|
|
|
/* Exported constants --------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN EC */
|
|
|
|
|
|
|
|
/* USER CODE END EC */
|
|
|
|
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN EM */
|
|
|
|
|
|
|
|
/* USER CODE END EM */
|
|
|
|
|
|
|
|
/* Exported functions prototypes ---------------------------------------------*/
|
|
|
|
void Error_Handler(void);
|
|
|
|
|
|
|
|
/* USER CODE BEGIN EFP */
|
2020-08-25 14:03:16 +08:00
|
|
|
void ISP_Judge();
|
2020-02-20 11:42:50 +08:00
|
|
|
/* USER CODE END EFP */
|
|
|
|
|
|
|
|
/* Private defines -----------------------------------------------------------*/
|
2020-07-15 18:26:22 +08:00
|
|
|
#define SYS_POWER_LED_CTL_Pin GPIO_PIN_2
|
|
|
|
#define SYS_POWER_LED_CTL_GPIO_Port GPIOE
|
|
|
|
#define SYS_CUSTOM_BTN_Pin GPIO_PIN_3
|
|
|
|
#define SYS_CUSTOM_BTN_GPIO_Port GPIOE
|
|
|
|
#define SYS_CUSTOM_BTN_EXTI_IRQn EXTI3_IRQn
|
|
|
|
#define PMB_PS_ON_Pin GPIO_PIN_4
|
|
|
|
#define PMB_PS_ON_GPIO_Port GPIOE
|
|
|
|
#define PMB_CHRG_STAT2_Pin GPIO_PIN_5
|
|
|
|
#define PMB_CHRG_STAT2_GPIO_Port GPIOE
|
|
|
|
#define PMG_CHRG_STAT1_Pin GPIO_PIN_6
|
|
|
|
#define PMG_CHRG_STAT1_GPIO_Port GPIOE
|
|
|
|
#define PMB_CHRG_SHDN_Pin GPIO_PIN_0
|
|
|
|
#define PMB_CHRG_SHDN_GPIO_Port GPIOC
|
|
|
|
#define PMB_TEMP_SEN_EN_Pin GPIO_PIN_1
|
|
|
|
#define PMB_TEMP_SEN_EN_GPIO_Port GPIOC
|
|
|
|
#define PMB_TEMP_SEN_ALT_Pin GPIO_PIN_2
|
|
|
|
#define PMB_TEMP_SEN_ALT_GPIO_Port GPIOC
|
|
|
|
#define PMB_CLOULOMB_ALCC_Pin GPIO_PIN_3
|
|
|
|
#define PMB_CLOULOMB_ALCC_GPIO_Port GPIOC
|
|
|
|
#define SYS_POWER_BTN_Pin GPIO_PIN_0
|
|
|
|
#define SYS_POWER_BTN_GPIO_Port GPIOA
|
|
|
|
#define SYS_POWER_BTN_EXTI_IRQn EXTI0_IRQn
|
|
|
|
#define MON_24V0_DIV16_Pin GPIO_PIN_3
|
|
|
|
#define MON_24V0_DIV16_GPIO_Port GPIOA
|
|
|
|
#define MON_5V0_DIV8_Pin GPIO_PIN_4
|
|
|
|
#define MON_5V0_DIV8_GPIO_Port GPIOA
|
|
|
|
#define MON_12V0_DIV8_Pin GPIO_PIN_5
|
|
|
|
#define MON_12V0_DIV8_GPIO_Port GPIOA
|
|
|
|
#define MON_BKP_BAT_DIV8_Pin GPIO_PIN_6
|
|
|
|
#define MON_BKP_BAT_DIV8_GPIO_Port GPIOA
|
|
|
|
#define MON_MAIN_PWR_DIV16_Pin GPIO_PIN_7
|
|
|
|
#define MON_MAIN_PWR_DIV16_GPIO_Port GPIOA
|
|
|
|
#define SYS_RUN_LED_CTL_Pin GPIO_PIN_4
|
|
|
|
#define SYS_RUN_LED_CTL_GPIO_Port GPIOC
|
|
|
|
#define SYS_BUZZ_CTL_Pin GPIO_PIN_5
|
|
|
|
#define SYS_BUZZ_CTL_GPIO_Port GPIOC
|
|
|
|
#define SYS_FAN_CTL_1_Pin GPIO_PIN_8
|
|
|
|
#define SYS_FAN_CTL_1_GPIO_Port GPIOE
|
|
|
|
#define SYS_FAN_SNS_1_Pin GPIO_PIN_9
|
|
|
|
#define SYS_FAN_SNS_1_GPIO_Port GPIOE
|
|
|
|
#define SYS_FAN_CTL_2_Pin GPIO_PIN_10
|
|
|
|
#define SYS_FAN_CTL_2_GPIO_Port GPIOE
|
|
|
|
#define SYS_FAN_SNS_2_Pin GPIO_PIN_11
|
|
|
|
#define SYS_FAN_SNS_2_GPIO_Port GPIOE
|
|
|
|
#define SYS_FAN_CTL_3_Pin GPIO_PIN_12
|
|
|
|
#define SYS_FAN_CTL_3_GPIO_Port GPIOE
|
|
|
|
#define SYS_FAN_SNS_3_Pin GPIO_PIN_13
|
|
|
|
#define SYS_FAN_SNS_3_GPIO_Port GPIOE
|
|
|
|
#define IIC2_SCL_Pin GPIO_PIN_10
|
|
|
|
#define IIC2_SCL_GPIO_Port GPIOB
|
|
|
|
#define IIC2_SDA_Pin GPIO_PIN_11
|
|
|
|
#define IIC2_SDA_GPIO_Port GPIOB
|
|
|
|
#define USB2_VBUS_CTL_1_Pin GPIO_PIN_12
|
|
|
|
#define USB2_VBUS_CTL_1_GPIO_Port GPIOB
|
|
|
|
#define USB2_VBUS_CTL_2_Pin GPIO_PIN_13
|
|
|
|
#define USB2_VBUS_CTL_2_GPIO_Port GPIOB
|
|
|
|
#define USB2_VBUS_CTL_3_Pin GPIO_PIN_14
|
|
|
|
#define USB2_VBUS_CTL_3_GPIO_Port GPIOB
|
|
|
|
#define USB2_VBUS_CTL_4_Pin GPIO_PIN_15
|
|
|
|
#define USB2_VBUS_CTL_4_GPIO_Port GPIOB
|
|
|
|
#define USB2_VBUS_CTL_5_Pin GPIO_PIN_8
|
|
|
|
#define USB2_VBUS_CTL_5_GPIO_Port GPIOD
|
|
|
|
#define USB2_VBUS_CTL_6_Pin GPIO_PIN_9
|
|
|
|
#define USB2_VBUS_CTL_6_GPIO_Port GPIOD
|
|
|
|
#define USB3_VBUS_CTL_5_Pin GPIO_PIN_10
|
|
|
|
#define USB3_VBUS_CTL_5_GPIO_Port GPIOD
|
|
|
|
#define USB3_VBUS_CTL_6_Pin GPIO_PIN_11
|
|
|
|
#define USB3_VBUS_CTL_6_GPIO_Port GPIOD
|
|
|
|
#define USB3_VBUS_CTL_1_Pin GPIO_PIN_12
|
|
|
|
#define USB3_VBUS_CTL_1_GPIO_Port GPIOD
|
2020-04-02 22:18:11 +08:00
|
|
|
#define USB3_VBUS_CTL_2_Pin GPIO_PIN_13
|
2020-07-15 18:26:22 +08:00
|
|
|
#define USB3_VBUS_CTL_2_GPIO_Port GPIOD
|
|
|
|
#define USB3_VBUS_CTL_3_Pin GPIO_PIN_14
|
|
|
|
#define USB3_VBUS_CTL_3_GPIO_Port GPIOD
|
2020-04-02 22:18:11 +08:00
|
|
|
#define USB3_VBUS_CTL_4_Pin GPIO_PIN_15
|
2020-07-15 18:26:22 +08:00
|
|
|
#define USB3_VBUS_CTL_4_GPIO_Port GPIOD
|
2020-08-24 11:36:08 +08:00
|
|
|
#define SOC_U3_HOST_PWR_STA_Pin GPIO_PIN_6
|
|
|
|
#define SOC_U3_HOST_PWR_STA_GPIO_Port GPIOC
|
|
|
|
#define SOC_U3_HOST_PWR_STA_EXTI_IRQn EXTI9_5_IRQn
|
|
|
|
#define SOC_U3_HUB_PWR_STA_Pin GPIO_PIN_7
|
|
|
|
#define SOC_U3_HUB_PWR_STA_GPIO_Port GPIOC
|
|
|
|
#define SOC_U3_HUB_PWR_STA_EXTI_IRQn EXTI9_5_IRQn
|
|
|
|
#define SOC_U2_HUB_PWR_STA_Pin GPIO_PIN_8
|
|
|
|
#define SOC_U2_HUB_PWR_STA_GPIO_Port GPIOC
|
|
|
|
#define SOC_U2_HUB_PWR_STA_EXTI_IRQn EXTI9_5_IRQn
|
2020-07-15 18:26:22 +08:00
|
|
|
#define USB2_FS_ENUM_CTL_Pin GPIO_PIN_8
|
|
|
|
#define USB2_FS_ENUM_CTL_GPIO_Port GPIOA
|
|
|
|
#define USB2_FS_DM_Pin GPIO_PIN_11
|
|
|
|
#define USB2_FS_DM_GPIO_Port GPIOA
|
|
|
|
#define USB2_FS_DP_Pin GPIO_PIN_12
|
|
|
|
#define USB2_FS_DP_GPIO_Port GPIOA
|
2020-04-14 17:27:52 +08:00
|
|
|
#define SYS_SWDIO_Pin GPIO_PIN_13
|
|
|
|
#define SYS_SWDIO_GPIO_Port GPIOA
|
|
|
|
#define SYS_SWCLK_Pin GPIO_PIN_14
|
|
|
|
#define SYS_SWCLK_GPIO_Port GPIOA
|
2020-07-15 18:26:22 +08:00
|
|
|
#define SOC_U2_HUB_PWR_CTL_Pin GPIO_PIN_12
|
|
|
|
#define SOC_U2_HUB_PWR_CTL_GPIO_Port GPIOC
|
|
|
|
#define SOC_U3_HUB_PWR_CTL_Pin GPIO_PIN_0
|
|
|
|
#define SOC_U3_HUB_PWR_CTL_GPIO_Port GPIOD
|
|
|
|
#define SOC_U3_HOST_PWR_CTL_Pin GPIO_PIN_1
|
|
|
|
#define SOC_U3_HOST_PWR_CTL_GPIO_Port GPIOD
|
|
|
|
#define SOC_U3_GEC_PWR_CTL_Pin GPIO_PIN_2
|
|
|
|
#define SOC_U3_GEC_PWR_CTL_GPIO_Port GPIOD
|
|
|
|
#define SOC_GE_SW_PWR_CTL_Pin GPIO_PIN_3
|
|
|
|
#define SOC_GE_SW_PWR_CTL_GPIO_Port GPIOD
|
|
|
|
#define SOM_POWER_EN_Pin GPIO_PIN_4
|
|
|
|
#define SOM_POWER_EN_GPIO_Port GPIOD
|
|
|
|
#define SOM_SHUTDOWN_REQ_Pin GPIO_PIN_5
|
|
|
|
#define SOM_SHUTDOWN_REQ_GPIO_Port GPIOD
|
2020-08-05 19:22:37 +08:00
|
|
|
#define SOM_SHUTDOWN_REQ_EXTI_IRQn EXTI9_5_IRQn
|
2020-07-15 18:26:22 +08:00
|
|
|
#define SOM_SLEEP_WAKE_Pin GPIO_PIN_6
|
|
|
|
#define SOM_SLEEP_WAKE_GPIO_Port GPIOD
|
|
|
|
#define SOM_FORCE_RECOVERY_Pin GPIO_PIN_7
|
|
|
|
#define SOM_FORCE_RECOVERY_GPIO_Port GPIOD
|
2020-04-14 17:27:52 +08:00
|
|
|
#define SYS_SWO_Pin GPIO_PIN_3
|
|
|
|
#define SYS_SWO_GPIO_Port GPIOB
|
2020-07-15 18:26:22 +08:00
|
|
|
#define SOM_SYS_RESET_Pin GPIO_PIN_4
|
|
|
|
#define SOM_SYS_RESET_GPIO_Port GPIOB
|
|
|
|
#define SOM_MOD_SLEEP_Pin GPIO_PIN_5
|
|
|
|
#define SOM_MOD_SLEEP_GPIO_Port GPIOB
|
|
|
|
#define IIC1_SCL_Pin GPIO_PIN_8
|
|
|
|
#define IIC1_SCL_GPIO_Port GPIOB
|
|
|
|
#define IIC1_SDA_Pin GPIO_PIN_9
|
|
|
|
#define IIC1_SDA_GPIO_Port GPIOB
|
2020-02-20 11:42:50 +08:00
|
|
|
/* USER CODE BEGIN Private defines */
|
2020-08-25 14:03:16 +08:00
|
|
|
#define ISP_Address 0x1fffb000 //In-System-Program address in flash
|
2020-02-20 11:42:50 +08:00
|
|
|
/* USER CODE END Private defines */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __MAIN_H */
|
|
|
|
|
|
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|