【平头哥RVB2601创意应用开发】一智能开关
本帖最后由 yangxz 于 2022-5-9 14:37 编辑<p align="center" style="text-align:center"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">【平头哥RVB2601创意应用开发】+智能开关</span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="right" style="text-align:right"> </p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="background:white"><span style="font-family:"微软雅黑","sans-serif"">项目背景(</span></span></span></b><span lang="EN-US" style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">100-200</span></span><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">字</span></span><b><span style="font-size:16.0pt"><span style="background:white"><span style="font-family:"微软雅黑","sans-serif"">)</span></span></span></b></span></span></li>
</ul>
<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">在智能家居应用广泛应用的今天,智能家居是高科技光速发展的现代社会最热门的话题之一,通过网络等信息化方法实现对家用电器等的智能化控制,使其能够按照人们的设想去工作运行,但却不考虑距离的远近。智能化和远程控制是智能家居的两大特色。目前,已经有越来越多的企业和个人开始了对智能家居的研究。</span></span></span></span></p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">作品简介(100-200字)</span></span></span></span></li>
</ul>
<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">在现代通信技术中,居民住宅使用的无线通信技术大多以蓝牙通信和WiFi通信及远距离的433通信模块等为主。相比较这几种无线通信技术,WiFi的信号适用范围更广,但在智能家用电器开或关的使用过程中,运用WiFi的话会比较麻烦,手机要不定时的连接不同的WiFi网络,才能够对智能家用电器进行遥控,</span></span> <span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">容易丢失信号,再者WiFi信号传输容易受阻挡等使信号不能完整覆盖某个区域,我们在原有的WiFi开关产品中有更新增加了一款433通信的控制开关。该技术可以点对点点对多多对点。一端发送另一端就接收,或者对面那端发送这端接收信息。实现数据无线传输,现在在一个封闭区域内无线传输稳定通信的要求。</span></span></span></span></p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">系统框图(图文结合)</span></span></span></span></li>
</ul>
<p style="margin-left:28px; text-align:justify"> </p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">各部分功能说明(图文结合)</span></span></span></span></li>
</ul>
<p style="text-indent:32.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">单片机控制部分采用平头哥RVB2601,通过单片机管脚控制电磁继电器的断开和吸合来控制外接家用电器的通断。通过串口控制各路开关的闭合及开通,将结果显示在屏幕上(由于文字在屏幕显示这部分一直没有完美解决,暂时放弃了在屏幕显示通断结果的部分)。</span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">五、作品源码和案例中处理的传感器数据</span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">串口传输处理</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bitnum<<2))</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define MEM_ADDR(addr) *((volatile unsigned long *)(addr))</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define BIT_ADDR(addr, bitnum) MEM_ADDR(BITBAND(addr, bitnum))</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOA_ODR_Addr (GPIOA_BASE+12) //0x4001080C</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOB_ODR_Addr (GPIOB_BASE+12) //0x40010C0C</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOC_ODR_Addr (GPIOC_BASE+12) //0x4001100C</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOD_ODR_Addr (GPIOD_BASE+12) //0x4001140C</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOA_IDR_Addr (GPIOA_BASE+8) //0x40010808</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOB_IDR_Addr (GPIOB_BASE+8) //0x40010C08</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOC_IDR_Addr (GPIOC_BASE+8) //0x40011008</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define GPIOD_IDR_Addr (GPIOD_BASE+8) //0x40011408</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PAout(n) BIT_ADDR(GPIOA_ODR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PAin(n) BIT_ADDR(GPIOA_IDR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PBout(n) BIT_ADDR(GPIOB_ODR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PBin(n) BIT_ADDR(GPIOB_IDR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PCout(n) BIT_ADDR(GPIOC_ODR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PCin(n) BIT_ADDR(GPIOC_IDR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PDout(n) BIT_ADDR(GPIOD_ODR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define PDin(n) BIT_ADDR(GPIOD_IDR_Addr,n) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED6 PAout(4) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED5 PAout(6) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED4 PBout(0) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED3 PAout(5) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED2 PAout(7) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED1 PBout(1) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED_PM1 PBout(2) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED_PM2 PBout(10) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define LED_EN PBout(11)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define OUT4 PBout(15) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define OUT3 PBout(14) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define OUT2 PBout(13) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define OUT1 PBout(12) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#define Z_RST PAout(8) </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar DMA_RECEIVE; //DMAµÄ½ÓÊÕ»º³åÊý×é</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar DMA_SEND;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar DMA_LEN; //DMA½ÓÊÕµ½Êý¾ÝµÄ³¤¶È</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar ADDRESS;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar MarkOUT1; //1¿ª¹Ø״̬</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar MarkOUT2; //2¿ª¹Ø״̬</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">uchar MarkOUT3; //3¿ª¹Ø״̬</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar NotKey;//¿ª¹Ø״̬±ê¼Ç</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar I2c_Buf_Write;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar I2c_Buf_Read;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar AddID1;//¶ÀÁ¢µØÖ·1</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar AddID2;//¶ÀÁ¢µØÖ·2</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar AddID3;//ÓòµØÖ·1</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar AddID4;//ÓòµØÖ·2</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar AddID5;//±£Áô×Ö</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern uchar Buzzer_EN;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern void Delayus(uchar a);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">extern void Buzzer_On(void);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void ReadPort(void);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void USART1_Config(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_InitTypeDef GPIO_InitStructure;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitTypeDef USART_InitStructure;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// /* config USART1 clock */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// /* USART1 GPIO config */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// /* Configure USART1 Tx (PA.09) as alternate function push-pull */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_Init(GPIOA, &GPIO_InitStructure); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// /* Configure USART1 Rx (PA.10) as input floating */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// GPIO_Init(GPIOA, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// /* USART1 mode config */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitStructure.USART_BaudRate = 115200;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitStructure.USART_WordLength = USART_WordLength_8b;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitStructure.USART_StopBits = USART_StopBits_1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitStructure.USART_Parity = USART_Parity_No ;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_Init(USART1, &USART_InitStructure); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART_Cmd(USART1, ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitTypeDef GPIO_InitStructure;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitTypeDef USART_InitStructure;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ʹÄÜËùÓÐGPIO¿ÚʱÖÓ*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC,ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOD|RCC_APB2Periph_GPIOE,ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ʹÄÜADC1,UART1ʱÖÓ*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1|RCC_APB2Periph_USART1,ENABLE); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);//ʹÄÜDMAʱÖÓ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; /*ÉèÖÃÒý½ÅģʽΪͨÓÃÍÆÍìÊä³ö*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; /*ÉèÖÃÒý½ÅËÙÂÊΪ50MHz */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_Init(GPIOA, &GPIO_InitStructure); /*µ÷Óÿ⺯Êý£¬³õʼ»¯GPIOA*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; /*ÉèÖÃÒý½ÅģʽΪ¸¡¿ÕÊäÈëģʽ*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_Init(GPIOA, &GPIO_InitStructure); /*µ÷Óÿ⺯Êý£¬³õʼ»¯GPIOA*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitStructure.USART_BaudRate = 9600;//ÅäÖô®¿Ú²¨ÌØÂÊ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitStructure.USART_WordLength = USART_WordLength_8b; //ÅäÖÃֹͣλ </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitStructure.USART_StopBits = USART_StopBits_1; //ֹͣλÉèÖÃΪ1λ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitStructure.USART_Parity = USART_Parity_No ; //ÅäÖÃÆæżУÑéλ²»ÉèÖÃÆæżУÑéλ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> //ÅäÖÃÓ²¼þÁ÷¿ØÖÆ¡£²»²ÉÓÃÓ²¼þÁ÷¡£</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //ÅäÖô®¿ÚµÄģʽ °ÑRxºÍTxģʽ¶¼¿ªÆô</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> //µ÷Óÿ⺯ÊýUSART_Init()Ïò¼Ä´æÆ÷дÈëÅäÖòÎÊý</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_Init(USART1, &USART_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> //ʱÄÜÖжÏ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_ITConfig(USART1, USART_IT_TC, ENABLE); //·¢ËÍÍêÖжÏ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_ITConfig(USART1, USART_IT_IDLE, ENABLE); //¿ÕÏÐÖжÏ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_DMACmd(USART1, USART_DMAReq_Tx, ENABLE); //´®¿Ú·¢ËÍDMAÇëÇóʹÄÜ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_DMACmd(USART1, USART_DMAReq_Rx, ENABLE); //´®¿Ú½ÓÊÜDMAÇëÇóʹÄÜ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_ClearFlag(USART1, USART_FLAG_TC); /* Çå·¢ËÍÍâ³Ç±êÖ¾£¬Transmission Complete flag */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// USART_ITConfig(USART1, USART_IT_RXNE, ENABLE); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// //ʹÄÜUSART1ÍâÉè</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> USART_Cmd(USART1, ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">GPIO</span></span><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">处理</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">#include "gpio.h"</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">/*</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> * º¯ÊýÃû£ºLED_GPIO_Config</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> * ÃèÊö £ºÅäÖÃLEDÓõ½µÄI/O¿Ú</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> * ÊäÈë £ºÎÞ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> * Êä³ö £ºÎÞ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void GPIO_Config(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitTypeDef GPIO_InitStructure; //I/O¿Ú½á¹¹Ì嶨Òå</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ʹÄÜËùÓÐGPIO¡¢AFIO¡¢ADC1¡¢Ê±ÖÓ*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD, ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOE|RCC_APB2Periph_GPIOF|RCC_APB2Periph_GPIOG|RCC_APB2Periph_AFIO, ENABLE); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ÅäÖÃPA0-PA15£¬</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA0 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA1 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA2 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA3 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA4 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA5 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA6 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA7 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA8 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA9 ´®¿Ú·¢ËÍ ÔÚUARTÖÐÅäÖÃ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA10 ´®¿Ú½ÓÊÕ ÔÚUARTÖÐÅäÖÃ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA11 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA12 </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA13,14,15 JTAGÏÂÔؽӿÚ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_Init(GPIOA, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Pin =GPIO_Pin_8|GPIO_Pin_14; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_Init(GPIOB, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Pin =GPIO_Pin_13; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_Init(GPIOC, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ÅäÖÃPB0-PB15£¬</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB0 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB1 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB2 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB3 JTAGÏÂÔØ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB4 JTAGÏÂÔØ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB5 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB6 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB7 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB8 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB9 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB10 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB11 ¿Õ½Å£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB12 EN25-32£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB13 M25-32£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB14 CG25-32£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PB15 ʹÄÜ£¬ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_Init(GPIOB, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// |GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_Init(GPIOB, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ÅäÖÃPC0-PC15£¬</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC0 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC1 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC2 ¿Õ ÍÆÍìÊä³ö</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC3 ¿Õ ÍÆÍìÊä³ö</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC4 EN Êý×ÖÊäÈë</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC5 REST Êý×ÖÊäÈë</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC6 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC7 ¿Õ ÍÆÍìÊä³ö</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC8 LED ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC9 LED ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC10 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC11 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC12 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC13 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC14 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PC15 ¿Õ ÍÆÍìÊä³ö </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Pin =GPIO_Pin_13|GPIO_Pin_13|GPIO_Pin_15; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_Init(GPIOC, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">}</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void GPIO_UARTConfig(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitTypeDef GPIO_InitStructure; //I/O¿Ú½á¹¹Ì嶨Òå</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ʹÄÜËùÓÐGPIO¡¢AFIO¡¢ADC1¡¢Ê±ÖÓ*/</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD, ENABLE);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOE|RCC_APB2Periph_GPIOF|RCC_APB2Periph_GPIOG|RCC_APB2Periph_AFIO, ENABLE); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> /*ÅäÖÃPA9-PA10£¬ </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA9 ´®¿Ú·¢ËÍ ÔÚUARTÖÐÅäÖÃ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> PA10 ´®¿Ú½ÓÊÕ ÔÚUARTÖÐÅäÖÃ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 |GPIO_Pin_10 ;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //??</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//????</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_Init(GPIOA, &GPIO_InitStructure);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">}</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">主函数部分</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">int main(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{ </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// u16 i;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> SystemInit(); /* ÅäÖÃϵͳʱÖÓΪ72M */ </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> GPIO_Config(); /* GPIO ¶Ë¿Ú³õʼ»¯ */ </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// SysTick_Config(720000); //10msÖжÏ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// DMA_Configuration(); //DMA³õʼ»¯</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// NVIC_Configuration(); //ÖжÏÓÅÏȼ¶ÉèÖÃ</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// EXTIX_Init(); //ÍⲿÖжϳõʼ»¯</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// I2C_EE_Init();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// ReadAdd();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// i=GPIOB->IDR;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// i=i&0x0100;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// i=i>>8;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// if(i==1)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// USART1_Config(); /* ´®¿Ú1³õʼ»¯ */</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// else</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Z_RST=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(200);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Z_RST=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// GPIO_UARTConfig();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED_PM1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED_PM2=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED_EN=1; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// while(1)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=0;LED5=1; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=1;LED5=0; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=0;LED5=1; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=1;LED5=0; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=0;LED5=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=1;LED5=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// } </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// PortInit(); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART1_printf(USART1, "\r\n ÕâÊÇÒ»¸öI2CÍâÉè(AT24C02)¶Áд²âÊÔÀý³Ì \r\n");</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// USART1_printf(USART1, "\r\n ("__DATE__ " - " __TIME__ ") \r\n");</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">//// I2C_Test();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">////I2C_EE_BufferRead(I2c_Buf_Read, EEP_Firstpage, 256); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> LED1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> LED2=1; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> LED3=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> while(1)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> { </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// if(NotKey==0)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// ReadKey();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> } </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void Delayus(uchar a)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> u16 i,j;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> for(j=0;j<a;j++)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> for(i=0;i<20000;i++);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">}</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void Delayns(uchar a)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> u16 i,j;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> for(j=0;j<a;j++)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> for(i=0;i<200;i++);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">}</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void Buzzer_On(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> uchar i;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> if (Buzzer_EN==1)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> for(i=0;i<200;i++)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Buzzer=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Delayns(10); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Buzzer=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Delayns(10); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">}</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"> </p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void ReadKey(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> uchar a;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> a=GPIOA->IDR;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> a=a&0x0E;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> if(a!=0x0e)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Delayus(10);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> if((a==0x0C)&&(KeyMark1==0))</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED4=~LED4;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED1=~LED1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> OUT1=~OUT1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> KeyMark1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Buzzer_On();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Delayus(100); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> else if((a==0x0A)&&(KeyMark2==0))</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED5=~LED5;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=~LED2;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> OUT2=~OUT2;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> KeyMark2=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Buzzer_On();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Delayus(100);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> else if((a==0x06)&&(KeyMark3==0))</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=~LED6;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED3=~LED3;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> OUT3=~OUT3;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> KeyMark3=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Buzzer_On();</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> Delayus(100);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> else </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> {</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> KeyMark1=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> KeyMark2=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> KeyMark3=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif""> }</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">}</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">void PortInit(void)</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">{</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED_PM1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED_PM2=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED_EN=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Z_RST=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=1;LED5=1;LED4=1;LED3=1;LED2=1;LED1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=0;LED5=0;LED4=0;LED3=0;LED2=0;LED1=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=1;LED5=1;LED4=1;LED3=1;LED2=1;LED1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=0;LED5=0;LED4=0;LED3=0;LED2=0;LED1=0; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=1;LED5=1;LED4=1;LED3=1;LED2=1;LED1=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=0;LED5=0;LED4=0;LED3=0;LED2=0;LED1=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Delayus(50);</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Z_RST=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED6=1; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED5=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED4=1;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED3=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED2=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// LED1=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// KeyMark1=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// KeyMark2=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// KeyMark3=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// I2C_EE_BufferRead(I2c_Buf_Read, Buzzer_page, 1); </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// Buzzer_EN=I2c_Buf_Read; </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// </span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// OUT1=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// OUT2=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// OUT3=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">// OUT4=0;</span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:12.0pt"><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"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">六、视频<span style="font-family:"微软雅黑","sans-serif"">演示(视频简介+链接)</span></span></span></b></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><img src="https://bbs.eeworld.com.cn/forum.php?mod=image&aid=604530&size=300x300&key=9f1edc89d31ae3e3&nocache=yes&type=fixnone" style="width: 150px; height: 200px;" /> </p>
<p style="text-align:justify"></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">七、项目总结</span></span></b></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b> </b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">通过这次对RVB2601的测试,完整的了解了平头哥单片机的一些基本工作处理流程,使用功能脚控制外围设备,完整的通过串口处理一些基本操作,测试了W800的WiFi芯片,测试了一些简单的网络应用。总的来说这个国产单片还不错,基本能够替代一些国外芯片的基础处理功能,但是在研发初始阶段需要更多的了解该芯片的功能定义,平头哥在芯片功能部分的完善还要在加强。</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">八、其他</span></span></b></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> <span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">本来是想着提供一个完整的项目方案,但由于开发中出现问题太多,又是第一次使用RVB2601,好多功能部分都不是很了解,就做了一个基本的开关测试,原有开关的很多功能都没有正常移植上去,以后再慢慢完成。</span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑","sans-serif"">完整文档:</span></span></span></span><a href="javascript:;" id="attachname604531" isimage="0" onclick="insertAttachTag('604531');doane(event);" title="作品文档.doc
上传日期: 2022-5-9 14:37
文件大小: 603.5 KB">作品文档.doc</a></p>
<p style="text-align:justify"> </p>
建议代码用代码块来编辑,有空修改一下。谢谢! lugl4313820 发表于 2022-5-9 15:40
建议代码用代码块来编辑,有空修改一下。谢谢!
<p>ok</p>
页:
[1]