346 lines
38 KiB
HTML
346 lines
38 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html lang="zh-CN">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="UTF-8">
|
|||
|
|
<title>手环端软件功能与 UI 渲染开发计划书</title>
|
|||
|
|
<style>
|
|||
|
|
body {
|
|||
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|||
|
|
background-color: #0B0F19;
|
|||
|
|
color: #E2E8F0;
|
|||
|
|
margin: 0;
|
|||
|
|
padding: 40px 20px;
|
|||
|
|
line-height: 1.6;
|
|||
|
|
}
|
|||
|
|
.container {
|
|||
|
|
max-width: 1000px;
|
|||
|
|
margin: 0 auto;
|
|||
|
|
}
|
|||
|
|
h1 {
|
|||
|
|
font-size: 2.2rem;
|
|||
|
|
color: #00E5FF;
|
|||
|
|
text-align: center;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
letter-spacing: 1px;
|
|||
|
|
}
|
|||
|
|
.subtitle {
|
|||
|
|
text-align: center;
|
|||
|
|
color: #94A3B8;
|
|||
|
|
font-size: 1.1rem;
|
|||
|
|
margin-bottom: 40px;
|
|||
|
|
}
|
|||
|
|
.section-title {
|
|||
|
|
font-size: 1.5rem;
|
|||
|
|
color: #FFB74D;
|
|||
|
|
border-bottom: 2px solid #334155;
|
|||
|
|
padding-bottom: 8px;
|
|||
|
|
margin-top: 50px;
|
|||
|
|
margin-bottom: 24px;
|
|||
|
|
}
|
|||
|
|
.card {
|
|||
|
|
background-color: #1E293B;
|
|||
|
|
border-radius: 12px;
|
|||
|
|
padding: 24px;
|
|||
|
|
margin-bottom: 30px;
|
|||
|
|
border: 1px solid #334155;
|
|||
|
|
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
|
|||
|
|
}
|
|||
|
|
table {
|
|||
|
|
width: 100%;
|
|||
|
|
border-collapse: collapse;
|
|||
|
|
font-size: 0.95rem;
|
|||
|
|
margin-top: 10px;
|
|||
|
|
}
|
|||
|
|
th, td {
|
|||
|
|
text-align: left;
|
|||
|
|
padding: 10px 14px;
|
|||
|
|
border-bottom: 1px solid #334155;
|
|||
|
|
}
|
|||
|
|
th {
|
|||
|
|
color: #94A3B8;
|
|||
|
|
font-weight: bold;
|
|||
|
|
background-color: #0F172A;
|
|||
|
|
}
|
|||
|
|
td {
|
|||
|
|
color: #E2E8F0;
|
|||
|
|
}
|
|||
|
|
.badge {
|
|||
|
|
display: inline-block;
|
|||
|
|
padding: 2px 8px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
font-size: 0.8rem;
|
|||
|
|
font-weight: bold;
|
|||
|
|
}
|
|||
|
|
.badge-red { background-color: #7f1d1d; color: #fca5a5; }
|
|||
|
|
.badge-green { background-color: #064e3b; color: #6ee7b7; }
|
|||
|
|
.badge-blue { background-color: #1e3a8a; color: #93c5fd; }
|
|||
|
|
.badge-orange { background-color: #7c2d12; color: #ffedd5; }
|
|||
|
|
|
|||
|
|
.alert {
|
|||
|
|
border-left: 4px solid #00E5FF;
|
|||
|
|
background-color: #0F172A;
|
|||
|
|
padding: 16px 20px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
margin-bottom: 25px;
|
|||
|
|
}
|
|||
|
|
.alert-title {
|
|||
|
|
font-weight: bold;
|
|||
|
|
color: #FFFFFF;
|
|||
|
|
margin-bottom: 8px;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 8px;
|
|||
|
|
}
|
|||
|
|
.alert-title span {
|
|||
|
|
color: #00E5FF;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.task-list {
|
|||
|
|
list-style: none;
|
|||
|
|
padding: 0;
|
|||
|
|
}
|
|||
|
|
.task-item {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: flex-start;
|
|||
|
|
gap: 12px;
|
|||
|
|
margin-bottom: 14px;
|
|||
|
|
font-size: 1rem;
|
|||
|
|
}
|
|||
|
|
.task-checkbox {
|
|||
|
|
margin-top: 5px;
|
|||
|
|
width: 16px;
|
|||
|
|
height: 16px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|
|||
|
|
.task-text {
|
|||
|
|
flex: 1;
|
|||
|
|
}
|
|||
|
|
.task-text b {
|
|||
|
|
color: #FFFFFF;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@keyframes flash {
|
|||
|
|
0%, 100% { opacity: 1; }
|
|||
|
|
50% { opacity: 0.4; }
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<div class="container">
|
|||
|
|
<h1>手环端开发计划书 (V1.1)</h1>
|
|||
|
|
<div class="subtitle">STC32G12K128 核心手环系统开发及 UI 渲染方案说明</div>
|
|||
|
|
|
|||
|
|
<!-- System Architecture Block -->
|
|||
|
|
<div class="card" style="background-color: #0D111A; border: 1px solid #1E293B;">
|
|||
|
|
<div style="font-size: 1.2rem; font-weight: bold; color: #FFB74D; text-align: center; margin-bottom: 15px;">手环系统硬件接口与数据流拓扑图</div>
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 360" width="100%" height="auto">
|
|||
|
|
<defs>
|
|||
|
|
<filter id="boxShadow" x="-5%" y="-5%" width="110%" height="110%">
|
|||
|
|
<feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#000000" flood-opacity="0.4"/>
|
|||
|
|
</filter>
|
|||
|
|
<marker id="arrow" viewBox="0 0 10 10" refX="6" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|||
|
|
<path d="M 0 1.5 L 8 5 L 0 8.5 z" fill="#64748B"/>
|
|||
|
|
</marker>
|
|||
|
|
</defs>
|
|||
|
|
|
|||
|
|
<rect width="800" height="360" rx="8" fill="#0D111A"/>
|
|||
|
|
|
|||
|
|
<!-- Left: Inputs -->
|
|||
|
|
<g transform="translate(40, 40)" filter="url(#boxShadow)">
|
|||
|
|
<rect width="180" height="280" rx="8" fill="#1E293B" stroke="#334155" stroke-width="1"/>
|
|||
|
|
<text x="90" y="24" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="12" font-weight="bold" text-anchor="middle">INPUTS / 探测与按键</text>
|
|||
|
|
|
|||
|
|
<!-- Keys Sub-box -->
|
|||
|
|
<rect x="15" y="45" width="150" height="90" rx="6" fill="#0F172A" stroke="#00E5FF" stroke-width="1"/>
|
|||
|
|
<text x="90" y="65" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" font-weight="bold" text-anchor="middle">按键输入 (▲ / ▼ / SOS)</text>
|
|||
|
|
<text x="25" y="90" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P0.1: KEY_UP (▲)</text>
|
|||
|
|
<text x="25" y="108" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P0.3: KEY_DOWN (▼)</text>
|
|||
|
|
<text x="25" y="124" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P0.2: KEY_SOS</text>
|
|||
|
|
|
|||
|
|
<!-- RF Rx Sub-box -->
|
|||
|
|
<rect x="15" y="160" width="150" height="90" rx="6" fill="#0F172A" stroke="#FF9800" stroke-width="1"/>
|
|||
|
|
<text x="90" y="180" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" font-weight="bold" text-anchor="middle">LR690L 433MHz 接收</text>
|
|||
|
|
<text x="25" y="205" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P2.1: RF_RX_DATA</text>
|
|||
|
|
<text x="25" y="222" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P2.2: SHUT (低使能)</text>
|
|||
|
|
<text x="25" y="239" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P3.7: RF_RX 开关</text>
|
|||
|
|
</g>
|
|||
|
|
|
|||
|
|
<!-- Middle: Processing (MCU Core) -->
|
|||
|
|
<g transform="translate(310, 40)" filter="url(#boxShadow)">
|
|||
|
|
<rect width="180" height="280" rx="8" fill="#1E293B" stroke="#00E5FF" stroke-width="2"/>
|
|||
|
|
<text x="90" y="24" fill="#00E5FF" font-family="system-ui, sans-serif" font-size="12" font-weight="bold" text-anchor="middle">MCU / 核心业务逻辑</text>
|
|||
|
|
|
|||
|
|
<!-- State Machine -->
|
|||
|
|
<rect x="15" y="45" width="150" height="90" rx="6" fill="#0F172A" stroke="#334155" stroke-width="1"/>
|
|||
|
|
<text x="90" y="65" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" font-weight="bold" text-anchor="middle">主程序状态机</text>
|
|||
|
|
<text x="25" y="90" fill="#00E5FF" font-family="system-ui, sans-serif" font-size="9">● STATE_IDLE (时钟待机)</text>
|
|||
|
|
<text x="25" y="105" fill="#FFB74D" font-family="system-ui, sans-serif" font-size="9">● STATE_PAIR (对码配对)</text>
|
|||
|
|
<text x="25" y="120" fill="#FF1744" font-family="system-ui, sans-serif" font-size="9">● STATE_ALARM (告警响应)</text>
|
|||
|
|
|
|||
|
|
<!-- Timers & Storage -->
|
|||
|
|
<rect x="15" y="160" width="150" height="90" rx="6" fill="#0F172A" stroke="#334155" stroke-width="1"/>
|
|||
|
|
<text x="90" y="180" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" font-weight="bold" text-anchor="middle">时间片调度与存储</text>
|
|||
|
|
<text x="25" y="205" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">Timer 1: 1ms 按键消抖</text>
|
|||
|
|
<text x="25" y="222" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">PWM LED / 马达振动定时</text>
|
|||
|
|
<text x="25" y="239" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">IAP Flash: 保存 16组对码</text>
|
|||
|
|
</g>
|
|||
|
|
|
|||
|
|
<!-- Right: Outputs -->
|
|||
|
|
<g transform="translate(580, 40)" filter="url(#boxShadow)">
|
|||
|
|
<rect width="180" height="280" rx="8" fill="#1E293B" stroke="#334155" stroke-width="1"/>
|
|||
|
|
<text x="90" y="24" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="12" font-weight="bold" text-anchor="middle">OUTPUTS / 交互显示</text>
|
|||
|
|
|
|||
|
|
<!-- Screen -->
|
|||
|
|
<rect x="15" y="45" width="150" height="90" rx="6" fill="#0F172A" stroke="#00E5FF" stroke-width="1"/>
|
|||
|
|
<text x="90" y="65" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" font-weight="bold" text-anchor="middle">OLED 局部刷新渲染</text>
|
|||
|
|
<text x="25" y="90" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">RM69310 (CS/RST/DCX/SPI)</text>
|
|||
|
|
<text x="25" y="108" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">ASCII 8x16 英文</text>
|
|||
|
|
<text x="25" y="124" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">256字节 汉字点阵写屏</text>
|
|||
|
|
|
|||
|
|
<!-- Indicators -->
|
|||
|
|
<rect x="15" y="160" width="150" height="90" rx="6" fill="#0F172A" stroke="#FF1744" stroke-width="1"/>
|
|||
|
|
<text x="90" y="180" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" font-weight="bold" text-anchor="middle">物理声光警报输出</text>
|
|||
|
|
<text x="25" y="205" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">RGB LED (共阳极 P0.0/P2.7/P2.6)</text>
|
|||
|
|
<text x="25" y="222" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">PWM 呼吸灯控制</text>
|
|||
|
|
<text x="25" y="239" fill="#94A3B8" font-family="system-ui, sans-serif" font-size="10">P2.5: 马达振动警报</text>
|
|||
|
|
</g>
|
|||
|
|
|
|||
|
|
<!-- Connectors -->
|
|||
|
|
<path d="M 220 100 L 310 100" stroke="#64748B" stroke-width="2" fill="none" marker-end="url(#arrow)"/>
|
|||
|
|
<path d="M 220 210 L 310 210" stroke="#64748B" stroke-width="2" fill="none" marker-end="url(#arrow)"/>
|
|||
|
|
<path d="M 490 100 L 580 100" stroke="#64748B" stroke-width="2" fill="none" marker-end="url(#arrow)"/>
|
|||
|
|
<path d="M 490 210 L 580 210" stroke="#64748B" stroke-width="2" fill="none" marker-end="url(#arrow)"/>
|
|||
|
|
</svg>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Code Flowchart -->
|
|||
|
|
<div class="section-title">📊 代码逻辑运行流程图</div>
|
|||
|
|
<div class="card" style="background-color: #0D111A; border: 1px solid #1E293B;">
|
|||
|
|
<div style="font-size: 1.2rem; font-weight: bold; color: #00E5FF; text-align: center; margin-bottom: 15px;">主循环与 Timer1 中断、RF 双模解码流程</div>
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 680" width="100%" height="auto"> <defs> <filter id="shadow" x="-5%" y="-5%" width="110%" height="110%"> <feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#000000" flood-opacity="0.4"/> </filter> <marker id="arrow" viewBox="0 0 10 10" refX="6" refY="5" markerWidth="5" markerHeight="5" orient="auto-start-reverse"> <path d="M 0 1.5 L 8 5 L 0 8.5 z" fill="#64748B"/> </marker> </defs> <rect width="800" height="680" rx="8" fill="#0D111A"/> <!-- Main Loop Column (Left) --> <g transform="translate(40, 20)"> <text x="120" y="25" fill="#00E5FF" font-family="system-ui, sans-serif" font-size="14" font-weight="bold" text-anchor="middle">主程序运行流程 main()</text> <!-- Step 1: Init --> <rect x="20" y="45" width="200" height="40" rx="4" fill="#1E293B" stroke="#00E5FF" stroke-width="1.5" filter="url(#shadow)"/> <text x="120" y="69" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">系统初始化 (时钟/GPIO/Timer1/OLED)</text> <!-- Step 2: Read EEPROM --> <rect x="20" y="115" width="200" height="40" rx="4" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="139" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">读取 IAP/EEPROM 传感器对码表</text> <!-- Step 3: Idle state --> <rect x="20" y="185" width="200" height="40" rx="4" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="209" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">进入 STATE_NORMAL 并开启接收管</text> <!-- Loop Start Junction --> <circle cx="120" cy="260" r="8" fill="#FFB74D"/> <text x="120" y="280" fill="#FFB74D" font-family="system-ui, sans-serif" font-size="9" text-anchor="middle">while(1) 轮询</text> <!-- Check 1: Button --> <polygon points="120,300 220,325 120,350 20,325" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="329" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">有按键事件触发?</text> <!-- Handle Button --> <rect x="20" y="380" width="200" height="40" rx="4" fill="#0F172A" stroke="#00E5FF" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="404" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">处理按键 (状态切换/对码/SOS)</text> <!-- Check 2: RF Data --> <polygon points="120,450 220,475 120,500 20,475" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="479" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">有RF信号输入?</text> <!-- Handle RF --> <rect x="20" y="530" width="200" height="40" rx="4" fill="#0F172A" stroke="#FF9800" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="554" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">解析协议 (报警触发 / 主机广播)</text> <!-- Update UI --> <rect x="20" y="600" width="200" height="40" rx="4" fill="#1E293B" stroke="#00E5FF" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="624" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">执行 OLED 局部增量刷新渲染</text> <!-- Connections Left Column --> <path d="M 120 85 L 120 115" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 155 L 120 185" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 225 L 120 252" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 268 L 120 300" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 350 L 120 380" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arro
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Code Flowchart -->
|
|||
|
|
<div class="section-title">📊 代码逻辑运行流程图</div>
|
|||
|
|
<div class="card" style="background-color: #0D111A; border: 1px solid #1E293B;">
|
|||
|
|
<div style="font-size: 1.2rem; font-weight: bold; color: #00E5FF; text-align: center; margin-bottom: 15px;">主循环与 Timer1 中断、RF 双模解码流程</div>
|
|||
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 680" width="100%" height="auto"> <defs> <filter id="shadow" x="-5%" y="-5%" width="110%" height="110%"> <feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#000000" flood-opacity="0.4"/> </filter> <marker id="arrow" viewBox="0 0 10 10" refX="6" refY="5" markerWidth="5" markerHeight="5" orient="auto-start-reverse"> <path d="M 0 1.5 L 8 5 L 0 8.5 z" fill="#64748B"/> </marker> </defs> <rect width="800" height="680" rx="8" fill="#0D111A"/> <!-- Main Loop Column (Left) --> <g transform="translate(40, 20)"> <text x="120" y="25" fill="#00E5FF" font-family="system-ui, sans-serif" font-size="14" font-weight="bold" text-anchor="middle">主程序运行流程 main()</text> <!-- Step 1: Init --> <rect x="20" y="45" width="200" height="40" rx="4" fill="#1E293B" stroke="#00E5FF" stroke-width="1.5" filter="url(#shadow)"/> <text x="120" y="69" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">系统初始化 (时钟/GPIO/Timer1/OLED)</text> <!-- Step 2: Read EEPROM --> <rect x="20" y="115" width="200" height="40" rx="4" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="139" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">读取 IAP/EEPROM 传感器对码表</text> <!-- Step 3: Idle state --> <rect x="20" y="185" width="200" height="40" rx="4" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="209" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">进入 STATE_NORMAL 并开启接收管</text> <!-- Loop Start Junction --> <circle cx="120" cy="260" r="8" fill="#FFB74D"/> <text x="120" y="280" fill="#FFB74D" font-family="system-ui, sans-serif" font-size="9" text-anchor="middle">while(1) 轮询</text> <!-- Check 1: Button --> <polygon points="120,300 220,325 120,350 20,325" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="329" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">有按键事件触发?</text> <!-- Handle Button --> <rect x="20" y="380" width="200" height="40" rx="4" fill="#0F172A" stroke="#00E5FF" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="404" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">处理按键 (状态切换/对码/SOS)</text> <!-- Check 2: RF Data --> <polygon points="120,450 220,475 120,500 20,475" fill="#1E293B" stroke="#334155" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="479" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">有RF信号输入?</text> <!-- Handle RF --> <rect x="20" y="530" width="200" height="40" rx="4" fill="#0F172A" stroke="#FF9800" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="554" fill="#E2E8F0" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle">解析协议 (报警触发 / 主机广播)</text> <!-- Update UI --> <rect x="20" y="600" width="200" height="40" rx="4" fill="#1E293B" stroke="#00E5FF" stroke-width="1" filter="url(#shadow)"/> <text x="120" y="624" fill="#FFFFFF" font-family="system-ui, sans-serif" font-size="11" text-anchor="middle">执行 OLED 局部增量刷新渲染</text> <!-- Connections Left Column --> <path d="M 120 85 L 120 115" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 155 L 120 185" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 225 L 120 252" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 268 L 120 300" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/> <path d="M 120 350 L 120 380" stroke="#64748B" stroke-width="1.5" fill="none" marker-end="url(#arro
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Section 1 -->
|
|||
|
|
<div class="section-title">一、 硬件引脚映射与电气特性</div>
|
|||
|
|
<div class="card">
|
|||
|
|
<table>
|
|||
|
|
<thead>
|
|||
|
|
<tr>
|
|||
|
|
<th>硬件功能分类</th>
|
|||
|
|
<th>端口别名</th>
|
|||
|
|
<th>STC32G 引脚</th>
|
|||
|
|
<th>驱动电气逻辑说明</th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>🔴 三色指示灯 (红)</b></td>
|
|||
|
|
<td><code>LED_R</code></td>
|
|||
|
|
<td>P0.0</td>
|
|||
|
|
<td>共阳极,输出 <b>0</b> 点亮,输出 1 关闭。</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>🟢 三色指示灯 (绿)</b></td>
|
|||
|
|
<td><code>LED_G</code></td>
|
|||
|
|
<td>P2.7</td>
|
|||
|
|
<td>共阳极,输出 <b>0</b> 点亮,输出 1 关闭。</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>🔵 三色指示灯 (蓝)</b></td>
|
|||
|
|
<td><code>LED_B</code></td>
|
|||
|
|
<td>P2.6</td>
|
|||
|
|
<td>共阳极,输出 <b>0</b> 点亮,输出 1 关闭。</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>📳 振动驱动马达</b></td>
|
|||
|
|
<td><code>MOTOR</code></td>
|
|||
|
|
<td>P2.5</td>
|
|||
|
|
<td>直流控制,输出 <b>1</b> 开启马达,输出 0 停止。</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>▲ 方向按键 (上)</b></td>
|
|||
|
|
<td><code>KEY_UP</code></td>
|
|||
|
|
<td>P0.1</td>
|
|||
|
|
<td>按下为 <b>0</b>,带内部上拉输入。</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>▼ 方向按键 (下)</b></td>
|
|||
|
|
<td><code>KEY_DOWN</code></td>
|
|||
|
|
<td>P0.3</td>
|
|||
|
|
<td>按下为 <b>0</b>,带内部上拉输入。</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td><b>🆘 紧急/对码按键</b></td>
|
|||
|
|
<td><code>KEY_SOS</code></td>
|
|||
|
|
<td>P0.2</td>
|
|||
|
|
<td>按下为 <b>0</b>,带内部上拉输入。</td>
|
|||
|
|
</tr>
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Section 2 -->
|
|||
|
|
<div class="section-title">二、 核心设计决策 (Design Decisions)</div>
|
|||
|
|
|
|||
|
|
<div class="alert" style="border-left-color: #00E5FF;">
|
|||
|
|
<div class="alert-title"><span>💡</span> 决策 1:安防常用汉字精简本地字库法 (优化首选方案 C)</div>
|
|||
|
|
<div class="alert-body">
|
|||
|
|
由于手环 Flash(128KB)存不下全套字库(216KB),我们采用<b>“常用安防汉字精简字库法”</b>:手环本地代码空间固化约 200 个高频汉字(如:客厅、厨房、前门、阳台等,仅需 6.4KB 空间)。对码命名时,IPC 仅需通过射频向手环发送 <b>16 字节的汉字 GBK/Unicode 编码</b>即可,不需要发 256 字节点阵。手环在本地字库查表后显示。该方案使 433MHz 射频包<b>缩减了 16 倍,极大提高了传输成功率和防干扰能力</b>。如果出现极个别不在常用列表中的汉字,手环将显示 fallback 符号(如“□”)。
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="alert" style="border-left-color: #FF9800;">
|
|||
|
|
<div class="alert-title"><span>📡</span> 决策 2:433MHz 射频双模解码器</div>
|
|||
|
|
<div class="alert-body">
|
|||
|
|
手环的接收部分需要同时兼容<b>普通遥控器报警数据</b>(标准 24 位 EV1527 协议)和<b>自研的 IPC 状态/名字同步数据</b>(含 CRC8 校验的自定义射频协议)。我们将通过对 LR690L 输出的脉冲宽度进行动态测量与匹配,实现一套软件高效率的非阻塞双模解码器。
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Section 3 -->
|
|||
|
|
<div class="section-title">三、 UI 渲染引擎细节与坐标规划</div>
|
|||
|
|
<div class="card">
|
|||
|
|
<h3 style="color: #FFFFFF; margin-top: 0;">1. 直流流式送数驱动 (`LCD_DrawMonoBitmap`)</h3>
|
|||
|
|
<p>基于硬件 SPI 接口,在写图前设置矩形窗口 <code>(x, y) -> (x+w-1, y+h-1)</code>,然后从 Flash 字模中逐 Bit 扫描:如果是 1 则流式送入前景色,0 则送入背景色。此方案**零显存开销**,完全避开了单片机 RAM 资源瓶颈,且写屏速度极快。</p>
|
|||
|
|
|
|||
|
|
<h3 style="color: #FFFFFF;">2. 圆形视口安全区域划分</h3>
|
|||
|
|
<p>由于屏幕物理切边,有效显示区收拢在 <b>X 坐标 [10, 110],Y 坐标 [30, 210]</b> 的安全圆形范围内:</p>
|
|||
|
|
<ul>
|
|||
|
|
<li><b>时钟待机页</b>:状态栏 🔒 设在 $Y=20$。大时钟 <code>10:35</code>(80px宽,32px高)设在 $X=20, Y=90$ 居中。日期设在 $X=20, Y=140$。</li>
|
|||
|
|
<li><b>配对菜单页</b>:采用 3 行滚动布局,每行高 30px。选中行($Y=110$)画出 $100 imes 34$ 彩色粗边框,文字放大。</li>
|
|||
|
|
<li><b>告警响应页</b>:在 $X \in [10, 110], Y \in [40, 200]$ 绘制一圈闪烁虚线框(红白交替)。警报大图标(32x32)置于 $X=44, Y=70$,中文名字点阵(GBK查表)居中置于 $X=28, Y=130$。</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Section 4 -->
|
|||
|
|
<div class="section-title">四、 验证任务清单 (Task Checklist)</div>
|
|||
|
|
<div class="card" style="background-color: #0F172A;">
|
|||
|
|
<ul class="task-list">
|
|||
|
|
<li class="task-item">
|
|||
|
|
<input type="checkbox" class="task-checkbox" id="task1">
|
|||
|
|
<label for="task1" class="task-text"><b>1. 自动编译测试</b>:使用 Keil C251 脚本编译项目,确保生成 <code>sample.hex</code> 成功且 0 错误。</label>
|
|||
|
|
</li>
|
|||
|
|
<li class="task-item">
|
|||
|
|
<input type="checkbox" class="task-checkbox" id="task2">
|
|||
|
|
<label for="task2" class="task-text"><b>2. 待机时钟与菜单测试</b>:确认待机时间显示正确,▲+▼ 同时按 3 秒进入配对列表,▲/▼ 能在 7 个图标间顺滑切换。</label>
|
|||
|
|
</li>
|
|||
|
|
<li class="task-item">
|
|||
|
|
<input type="checkbox" class="task-checkbox" id="task3">
|
|||
|
|
<label for="task3" class="task-text"><b>3. LED与马达报警测试</b>:分别用报警信号触发 A~G 共 7 类警报,确认对应的 RGB 颜色和马达脉冲模式输出精确。</label>
|
|||
|
|
</li>
|
|||
|
|
<li class="task-item">
|
|||
|
|
<input type="checkbox" class="task-checkbox" id="task4">
|
|||
|
|
<label for="task4" class="task-text"><b>4. GBK字库查表与名称写入测试</b>:模拟发射 16 字节的 GBK 编码数据包,验证手环从本地字库成功还原绘制出自定义名字。</label>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|