Update binary files in 3D directory: modified SLDASM and SLDPRT files

This commit is contained in:
2026-04-14 16:43:47 +08:00
parent e46b5559d2
commit fb9e67a955
7 changed files with 1058 additions and 0 deletions

49
Core/Bsp/bsp_track_ir.h Normal file
View File

@@ -0,0 +1,49 @@
#ifndef __BSP_TRACK_IR_H
#define __BSP_TRACK_IR_H
#include "main.h"
/*
* 红外循迹 4 路状态位定义bit=1 表示检测到黑线)
* bit0 -> H1, bit1 -> H2, bit2 -> H3, bit3 -> H4
*/
#define TRACK_IR_H1_BIT (1U << 0)
#define TRACK_IR_H2_BIT (1U << 1)
#define TRACK_IR_H3_BIT (1U << 2)
#define TRACK_IR_H4_BIT (1U << 3)
/*
* 红外模块有效电平:常见 TCRT5000 模块为低电平有效。
* 若你的模块是高电平有效,可在编译选项或此处改为 GPIO_PIN_SET。
*/
#ifndef TRACK_IR_ACTIVE_LEVEL
#define TRACK_IR_ACTIVE_LEVEL GPIO_PIN_RESET
#endif
/**
* @brief 基础循迹判定结果
*/
typedef enum {
TRACK_IR_STATE_LOST = 0, // 全灭,丢线
TRACK_IR_STATE_LEFT, // 线偏左
TRACK_IR_STATE_CENTER, // 居中
TRACK_IR_STATE_RIGHT, // 线偏右
TRACK_IR_STATE_CROSS // 十字/大面积黑线
} track_ir_state_t;
/* 初始化接口当前仅预留GPIO 配置由 CubeMX 负责) */
void track_ir_init(void);
/* 读取原始电平状态bit=1 表示 GPIO 为高电平) */
uint8_t track_ir_get_raw_mask(void);
/* 读取线状态掩码bit=1 表示对应通道检测到黑线) */
uint8_t track_ir_get_line_mask(void);
/* 最基础方向判定:丢线 / 左偏 / 居中 / 右偏 / 十字 */
track_ir_state_t track_ir_basic_judge(void);
/* 便于日志输出的状态字符串 */
const char *track_ir_state_to_string(track_ir_state_t state);
#endif /* __BSP_TRACK_IR_H */