梦溪开物 发表于 2022-5-9 23:02

【平头哥RVB2601创意应用开发】农田灭害虫装置的设计

本帖最后由 梦溪开物 于 2022-5-12 17:09 编辑

<p style="text-align:justify">&nbsp;</p>

<p align="center" style="text-align:center"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">农田灭害虫装置的设计</span></span></span></span></p>

<p align="center" style="text-align:center">&nbsp;</p>

<p align="right" style="text-align:right">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><b><span style="font-size:16.0pt"><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">一、项目背景</span></span></span></b></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">该项目为农田灭虫装置的设计。农田害虫影响作物的产量,很多害虫平常匍匐在作物的茎秆上,靠吸食汁液为生,对作物危害极大,其在夜间尤为活跃,具有一定的趋光性和趋声性(尤其在繁殖季节),可以利用该种特性,并结合RISC-V生态开发板RVB2601进行灭虫装置的研制。</span></span></span></span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify">&nbsp;</p>

<p align="center" style="text-align:center; text-indent:21.0pt"></p>

<p style="text-indent: 21pt; text-align: center;">&nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-family:宋体">稻田害虫的图片</span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><b><span style="font-size:16.0pt"><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">二、作品简介</span></span></span></b></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">通过RISC-V生态开发板研制一种专门捕捉并消灭农田害虫的装置,增加稻田作物的亩产量,减少农药的喷洒。该系统由主控模块(RISC-V生态开发板)、通信模块(4G通信协议)、电源模块(5V)、和倍压模块共四部分组成。作品图片如下所示:</span></span></span></span></span></span></span></p>

<p align="center" style="text-align:center; text-indent:24.0pt"> &nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-family:宋体">作品图片</span></span></span></p>

<p style="text-indent:21.1pt; text-align:justify">&nbsp;</p>

<p style="text-align:justify"><strong><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">三、系统框图</span></span></span></span></strong></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">RVB2601</span></span></span></span><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">内存中决策模型计算出农田害虫在夜间某一时刻最佳的趋光光色和频闪周期,并将该参数转化成电信号给驱动模块,驱动模块驱动RGB灯和喇叭开始工作,达到声光耦合的效果,从而对害虫进行引诱,功率模块通过高压放电将将引诱过来的农田害虫杀死,并将杀死的害虫释放到农田中,作为肥料使用。系统框图如下所示:</span></span></span></span></span></span></span></p>

<p style="text-indent:21.0pt; text-align:justify"> &nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="color:black">系统框图</span></span></span></span></span></p>

<p style="text-indent:21.1pt; text-align:justify">&nbsp;</p>

<p style="text-align:justify"><strong><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">四、各部分功能说明和解析</span></span></span></span></strong></p>

<p style="text-align:justify"><strong><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">4.1 </span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">主控模块</span></span></span></span></strong></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">主控模块是以CH340单片机为核心的RVB2601开发板,该开发板上有一个功放模块用于驱动喇叭,其上的电源电路能将5V电压转换成3.3V供MCU使用,将5V转换成12V供功放模块使用,所以只需要向其提供5V电压即可。</span></span></span></span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">该项目的全部软件程序都集中在在该主控模块上,包括驱动RGB变色与频闪的程序、喇叭的音频驱动程序和倍压电路间歇性工作的控制程序三部分,该项目程序在平头哥生态例程ch2601_player_demo和ch2601_rgb_marquee_demo进行再次开发。其中RGB变色和频闪程序主要通过led_refresh()程序来实现,通过PWM波实现变色控制和呼吸效果;喇叭的音频驱动程序主要由cli_reg_cmd_player()来实现,通过外部导入音频文件到内存进行循环播放;倍压电路间歇性工作通过GPIO控制MOS通断实现。主控模块的实物图如下所示:</span></span></span></span></span></span></span></p>

<p align="center" style="text-align:center"> &nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="color:black">主控模块实物图</span></span></span></span></span></p>

<p align="center" style="text-align:center">&nbsp;</p>

<p style="text-align:justify"><strong><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">4.2 </span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">光能转换电路</span></span></span></span></strong></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">光能转换电路将不稳定的太阳能稳压到3.7V给锂电池充电,以保证农田灭虫装置能够在野外长久稳定地运行。该电路在充电时,上面的红灯会亮。光能转换电路实物图如下所示:</span></span></span></span></span></span></span></p>

<p align="center" style="text-align:center"> &nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="color:black">光能转换电路实物图</span></span></span></span></span></p>

<p align="center" style="text-align:center">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">4.3 </span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">电源模块</span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">电源模块将3.7V转换成5V给RVB2601开发板供电。5V电源模块实物图如下所示:</span></span></span></span></span></span></span></p>

<p align="center" style="text-align:center"> &nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="color:black">5V</span></span></span><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="color:black">电源模块实物图</span></span></span></span></span></p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">4.4 </span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">倍压电路</span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">倍压电路将3.7V倍压到3000V高压并传递到电网上,用于消灭引诱过来的害虫。该模块会间歇性工作,主要是为了省点,当害虫聚集到一定程度后,CH340会通过GPIO口控制MOS管驱使倍压电路工作。该电路进行了两次升压方式,第一次是通过变压器升压到750V左右,第二次是通过二极管升压到3000V高压,变压器同时也起到了一个隔离的左右。倍压电路实物图如下所示:</span></span></span></span></span></span></span></p>

<p align="center" style="text-align:center"> &nbsp;</p>

<p align="center" style="margin-bottom:10px; text-align:center; text-indent:21.0pt"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="background:white"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="color:black">倍压电路实物图</span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">五、作品源码</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &lt;app_config.h&gt;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &lt;aos/aos.h&gt;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &lt;aos/cli.h&gt;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &lt;aos/kernel.h&gt;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &quot;app_main.h&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &quot;app_init.h&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &quot;board.h&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &quot;player_demo.h&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &quot;oled.h&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#include &quot;led.c&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#define TAG &quot;app&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">#define TAG &quot;player_demo&quot;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">extern void cxx_system_init(void);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">static player_t *g_player;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">static uint32_t g_ctr = 0;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">static csi_pwm_t&nbsp; r;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">static void _player_event(player_t *player, uint8_t type, const void *data, uint32_t len)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; int rc;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; UNUSED(len);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; UNUSED(data);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; UNUSED(handle);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; LOGD(TAG, &quot;=====%s, %d, type = %d&quot;, __FUNCTION__, __LINE__, type);</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; switch (type) {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; case PLAYER_EVENT_ERROR:</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rc = player_stop(player);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; case PLAYER_EVENT_START: {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; media_info_t minfo;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memset(&amp;minfo, 0, sizeof(media_info_t));</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rc = player_get_media_info(player, &amp;minfo);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOGD(TAG, &quot;=====rc = %d, duration = %llums, bps = %llu, size = %u&quot;, rc, minfo.duration, minfo.bps, minfo.size);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; case PLAYER_EVENT_FINISH:</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; player_stop(player);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; default:</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">static void cmd_ipc_func(char *wbuf, int wbuf_len, int argc, char **argv)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char url;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;snprintf(url, sizeof(url), &quot;mem://addr=%u&amp;size=%u&quot;, (uint32_t)&amp;_welcome_mp3, _welcome_mp3_len);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; player_play(get_player_demo(), url, 0);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">player_t *get_player_demo()</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; if (!g_player) {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ply_conf_t ply_cnf;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; player_conf_init(&amp;ply_cnf);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ply_cnf.vol_en&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ply_cnf.vol_index&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 128; // 0~255</span></span><span style="font-size:12.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">增益强度</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ply_cnf.event_cb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = _player_event;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ply_cnf.period_num&nbsp;&nbsp;&nbsp;&nbsp; =12;&nbsp; //</span></span><span style="font-size:12.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">播放时长</span></span><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"> 12 * 5 period_ms = 60ms</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_player = player_new(&amp;ply_cnf);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; return g_player;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">int cli_reg_cmd_player(void)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; char url;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; static const struct cli_command cmd_info = {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;player&quot;,</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;player example&quot;,</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmd_ipc_func,</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; };</span></span></span></span></p>

<p style="margin-left:80px; text-indent:-60.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp; snprintf(url,sizeof(url),&quot; mem://addr=%u&amp;size=%u&quot;, (uint32_t)&amp;_welcome_mp3, _welcome_mp3_len);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; player_play(get_player_demo(), url, 0);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; return 0;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">void led_pinmux_init()</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; csi_error_t ret;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; csi_pin_set_mux(PA7, PA7_PWM_CH7);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; csi_pin_set_mux(PA25, PA25_PWM_CH2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; csi_pin_set_mux(PA4, PA4_PWM_CH4);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csi_pwm_init(&amp;r, 0);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">void led_refresh()</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; if (g_ctr == 0)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(g_ctr&lt;300)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csi_pwm_out_config(&amp;r, 4/ 2, 600-g_ctr, g_ctr++, PWM_POLARITY_HIGH);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; csi_pwm_out_stop(&amp;r, 7 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; csi_pwm_out_stop(&amp;r, 2 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; csi_pwm_out_start(&amp;r, 4 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; udelay(1000 * 5);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; csi_pwm_out_stop(&amp;r, 4 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; udelay(1000 * 200);&nbsp; </span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (g_ctr==300)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(g_ctr&gt;0)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; csi_pwm_out_config(&amp;r, 4 / 2, 600-g_ctr, g_ctr--, PWM_POLARITY_HIGH);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csi_pwm_out_stop(&amp;r, 7 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csi_pwm_out_stop(&amp;r, 2 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csi_pwm_out_start(&amp;r, 4 / 2);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; udelay(1000 * 5);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">int main(void)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">{</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; cxx_system_init();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; board_yoc_init();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; oled_init();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; player_init();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; led_pinmux_init();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(1)</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; led_refresh();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cli_reg_cmd_player();</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; udelay(200 * 1000);</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">&nbsp;&nbsp;&nbsp; return 0;</span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif">}</span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><b><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">六、视频<span style="font-family:&quot;微软雅黑&quot;,sans-serif">演示</span></span></span></b></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">6.1 </span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">视频简介</span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">该项目的演示视频展示了系统整体工作情况以及各局部模块详细工作情况,视频从头至尾都有文字标注进行解释。首先,RVB2601单片机根据内部导入的虫鸣音频文件控制驱动模块驱动喇叭发声,同时驱动RGB灯间歇性呼吸闪烁,模拟声光耦合吸引雌雄稻田害虫进入诱虫装置,高压电网将害虫杀灭,该系统平常主要依赖太阳能板给锂电池充电维持系统整体运行</span></span></span></span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">6.2 </span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">视频链接</span></span></span></span></p>

<p style="text-align:justify"><iframe allowfullscreen="true" frameborder="0" height="450" src="//player.bilibili.com/player.html?bvid=13Y411c7WX&amp;page=1" style="background:#eee;margin-bottom:10px;" width="700"></iframe><br />
&nbsp;</p>

<p>&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><b><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">七、项目总结</span></span></b></span></span></p>

<p>&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="font-weight:normal">7.1 </span></span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="font-weight:normal">项目总结</span></span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">本文讲解了利用声光耦合诱捕并消灭稻飞虱灭虫装置的基本原理,基于RVB2601开发板进行了自上而下的软硬件的设计,利用已有的电子元器件制作了实物,通过视频展示系统总体运行情况和给个模块详细工作情况。</span></span></span></span></span></span></span></p>

<p style="text-indent:24.0pt; text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="font-weight:normal">7.2 </span></span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif"><span style="font-weight:normal">帖子分享链接</span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span class="MsoHyperlink" style="color:#0563c1"><span style="text-decoration:underline"><span lang="EN-US" style="font-size:12.0pt"><a href="https://bbs.eeworld.com.cn/thread-1198824-1-1.html#pid3132829" style="color:#0563c1; text-decoration:underline" target="_blank">【RVB2601开发板试用】扬声器实验 </a></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span class="MsoHyperlink" style="color:#0563c1"><span style="text-decoration:underline"><span lang="EN-US" style="font-size:12.0pt"><a href="https://bbs.eeworld.com.cn/thread-1197541-1-1.html#pid3130131" style="color:#0563c1; text-decoration:underline" target="_blank">GRB呼吸灯 </a></span></span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><b><span style="font-size:16.0pt"><span style="font-family:&quot;微软雅黑&quot;,sans-serif">八、致谢</span></span></b></span></span></p>

<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="22.0pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="font-size:12.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:black">非常感谢平头哥和EEWORLD提供了一次测评RVB2601开发板的机会,在这个测评的过程遇到了一次开发板不能下载程序的问题,通过提交工单进行了请教,最后给我重新寄了开发板,也找出了原因,就是ICE clk不能太高。同时也祝望平头哥的生态越做越好。</span></span></span></span></span></span></span></p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify">&nbsp;</p>

<p style="text-align:justify">&nbsp;</p>

lugl4313820 发表于 2022-5-10 05:55

这个有创意可以呀,值得推广。希望产品早日上市。

lele_liu 发表于 2022-6-5 09:45

<p>感谢楼主的分享,谢谢................</p>
页: [1]
查看完整版本: 【平头哥RVB2601创意应用开发】农田灭害虫装置的设计