Initial commit: CCU621_M firmware project with BLE debug link support.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+252
@@ -0,0 +1,252 @@
|
||||
/*!
|
||||
\file gpio.h
|
||||
\brief the header file of systick
|
||||
|
||||
\version 2026-01-01, for JC
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2025, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "gd32h7xx.h"
|
||||
#include "gd32h7xx_gpio.h"
|
||||
#include "gpio.h"
|
||||
|
||||
|
||||
/*!
|
||||
\brief Configure GPIO OUT pins
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void v_outpin_config(void)
|
||||
{
|
||||
/* 开启GPIO - outpin 外设时钟 经测试一句使能所有时钟不起作用 */
|
||||
//rcu_periph_clock_enable(RCU_GPIOA | RCU_GPIOB | RCU_GPIOC | RCU_GPIOD | RCU_GPIOE | RCU_GPIOF | RCU_GPIOG | RCU_GPIOJ | RCU_GPIOK);
|
||||
rcu_periph_clock_enable(RCU_GPIOA);
|
||||
rcu_periph_clock_enable(RCU_GPIOB);
|
||||
rcu_periph_clock_enable(RCU_GPIOC);
|
||||
rcu_periph_clock_enable(RCU_GPIOD);
|
||||
rcu_periph_clock_enable(RCU_GPIOE);
|
||||
rcu_periph_clock_enable(RCU_GPIOF);
|
||||
rcu_periph_clock_enable(RCU_GPIOG);
|
||||
rcu_periph_clock_enable(RCU_GPIOJ);
|
||||
rcu_periph_clock_enable(RCU_GPIOK);
|
||||
|
||||
/* 单阶段初始化:先预置 OCTL 为高电平(断开态),再切换到推挽输出。 */
|
||||
|
||||
gpio_bit_set(GPIOG,
|
||||
GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 |
|
||||
GPIO_PIN_11);
|
||||
gpio_bit_set(GPIOC, GPIO_PIN_8 | GPIO_PIN_9);
|
||||
//gpio_bit_set(GPIOK, GPIO_PIN_1 | GPIO_PIN_2);
|
||||
|
||||
/* 主控板开关量输出控制(DO)
|
||||
PG4 114 DO OUT1|板载继电器K1控制
|
||||
PG5 115 DO OUT2|板载继电器K2控制
|
||||
PG6 116 DO OUT3|板载继电器K3控制
|
||||
PG7 117 DO OUT4|板载继电器K4控制
|
||||
PG8 118 DO OUT5|板载继电器K5控制
|
||||
PC8 124 DO OUT6|板载继电器K6控制
|
||||
PC9 125 DO OUT7|板载继电器K7控制
|
||||
PG9 153 DO OUT8|板载继电器K8控制
|
||||
PG10 154 DO OUT9|板载继电器K9控制
|
||||
PG11 155 DO OUT10|板载继电器K10控制
|
||||
PK1 108 D0 A_gun_elelock_ ctr|A枪电子锁控制
|
||||
PK2 109 DO B_gun_elelock_ ctr|B枪电子锁控制
|
||||
*/
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOG, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_4 | GPIO_PIN_5 |GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_4 | GPIO_PIN_5 |GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11);
|
||||
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_8 | GPIO_PIN_9);
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_8 | GPIO_PIN_9);
|
||||
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOK, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_1 | GPIO_PIN_2 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOK, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_1 | GPIO_PIN_2 );
|
||||
|
||||
/* DO/电子锁电平已在切换为输出模式前预置为高电平(断开态),避免继电器抖动。 */
|
||||
|
||||
/* 主控板内部开关量输出控制(DO)
|
||||
PE4 3 DO INSA_CTL|A枪绝缘监测接地开关
|
||||
PE3 2 DO UNBALA_CTL|A枪绝缘监测正极回路开关
|
||||
PA5 50 DO INSB_CTL|B枪绝缘监测接地开关
|
||||
PE5 4 DO UNBALB_CTL|B枪绝缘监测正极回路开关
|
||||
*/
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5);
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ,GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5);
|
||||
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_5 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_5 );
|
||||
/* 板上LED指示灯
|
||||
PG15 DO H7_RUN
|
||||
*/
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOG, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,GPIO_PIN_15);
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ,GPIO_PIN_15);
|
||||
/* 主控板内部连接确认模式选择控制
|
||||
PF8 28 DO CHK_CSA_CTL
|
||||
PF2 20 DO CHK_CSB_CTL
|
||||
*/
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,GPIO_PIN_2 | GPIO_PIN_8);
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOF, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ,GPIO_PIN_2 | GPIO_PIN_8);
|
||||
/* 主控板内部控制输出
|
||||
PE2 1 DO WDO
|
||||
PB7 166 DO ESP8685_EN|ESP8685蓝牙WIFI模块使能控制
|
||||
PE6 5 DO FC41D_RST|FC41D蓝牙WIFI模块复位(高有效,常态低)
|
||||
PF3 21 DO 4G_RST|WH606 4G模块复位控制
|
||||
PC13 9 DO 4G_POWER|WH606 4G模块电源控制
|
||||
PA10 129 DO CIU_RST|CIU98_A加密芯片复位控制
|
||||
*/
|
||||
gpio_bit_reset(FC41D_RST_PORT, FC41D_RST_PIN); /* FC41D 常态低(高电平复位) */
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,GPIO_PIN_2 | GPIO_PIN_6);
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOE, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ,GPIO_PIN_2 | GPIO_PIN_6);
|
||||
|
||||
gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_7 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_7 );
|
||||
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_3 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOF, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_3 );
|
||||
|
||||
gpio_mode_set(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_13 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_13 );
|
||||
|
||||
gpio_mode_set(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_10 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_10 );
|
||||
|
||||
/* 温度采集通道选择控制
|
||||
PD10 数字地址“A”输出控制
|
||||
PD13 数字地址“B”输出控制
|
||||
PJ8 数字地址“C”输出控制
|
||||
*/
|
||||
/* Configure GPIO pins as output mode (no pull-up/pull-down) */
|
||||
gpio_mode_set(GPIOD, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,GPIO_PIN_10 | GPIO_PIN_13);
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ,GPIO_PIN_10 | GPIO_PIN_13);
|
||||
|
||||
gpio_mode_set(GPIOJ, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_8 );
|
||||
/* Set output type to push-pull and speed to 60MHz */
|
||||
gpio_output_options_set(GPIOJ, GPIO_OTYPE_PP, GPIO_OSPEED_60MHZ, GPIO_PIN_8);
|
||||
}
|
||||
|
||||
void v_inpin_config(void)
|
||||
{
|
||||
/* 开启GPIO - inpin 外设时钟 */
|
||||
rcu_periph_clock_enable(RCU_GPIOA);
|
||||
rcu_periph_clock_enable(RCU_GPIOB);
|
||||
rcu_periph_clock_enable(RCU_GPIOD);
|
||||
rcu_periph_clock_enable(RCU_GPIOE);
|
||||
rcu_periph_clock_enable(RCU_GPIOF);
|
||||
rcu_periph_clock_enable(RCU_GPIOG);
|
||||
|
||||
/* 开关量输入检测
|
||||
PC0 DI YX1|系统开关量输入检测
|
||||
PB0 55 DI YX2|系统开关量输入检测
|
||||
PF14 61 DI YX3|系统开关量输入检测
|
||||
PB1 56 DI YX4|系统开关量输入检测
|
||||
PF15 62 DI YX5|系统开关量输入检测
|
||||
PB2 57 DI YX6|系统开关量输入检测
|
||||
PG0 63 DI YX7|系统开关量输入检测
|
||||
PF11 58 DI YX8|系统开关量输入检测
|
||||
PE11 73 DI YX9|系统开关量输入检测
|
||||
PF12 59 DI YX10|系统开关量输入检测
|
||||
PE15 77 DI YX11|系统开关量输入检测
|
||||
PF13 60 DI YX12|系统开关量输入检测
|
||||
PG1 66 DI Aux_Padet|A枪辅助电源检测
|
||||
PB10 78 DI Aux_Pbdet|B枪辅助电源检测
|
||||
*/
|
||||
/* configure pin as input */
|
||||
gpio_mode_set(GPIOC, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_0);
|
||||
gpio_mode_set(GPIOB, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_0);
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_14);
|
||||
gpio_mode_set(GPIOB, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_1);
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_15);
|
||||
gpio_mode_set(GPIOB, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_2);
|
||||
gpio_mode_set(GPIOG, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_0);
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_11);
|
||||
gpio_mode_set(GPIOE, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_11);
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_12);
|
||||
gpio_mode_set(GPIOE, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_15);
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_13);
|
||||
gpio_mode_set(GPIOG, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_1);
|
||||
gpio_mode_set(GPIOB, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_10);
|
||||
|
||||
|
||||
/* 连接确认开关量输入检测
|
||||
PF10 30 DI CHECKOUTA1|A枪链接确认开关量输入检测
|
||||
PF9 29 DI CHECKOUTA2|A枪链接确认开关量输入检测
|
||||
PD3 146 DI CHECKOUTB1|B枪链接确认开关量输入检测
|
||||
PA15 139 DI CHECKOUTB2|B枪链接确认开关量输入检测
|
||||
*/
|
||||
/* configure pin as input */
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_9 | GPIO_PIN_10);
|
||||
gpio_mode_set(GPIOD, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_3);
|
||||
gpio_mode_set(GPIOA, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_15);
|
||||
}
|
||||
//温度采集通道选择控制
|
||||
void v_temp_config(void)
|
||||
{
|
||||
//开启GPIO时钟
|
||||
rcu_periph_clock_enable(RCU_GPIOD);
|
||||
rcu_periph_clock_enable(RCU_GPIOJ);
|
||||
|
||||
//数字地址“A”配置
|
||||
gpio_mode_set(GPIOD, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_10);
|
||||
//数字地址“B”配置
|
||||
gpio_mode_set(GPIOD, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_13);
|
||||
//数字地址“C”配置
|
||||
gpio_mode_set(GPIOJ, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_8);
|
||||
}
|
||||
void v_4g_config()
|
||||
{
|
||||
//开启GPIO时钟
|
||||
rcu_periph_clock_enable(RCU_GPIOF);
|
||||
rcu_periph_clock_enable(RCU_GPIOC);
|
||||
//4G模块RTS配置
|
||||
gpio_mode_set(GPIOF, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_3);
|
||||
//4G模块电源控制
|
||||
gpio_mode_set(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_13);
|
||||
}
|
||||
|
||||
+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