refactor: 对齐 DLD154V4B 规格和 M1H 参考
- 灵敏度表改为 M1H 值: {216,108,36,10} / {108,72,18,9}
- 时序参数对齐: OUT_DELAY 39→38, PULSE_DELAY 10→19
- LED 宏命名对齐 154V4B: LEDA=红(PB1), LEDB=绿(PA9), LEDC=黄(PA10)
- RLY1/RLY2 引脚交换: PA6=RLY1, PA5=RLY2
This commit is contained in:
@@ -83,7 +83,7 @@ typedef enum
|
||||
#define LED_RED_GPIO GPIOB
|
||||
#define LED_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
|
||||
|
||||
#define LED_GREEN_PIN GPIO_PINS_9 // GPIO_PINS_13 //GPIO_PINS_9
|
||||
#define LED_GREEN_PIN GPIO_PINS_9
|
||||
#define LED_GREEN_GPIO GPIOA
|
||||
#define LED_GREEN_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
@@ -91,17 +91,26 @@ typedef enum
|
||||
#define LED_YELLOW_GPIO GPIOA
|
||||
#define LED_YELLOW_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
#define LEDB_OFF // gpio_bits_set(LED_RED_GPIO, LED_RED_PIN)
|
||||
#define LEDB_ON // gpio_bits_reset(LED_RED_GPIO, LED_RED_PIN)
|
||||
// LED 命名对齐 DLD154V4B 规格:
|
||||
// LEDA = 红色呼吸灯 (PB1, TMR14 PWM)
|
||||
// LEDB = 绿色有车指示灯 (PA9)
|
||||
// LEDC = 黄色故障指示灯 (PA10)
|
||||
// 注意: DEBUG 模式下 PA9 复用为 UART TX,LEDB 宏为空
|
||||
|
||||
// LEDA — 红色 (PB1),GPIO 直接控制(初始化闪烁用,正常运行时 PWM)
|
||||
#define LEDA_OFF gpio_bits_set(LED_RED_GPIO, LED_RED_PIN)
|
||||
#define LEDA_ON gpio_bits_reset(LED_RED_GPIO, LED_RED_PIN)
|
||||
|
||||
// LEDB — 绿色 (PA9),有车亮
|
||||
#ifdef DEBUG
|
||||
#define LEDA_OFF
|
||||
#define LEDA_ON
|
||||
#define LEDB_OFF
|
||||
#define LEDB_ON
|
||||
#else
|
||||
#define LEDA_OFF gpio_bits_set(LED_GREEN_GPIO, LED_GREEN_PIN)
|
||||
#define LEDA_ON gpio_bits_reset(LED_GREEN_GPIO, LED_GREEN_PIN)
|
||||
#define LEDB_OFF gpio_bits_set(LED_GREEN_GPIO, LED_GREEN_PIN)
|
||||
#define LEDB_ON gpio_bits_reset(LED_GREEN_GPIO, LED_GREEN_PIN)
|
||||
#endif
|
||||
|
||||
// LEDC — 黄色 (PA10),故障指示
|
||||
#define LEDC_OFF gpio_bits_set(LED_YELLOW_GPIO, LED_YELLOW_PIN)
|
||||
#define LEDC_ON gpio_bits_reset(LED_YELLOW_GPIO, LED_YELLOW_PIN)
|
||||
|
||||
@@ -110,24 +119,15 @@ typedef enum
|
||||
|
||||
|
||||
|
||||
// RLY
|
||||
//#define RLY1_PIN GPIO_PINS_6
|
||||
//#define RLY1_GPIO GPIOA
|
||||
//#define RLY1_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
//#define RLY2_PIN GPIO_PINS_5
|
||||
//#define RLY2_GPIO GPIOA
|
||||
//#define RLY2_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
//功能继电器
|
||||
#define RLY1_PIN GPIO_PINS_5
|
||||
// RLY1 — 主输出 (PA6),存在/脉冲
|
||||
#define RLY1_PIN GPIO_PINS_6
|
||||
#define RLY1_GPIO GPIOA
|
||||
#define RLY1_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
// 固定继电器 存在继电器
|
||||
#define RLY2_PIN GPIO_PINS_6
|
||||
// RLY2 — 辅助输出 (PA5),方向/第二路
|
||||
#define RLY2_PIN GPIO_PINS_5
|
||||
#define RLY2_GPIO GPIOA
|
||||
#define RLY2_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
#define RLY2_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
#define RLY1_ON gpio_bits_set(RLY1_GPIO, RLY1_PIN)
|
||||
#define RLY1_OFF gpio_bits_reset(RLY1_GPIO, RLY1_PIN)
|
||||
@@ -155,23 +155,23 @@ typedef enum
|
||||
#define USER_BUTTON_PORT GPIOA
|
||||
#define USER_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
// 灵敏度L
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>L
|
||||
#define SW1_BUTTON_PIN GPIO_PINS_0
|
||||
#define SW1_BUTTON_PORT GPIOA
|
||||
#define SW1_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
// 灵敏度H
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>H
|
||||
#define SW2_BUTTON_PIN GPIO_PINS_1
|
||||
#define SW2_BUTTON_PORT GPIOA
|
||||
#define SW2_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
// 输出方式
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
||||
#define SW3_BUTTON_PIN GPIO_PINS_2
|
||||
#define SW3_BUTTON_PORT GPIOA
|
||||
#define SW3_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
// 延时
|
||||
// <EFBFBD><EFBFBD>ʱ
|
||||
#define SW4_BUTTON_PIN GPIO_PINS_3
|
||||
#define SW4_BUTTON_PORT GPIOA
|
||||
#define SW4_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
// 安全复位
|
||||
// <EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD>λ
|
||||
#define SW5_BUTTON_PIN GPIO_PINS_4
|
||||
#define SW5_BUTTON_PORT GPIOA
|
||||
#define SW5_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
|
||||
|
||||
Reference in New Issue
Block a user