add calendar mode for html

This commit is contained in:
Shuanglei Tao
2025-02-05 23:32:57 +08:00
parent 705d131f36
commit 77f7aae4e8
3 changed files with 50 additions and 17 deletions

View File

@@ -36,7 +36,7 @@
<div class="main">
<h3>4.2 寸电子墨水屏蓝牙控制器nRF51</h3>
<fieldset>
<legend>蓝牙</legend>
<legend>蓝牙连接</legend>
<div style="display: flex; justify-content: space-between;">
<div>
<button id="connectbutton" type="button" class="primary" onclick="preConnect()">连接</button>
@@ -57,16 +57,19 @@
</fieldset>
<fieldset>
<legend>传图</legend>
<legend>屏幕控制</legend>
<div style="margin-bottom: 10px; display: flex; justify-content: space-between;">
<div>
<button id="clearcanvasbutton" type="button" class="secondary" onclick="clear_canvas()">清除画布</button>
<button id="sendimgbutton" type="button" class="primary" onclick="sendimg()">发送图片</button>
<label for="interleavedcount" style="margin-left: 20px;">确认间隔</label>
<input type="number" id="interleavedcount" value="50">
<input type="number" id="interleavedcount" value="50" min="0" max="500">
</div>
<div>
<button id="clearscreenbutton" type="button" class="secondary" onclick="clearscreen()">清除屏幕</button>
<button id="synctimebutton" type="button" class="primary" onclick="syncTime()">日历模式</button>
</div>
<div>
<button id="clearscreenbutton" type="button" class="secondary" onclick="clearScreen()">清除屏幕</button>
<input type="text" id="cmdTXT" value="">
<button id="sendcmdbutton" type="button" class="primary" onclick="sendcmd()">发送命令</button>
</div>
@@ -110,6 +113,7 @@
<li><b>驱动选择:</b>黑白屏可尝试 EPD_4in2 / EPD_4in2_V2, 三色屏选择 EPD_4in2b_V2 (选错驱动可能会导致任何未知的异常,重启即可恢复)</li>
<li><b>引脚配置:</b>格式为十六进制顺序MOSI/SCLK/CS/DC/ST/BUSY/BS必须按此顺序包含完整的 7 个引脚配置(没有用到的引脚可配置为 <code>FF</code></li>
<li><b>确认间隔: </b>这个间隔指的是数据包数量间隔,即发送此数量的不确认响应的数据包后才发送一次需确认响应的数据包。加大此值可优化传图速度,但是丢包风险也更大(你可能会发现图片有部分位置显示不正常,此时需调小这个值)。
<li><b>日历模式: </b>点击“日历模式”按钮将自动从浏览器同步时间到墨水屏,并切换到日历显示。</li>
<li>
<b>指令列表(指令和参数全部要使用十六进制):</b>
<ul>
@@ -124,6 +128,10 @@
<li><code>06</code>: 屏幕睡眠</li>
</ul>
</li>
<li>日历模式:
<ul>
<li><code>20</code>+<code>UNIX 时间戳</code>: 同步时间并开启日历模式</li>
</ul>
<li>系统相关:
<ul>
<li><code>90</code>+<code>配置</code>: 写入配置信息(重启生效,格式参考源码 <code>epd_config_t</code></li>