deb4385a06
- LED1: PC4 -> PC5,Pull PULLUP->NOPULL,Speed HIGH->LOW - LED2: PC5 -> PB0(新增输出),同上 - CH395F SPI2 仅标签口径互换:PB14=CH395F_SDI、PB15=CH395F_SDO; 电气 AF 映射未变(PB14=SPI2_MISO 上拉,PB15=SPI2_MOSI);删除宏 CH395F_SDOB15_Pin(已确认全工程无引用) - 来源:CubeMX 6.18.1 依 CPU-V0.2 原理图调整并重新生成 - 本提交是可搬运的“引脚补丁”,后续 cherry-pick 到 ui-research 基座
173 lines
4.9 KiB
C
173 lines
4.9 KiB
C
/* USER CODE BEGIN Header */
|
|
/**
|
|
******************************************************************************
|
|
* @file : main.h
|
|
* @brief : Header for main.c file.
|
|
* This file contains the common defines of the application.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* Copyright (c) 2026 STMicroelectronics.
|
|
* All rights reserved.
|
|
*
|
|
* This software is licensed under terms that can be found in the LICENSE file
|
|
* in the root directory of this software component.
|
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
/* USER CODE END Header */
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __MAIN_H
|
|
#define __MAIN_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "stm32f4xx_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 */
|
|
|
|
/* USER CODE END EFP */
|
|
|
|
/* Private defines -----------------------------------------------------------*/
|
|
#define CH395_INT_Pin GPIO_PIN_5
|
|
#define CH395_INT_GPIO_Port GPIOE
|
|
#define LED1_Pin GPIO_PIN_5
|
|
#define LED1_GPIO_Port GPIOC
|
|
#define LED2_Pin GPIO_PIN_0
|
|
#define LED2_GPIO_Port GPIOB
|
|
#define LED3_Pin GPIO_PIN_1
|
|
#define LED3_GPIO_Port GPIOB
|
|
#define LED4_Pin GPIO_PIN_2
|
|
#define LED4_GPIO_Port GPIOB
|
|
#define LED5_Pin GPIO_PIN_11
|
|
#define LED5_GPIO_Port GPIOF
|
|
#define LED6_Pin GPIO_PIN_12
|
|
#define LED6_GPIO_Port GPIOF
|
|
#define TP_OS0_Pin GPIO_PIN_13
|
|
#define TP_OS0_GPIO_Port GPIOF
|
|
#define TP_OS1_Pin GPIO_PIN_14
|
|
#define TP_OS1_GPIO_Port GPIOF
|
|
#define TP_OS2_Pin GPIO_PIN_15
|
|
#define TP_OS2_GPIO_Port GPIOF
|
|
#define DB0_Pin GPIO_PIN_0
|
|
#define DB0_GPIO_Port GPIOG
|
|
#define DB1_Pin GPIO_PIN_1
|
|
#define DB1_GPIO_Port GPIOG
|
|
#define ST_TX2_Pin GPIO_PIN_10
|
|
#define ST_TX2_GPIO_Port GPIOB
|
|
#define ST_RX2_Pin GPIO_PIN_11
|
|
#define ST_RX2_GPIO_Port GPIOB
|
|
#define CH395_SCS_Pin GPIO_PIN_12
|
|
#define CH395_SCS_GPIO_Port GPIOB
|
|
#define CH395F_SCK_Pin GPIO_PIN_13
|
|
#define CH395F_SCK_GPIO_Port GPIOB
|
|
#define CH395F_SDI_Pin GPIO_PIN_14
|
|
#define CH395F_SDI_GPIO_Port GPIOB
|
|
#define CH395F_SDO_Pin GPIO_PIN_15
|
|
#define CH395F_SDO_GPIO_Port GPIOB
|
|
#define DB2_Pin GPIO_PIN_2
|
|
#define DB2_GPIO_Port GPIOG
|
|
#define DB3_Pin GPIO_PIN_3
|
|
#define DB3_GPIO_Port GPIOG
|
|
#define DB4_Pin GPIO_PIN_4
|
|
#define DB4_GPIO_Port GPIOG
|
|
#define DB5_Pin GPIO_PIN_5
|
|
#define DB5_GPIO_Port GPIOG
|
|
#define DB6_Pin GPIO_PIN_6
|
|
#define DB6_GPIO_Port GPIOG
|
|
#define DB7_Pin GPIO_PIN_7
|
|
#define DB7_GPIO_Port GPIOG
|
|
#define DB8_Pin GPIO_PIN_8
|
|
#define DB8_GPIO_Port GPIOG
|
|
#define ST_TX3_Pin GPIO_PIN_10
|
|
#define ST_TX3_GPIO_Port GPIOC
|
|
#define ST_RX3_Pin GPIO_PIN_11
|
|
#define ST_RX3_GPIO_Port GPIOC
|
|
#define ST_TX4_Pin GPIO_PIN_12
|
|
#define ST_TX4_GPIO_Port GPIOC
|
|
#define ST_DIR4_Pin GPIO_PIN_0
|
|
#define ST_DIR4_GPIO_Port GPIOD
|
|
#define TP_FRSTDATA_Pin GPIO_PIN_1
|
|
#define TP_FRSTDATA_GPIO_Port GPIOD
|
|
#define ST_RX4_Pin GPIO_PIN_2
|
|
#define ST_RX4_GPIO_Port GPIOD
|
|
#define TP_RD_Pin GPIO_PIN_3
|
|
#define TP_RD_GPIO_Port GPIOD
|
|
#define TP_CONVST_Pin GPIO_PIN_4
|
|
#define TP_CONVST_GPIO_Port GPIOD
|
|
#define ST_TX1_Pin GPIO_PIN_5
|
|
#define ST_TX1_GPIO_Port GPIOD
|
|
#define ST_RX1_Pin GPIO_PIN_6
|
|
#define ST_RX1_GPIO_Port GPIOD
|
|
#define TP_BUSY_Pin GPIO_PIN_7
|
|
#define TP_BUSY_GPIO_Port GPIOD
|
|
#define TP_BUSY_EXTI_IRQn EXTI9_5_IRQn
|
|
#define DB9_Pin GPIO_PIN_9
|
|
#define DB9_GPIO_Port GPIOG
|
|
#define DB10_Pin GPIO_PIN_10
|
|
#define DB10_GPIO_Port GPIOG
|
|
#define DB11_Pin GPIO_PIN_11
|
|
#define DB11_GPIO_Port GPIOG
|
|
#define DB12_Pin GPIO_PIN_12
|
|
#define DB12_GPIO_Port GPIOG
|
|
#define DB13_Pin GPIO_PIN_13
|
|
#define DB13_GPIO_Port GPIOG
|
|
#define DB14_Pin GPIO_PIN_14
|
|
#define DB14_GPIO_Port GPIOG
|
|
#define DB15_Pin GPIO_PIN_15
|
|
#define DB15_GPIO_Port GPIOG
|
|
#define GD_SCLK_Pin GPIO_PIN_3
|
|
#define GD_SCLK_GPIO_Port GPIOB
|
|
#define GD_SO_Pin GPIO_PIN_4
|
|
#define GD_SO_GPIO_Port GPIOB
|
|
#define GD_SI_Pin GPIO_PIN_5
|
|
#define GD_SI_GPIO_Port GPIOB
|
|
#define SD_SCL_Pin GPIO_PIN_6
|
|
#define SD_SCL_GPIO_Port GPIOB
|
|
#define SD_SDA_Pin GPIO_PIN_7
|
|
#define SD_SDA_GPIO_Port GPIOB
|
|
#define GD_WP_Pin GPIO_PIN_8
|
|
#define GD_WP_GPIO_Port GPIOB
|
|
#define GD_CS_Pin GPIO_PIN_0
|
|
#define GD_CS_GPIO_Port GPIOE
|
|
#define GD_HOLD_Pin GPIO_PIN_1
|
|
#define GD_HOLD_GPIO_Port GPIOE
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|