【平头哥RVB2601创意应用开发】唐诗学习机之一:开发环境搭建 & 汉字显示例程
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span lang="EN-US" style="font-family:"微软雅黑","sans-serif"">一、RVB2601</span><span style="font-family:"微软雅黑","sans-serif"">开发板开发环境学习</span></span></span></span></p><p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">按照《RVB2601开发板用户手册》,了解掌握开发板的硬件资源,确认芯片型号规格,收集相关芯片数据手册,</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">按照《RVB2601开发板快速上手手册》,了解掌握CDK IDE,快速搭建开发环境,通过Hello World例程确认软硬件环境可用,很顺利。</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">小结:开发板资料够用,结合例程,上手快速;国产芯片数据手册简洁,还需要结合实际例程体会学习。</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">例程集成的文件较多,望文只能生义,还不十分清楚具体原理作用,需要时再做研究,这样从零生成一个项目工程还是有难度的,目前只能按照《RVB2601开发板快速上手手册》介绍的方法建立工程,在上面进行修改调整,这里先感谢分享例程的大佬们了。</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">对于AOS和YOC,以及CPU本身的数据手册,是否还有详细的介绍资料,还需进一步查找。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">例程中引用上述图中文件貌似不多,基本只是开发板硬件的初始化,按需进行后续的学习了。</span></span></p>
<p><font face=""微软雅黑","sans-serif"">二、</font><span lang="EN-US" style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">RVB2601</span></span><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">板载资源例程学习</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">基于“ch2601_player_demo”例程,熟悉开发板的OLED显示资源。</span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(1)新建工程</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">在CDK中,通过Welcome页面,搜索CH2601,选择“ch2601_player_demo”例程。</span></span></p>
<p></p>
<p><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(2)</span><span style="font-family:"微软雅黑","sans-serif"">熟悉例程</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span lang="EN-US" style="font-family:"微软雅黑","sans-serif"">bitmap_risc_v.c</span><span style="font-family:"微软雅黑","sans-serif"">是开机显示的字符文件;audio文件夹下是音频的字节数组;app_main.c是主文件。貌似有些文件没有使用。</span></span></span></span></p>
<p></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(3)新增汉字字库文件</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">在oled文件夹下,新建唐诗中用到的汉字字库C文件。</span></span></p>
<p></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">目前按照GB2312添加了《登鹳雀楼》、《静夜思》、《望庐山瀑布》三首的字节数组。</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span lang="EN-US" style="font-family:"微软雅黑","sans-serif"">GB2312</span><span style="font-family:"微软雅黑","sans-serif"">的汉字编码有PDF和WORD文件,查找汉字不太方便,容易看错编码。</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">脚本之家网站上有个在线的GB2312汉字编码表,自制个EXCEL文件使用就方便多了。</span></span></p>
<p><br />
<span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">确定了汉字编码后,在通过网上的字库文件,得到汉字编码对应的字节数组定义。</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">例如:“白”的编码是B0D7,</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">在16x16汉字字库文件中查找对应的数组定义。</span></span></p>
<p>16X16点阵汉字字库的C文件</p>
<p>16X16点阵汉字数组定义。</p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">完成三首唐诗用到的汉字定义,并在相应的头文件中定义汉字数组。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(4)汉字数组的处理函数</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">在oled.c文件中,增加汉字显示相关的函数。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">整个OLED清屏函数,清零屏OLED数组缓存。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">在指定位置存储单个汉字的函数,将汉字数组填充到整屏OLED数组缓存的指定位置。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">处理一首唐诗的函数,一首唐诗分两页显示,第一页为题目和作者,第二页为内容。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(5)汉字的显示函数</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">显示单个汉字和整首唐诗的函数。</span></span></p>
<p></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">显示整首唐诗的函数调用原来例程的显示函数,整个屏幕是SSD1309驱动的,显示函数是按八个PAGE显示的,有时间还是可以优化下,显示得更灵活些。</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(6)汉字显示函数的调用</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">在app_main.c中,添加显示唐诗的函数调用。</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(7)编译下载</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">编译速度有点慢了。</span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman","serif""><span style="text-justify:inter-ideograph"><span style="font-family:"微软雅黑","sans-serif"">(9)调试</span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">调试涉及的内容、文件有点多,时间有限还搞不太清楚。</span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">在Dev-C中写个显示点阵汉字的代码,简单看下汉字显示的是否正确。</span></span></p>
<p> <span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif"">(8)显示效果</span></span></p>
<p>改写的例程和OLED显示效果视频体积都大于15M了,帖子里就不传了。</p>
<p>下面是显示效果的照明,马马虎虎。</p>
<p></p>
是滚动显示的吗? <p>这个要支持,有小朋友的要支持!</p>
<p>你这是提前生成了字体编码固定显示,可惜不是调用的字库</p>
<p>视频你上传到大学堂:<a href="https://training.eeworld.com.cn/course/upcourse" target="_blank">https://training.eeworld.com.cn/course/upcourse</a>,就可以了</p>
页:
[1]