Initial commit: CCU621_M firmware project with BLE debug link support.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+148
@@ -0,0 +1,148 @@
|
||||
|
||||
|
||||
#ifndef GPIO_H
|
||||
#define GPIO_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __PIN_DEF_H
|
||||
#define __PIN_DEF_H
|
||||
|
||||
#include "gd32h7xx.h" // 根据实际芯片替换
|
||||
|
||||
/* ==================== 板载继电器控制 (K1~K10) ==================== */
|
||||
#define RELAY_K1_PORT GPIOG
|
||||
#define RELAY_K1_PIN GPIO_PIN_4
|
||||
#define RELAY_K2_PORT GPIOG
|
||||
#define RELAY_K2_PIN GPIO_PIN_5
|
||||
#define RELAY_K3_PORT GPIOG
|
||||
#define RELAY_K3_PIN GPIO_PIN_6
|
||||
#define RELAY_K4_PORT GPIOG
|
||||
#define RELAY_K4_PIN GPIO_PIN_7
|
||||
#define RELAY_K5_PORT GPIOG
|
||||
#define RELAY_K5_PIN GPIO_PIN_8
|
||||
#define RELAY_K6_PORT GPIOC
|
||||
#define RELAY_K6_PIN GPIO_PIN_8
|
||||
#define RELAY_K7_PORT GPIOC
|
||||
#define RELAY_K7_PIN GPIO_PIN_9
|
||||
#define RELAY_K8_PORT GPIOG
|
||||
#define RELAY_K8_PIN GPIO_PIN_9
|
||||
#define RELAY_K9_PORT GPIOG
|
||||
#define RELAY_K9_PIN GPIO_PIN_10
|
||||
#define RELAY_K10_PORT GPIOG
|
||||
#define RELAY_K10_PIN GPIO_PIN_11
|
||||
|
||||
/* 快速操作宏(可选) */
|
||||
#define RELAY_ON(port, pin) gpio_bit_set(port, pin)
|
||||
#define RELAY_OFF(port, pin) gpio_bit_reset(port, pin)
|
||||
|
||||
/* ==================== 电子锁控制 ==================== */
|
||||
#define ELOCK_A_PORT GPIOK
|
||||
#define ELOCK_A_PIN GPIO_PIN_1
|
||||
#define ELOCK_B_PORT GPIOK
|
||||
#define ELOCK_B_PIN GPIO_PIN_2
|
||||
|
||||
|
||||
/* ==================== 绝缘监测开关控制 ==================== */
|
||||
#define INSA_GND_PORT GPIOE
|
||||
#define INSA_GND_PIN GPIO_PIN_4 // INSA_CTL
|
||||
#define INSA_POS_PORT GPIOE
|
||||
#define INSA_POS_PIN GPIO_PIN_3 // UNBALA_CTL
|
||||
|
||||
#define INSB_GND_PORT GPIOA
|
||||
#define INSB_GND_PIN GPIO_PIN_5 // INSB_CTL
|
||||
#define INSB_POS_PORT GPIOE
|
||||
#define INSB_POS_PIN GPIO_PIN_5 // UNBALB_CTL
|
||||
|
||||
/* ==================== LED 指示灯 ==================== */
|
||||
#define LED_RUN_PORT GPIOG
|
||||
#define LED_RUN_PIN GPIO_PIN_15
|
||||
/* ==================== 连接确认模式选择 ==================== */
|
||||
#define CHK_CSA_PORT GPIOF
|
||||
#define CHK_CSA_PIN GPIO_PIN_8
|
||||
#define CHK_CSB_PORT GPIOF
|
||||
#define CHK_CSB_PIN GPIO_PIN_2
|
||||
|
||||
/* ==================== 内部控制输出 ==================== */
|
||||
#define WDO_PORT GPIOE
|
||||
#define WDO_PIN GPIO_PIN_2
|
||||
|
||||
#define ESP8685_EN_PORT GPIOB
|
||||
#define ESP8685_EN_PIN GPIO_PIN_7
|
||||
|
||||
/* FC41D 蓝牙/WiFi 模组复位(PE6,高有效,常态低) */
|
||||
#define FC41D_RST_PORT GPIOE
|
||||
#define FC41D_RST_PIN GPIO_PIN_6
|
||||
#define BLUE_EN_PORT FC41D_RST_PORT /* 兼容旧名 */
|
||||
#define BLUE_EN_PIN FC41D_RST_PIN
|
||||
|
||||
#define CIU_RST_PORT GPIOA
|
||||
#define CIU_RST_PIN GPIO_PIN_10
|
||||
|
||||
/* ==================== 温度通道地址选择 ==================== */
|
||||
#define TEMP_ADDR_A_PORT GPIOD
|
||||
#define TEMP_ADDR_A_PIN GPIO_PIN_10
|
||||
#define TEMP_ADDR_B_PORT GPIOD
|
||||
#define TEMP_ADDR_B_PIN GPIO_PIN_13
|
||||
#define TEMP_ADDR_C_PORT GPIOJ
|
||||
#define TEMP_ADDR_C_PIN GPIO_PIN_8
|
||||
|
||||
/* ==================== 开关量输入 (DI) ==================== */
|
||||
// YX 系列
|
||||
#define YX1_PORT GPIOC
|
||||
#define YX1_PIN GPIO_PIN_0
|
||||
#define YX2_PORT GPIOB
|
||||
#define YX2_PIN GPIO_PIN_0
|
||||
#define YX3_PORT GPIOF
|
||||
#define YX3_PIN GPIO_PIN_14
|
||||
#define YX4_PORT GPIOB
|
||||
#define YX4_PIN GPIO_PIN_1
|
||||
#define YX5_PORT GPIOF
|
||||
#define YX5_PIN GPIO_PIN_15
|
||||
#define YX6_PORT GPIOB
|
||||
#define YX6_PIN GPIO_PIN_2
|
||||
#define YX7_PORT GPIOG
|
||||
#define YX7_PIN GPIO_PIN_0
|
||||
#define YX8_PORT GPIOF
|
||||
#define YX8_PIN GPIO_PIN_11
|
||||
#define YX9_PORT GPIOE
|
||||
#define YX9_PIN GPIO_PIN_11
|
||||
#define YX10_PORT GPIOF
|
||||
#define YX10_PIN GPIO_PIN_12
|
||||
#define YX11_PORT GPIOE
|
||||
#define YX11_PIN GPIO_PIN_15
|
||||
#define YX12_PORT GPIOF
|
||||
#define YX12_PIN GPIO_PIN_13
|
||||
|
||||
// 辅助电源检测
|
||||
#define AUX_PADET_PORT GPIOG
|
||||
#define AUX_PADET_PIN GPIO_PIN_1 // A枪
|
||||
#define AUX_PBDT_PORT GPIOB
|
||||
#define AUX_PBDT_PIN GPIO_PIN_10 // B枪
|
||||
|
||||
// 连接确认输入
|
||||
#define CHECKOUTA1_PORT GPIOF
|
||||
#define CHECKOUTA1_PIN GPIO_PIN_10
|
||||
#define CHECKOUTA2_PORT GPIOF
|
||||
#define CHECKOUTA2_PIN GPIO_PIN_9
|
||||
#define CHECKOUTB1_PORT GPIOD
|
||||
#define CHECKOUTB1_PIN GPIO_PIN_3
|
||||
#define CHECKOUTB2_PORT GPIOA
|
||||
#define CHECKOUTB2_PIN GPIO_PIN_15
|
||||
|
||||
//4G模块
|
||||
#define PWR_4G_PORT GPIOF
|
||||
#define PWR_4G_PIN GPIO_PIN_3
|
||||
#define RST_4G_PORT GPIOC
|
||||
#define RST_4G_PIN GPIO_PIN_13
|
||||
/* ==================== 输入读取宏 ==================== */
|
||||
#define DI_READ(port, pin) (gpio_input_bit_get(port, pin))
|
||||
|
||||
#endif /* __PIN_DEF_H */
|
||||
|
||||
void v_outpin_config(void);
|
||||
void v_inpin_config(void);
|
||||
void v_4g_config(void);
|
||||
void v_temp_config(void);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user