⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 程序.htm

📁 program.rar
💻 HTM
📖 第 1 页 / 共 5 页
字号:
    <td width=180 style='width:135.0pt;padding:0cm 0cm 0cm 30.0pt;height:21.0pt'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><b><span
    lang=EN-US style='font-size:9.0pt;line-height:150%'><a
    href="http://www.elechome.com/Article/ShowElite.asp"><span lang=EN-US
    style='color:white'><span lang=EN-US>最</span></span><span lang=EN-US
    style='color:white'><span lang=EN-US> </span></span><span lang=EN-US
    style='color:white'><span lang=EN-US>新</span></span><span lang=EN-US
    style='color:white'><span lang=EN-US> </span></span><span lang=EN-US
    style='color:white'><span lang=EN-US>推</span></span><span lang=EN-US
    style='color:white'><span lang=EN-US> </span></span><span lang=EN-US
    style='color:white'><span lang=EN-US>荐</span></span></a><o:p></o:p></span></b></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:7'>
    <td style='padding:0cm 6.0pt 0cm 3.75pt'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
    lang=EN-US style='font-size:9.0pt;line-height:150%'><script language="JavaScript"  src="/Article/JS/Article_Elite2.js">
    </script><o:p>&nbsp;</o:p></span></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:8;height:7.5pt'>
    <td style='padding:0cm 0cm 0cm 0cm;height:7.5pt'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
    lang=EN-US style='font-size:8.0pt;mso-bidi-font-size:9.0pt;line-height:
    150%'><o:p>&nbsp;</o:p></span></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:9;height:21.0pt'>
    <td width=180 style='width:135.0pt;padding:0cm 0cm 0cm 30.0pt;height:21.0pt'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><b><span
    style='font-size:9.0pt;line-height:150%'>相 关 文 章<span lang=EN-US><o:p></o:p></span></span></b></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:10'>
    <td style='padding:0cm 6.0pt 0cm 3.75pt'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
    lang=EN-US style='font-size:9.0pt;line-height:150%'><a
    href="http://www.elechome.com/Article/ShowArticle.asp?ArticleID=24"
    target="_self"
    title="文章标题:Keil&nbsp;C动态内存管理机制分析及改进&#13;&#10;作&nbsp;&nbsp;&nbsp;&nbsp;者:重庆电力高等专科学校 丁明亮 熊真春&#13;&#10;更新时间:2007-04-26 17:14:04">Keil&nbsp;C<span
    lang=EN-US><span lang=EN-US>动态内存管理机制</span></span></a><o:p></o:p></span></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:11;mso-yfti-lastrow:yes;height:7.5pt'>
    <td style='padding:0cm 0cm 0cm 0cm;height:7.5pt'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
    lang=EN-US style='font-size:8.0pt;mso-bidi-font-size:9.0pt;line-height:
    150%'><o:p>&nbsp;</o:p></span></p>
    </td>
   </tr>
  </table>
  <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
  lang=EN-US style='font-size:9.0pt;line-height:150%'><o:p></o:p></span></p>
  </td>
<!--网页中部左栏代码结束-->
  <td width=10 style='width:7.2pt;padding:0cm 0cm 0cm 0cm'>
  <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
  lang=EN-US style='font-size:9.0pt;line-height:150%'><o:p>&nbsp;</o:p></span></p>
  </td>
  <td width=575 valign=top style='width:431.25pt;padding:0cm 0cm 0cm 0cm'><!--网页中部右栏文章内容代码开始-->
  <div align=center>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
   style='width:100.0%;mso-cellspacing:0cm;mso-padding-alt:0cm 0cm 0cm 0cm;
   width:fixed'>
   <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'>
    <td width="3%" style='width:3.0%;padding:0cm 0cm 0cm 0cm'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
    lang=EN-US style='font-size:9.0pt;line-height:150%'><img border=0 width=11
    height=14 id="_x0000_i1034" src="http://www.elechome.com/Images/arrow.gif"
    align=absmiddle><o:p></o:p></span></p>
    </td>
    <td width="66%" style='width:66.0%;padding:0cm 0cm 0cm 0cm'>
    <p class=MsoNormal style='line-height:150%;word-break:break-all'><strong><span
    lang=EN-US style='font-size:9.0pt;line-height:150%;font-family:宋体;
    mso-bidi-font-family:宋体'>nRF24E1</span></strong><strong><span
    style='font-size:9.0pt;line-height:150%;font-family:宋体;mso-bidi-font-family:
    宋体'>原版源程序</span></strong><span lang=EN-US style='font-size:9.0pt;
    line-height:150%'><o:p></o:p></span></p>
    </td>
    <td style='padding:0cm 0cm 0cm 0cm'>
    <p class=MsoNormal align=right style='text-align:right;line-height:150%;
    word-break:break-all'><span lang=EN-US style='font-size:9.0pt;line-height:
    150%'>&nbsp;&nbsp;&nbsp;</span><span style='font-size:9.0pt;line-height:
    150%;color:red'>热</span><span lang=EN-US style='font-size:9.0pt;line-height:
    150%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></p>
    </td>
   </tr>
  </table>
  </div>
  <p class=MsoNormal style='line-height:150%;word-break:break-all'><span
  lang=EN-US style='font-size:9.0pt;line-height:150%;display:none;mso-hide:
  all'><o:p>&nbsp;</o:p></span></p>
  <div align=center>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
   style='width:100.0%;mso-cellspacing:0cm;mso-padding-alt:0cm 3.75pt 0cm 3.75pt;
   width:fixed'>
   <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:22.5pt'>
    <td colspan=2 style='padding:0cm 3.75pt 0cm 3.75pt;height:22.5pt;
    width:fixed'>
    <p class=MsoNormal align=center style='text-align:center;line-height:150%;
    word-break:break-all'><span lang=EN-US style='font-size:9.0pt;line-height:
    150%'>nRF24E1</span><span style='font-size:9.0pt;line-height:150%'>原版源程序<span
    lang=EN-US><o:p></o:p></span></span></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:1'>
    <td colspan=2 style='padding:0cm 3.75pt 0cm 3.75pt;width:fixed'>
    <p class=MsoNormal align=center style='text-align:center;line-height:150%;
    word-break:break-all'><b><span lang=EN-US style='font-size:9.0pt;
    line-height:150%'><o:p>&nbsp;</o:p></span></b></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:2'>
    <td colspan=2 style='background:whitesmoke;padding:0cm 3.75pt 0cm 3.75pt'>
    <p class=MsoNormal align=center style='text-align:center;line-height:150%;
    word-break:break-all'><span style='font-size:9.0pt;line-height:150%'>作者:黄盈鑫
    文章来源:本站原创 点击数:<span lang=EN-US>979 </span>更新时间:<span lang=EN-US>2006-03-16
    11:12:16 <a
    href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=2008&amp;title='+escape(d.title)+'&amp;url='+escape(d.location.href)+'&amp;desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));vivi.focus();"
    title="收藏的网页将被永久地保存到新浪ViVi收藏夹http://vivi.sina.com.cn"><img border=0
    width=74 height=19 id="_x0000_i1035"
    src="http://www.elechome.com/images/vivi_coop1.gif" align=absmiddle></a><o:p></o:p></span></span></p>
    </td>
   </tr>
   <tr style='mso-yfti-irow:3;height:225.0pt'>
    <td colspan=2 valign=top style='padding:0cm 3.75pt 0cm 3.75pt;height:225.0pt;
    width:fixed' id=fontzoom><!--插入广告JS代码-->
    <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
     align=left style='mso-cellspacing:0cm;mso-table-lspace:2.25pt;mso-table-rspace:
     2.25pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:
     column;mso-table-left:left;mso-padding-alt:7.5pt 7.5pt 7.5pt 7.5pt'>
     <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'>
      <td style='padding:7.5pt 7.5pt 7.5pt 7.5pt'>
      <p class=MsoNormal style='line-height:150%'><span lang=EN-US
      style='font-size:9.0pt;line-height:150%'><o:p>&nbsp;</o:p></span></p>
      </td>
     </tr>
    </table>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>/*<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span style='font-size:
    9.0pt;line-height:150%'>如果需要详细设计资料请发邮件联系,<span lang=EN-US>senxin79@163.com<o:p></o:p></span></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>*/<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>/* wireless.c
    ================================================================================================<br>
    &nbsp;* <br>
    &nbsp;* This file is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTYT; without even the<br>
    &nbsp;* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.<br>
    &nbsp;*<br>
    &nbsp;* Author(s): Ole Saether<br>
    &nbsp;*<br>
    &nbsp;* NOTES:<br>
    &nbsp;*<br>
    &nbsp;* A frame is the time between each transmission of a packet.<br>
    &nbsp;* A frame is divided into NSLOTS time-slots. The duration of a
    time-slot is 1/fs, where fs is the ADC<br>
    &nbsp;* sampling frequency.<br>
    &nbsp;*<br>
    &nbsp;* The NOSYNC variable is used by the slave to keep track of how many
    frames have gone since it received a<br>
    &nbsp;* valid packet. It is incremented once each frame in the TIMER2 irq
    handler and cleared each time a packet is<br>
    &nbsp;* received. If the variable reaches the constant NSYNC (see below)
    the slave enters continuous receive mode.<br>
    &nbsp;*<br>
    &nbsp;* The pin P0.2 is used to select slave (P0.2 = 1) or master (P0.2 =
    0).<br>
    &nbsp;*<br>
    &nbsp;* $Date: 8.10.03 12:02 $<br>
    &nbsp;* $Revision: 1 $<br>
    &nbsp;*<br>
    &nbsp;*=============================================================================================================<br>
    */<br>
    #include &lt;Nordic\reg24e1.h&gt;<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>#define ADDR_INDEX&nbsp;
    8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Index to address bytes in RFConfig.buf <br>
    #define ADDR_COUNT&nbsp;
    4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Number of address bytes<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>#define
    FSZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Buffer size<br>
    #define FMASK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSZ-1<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>struct RFConfig<br>
    {<br>
    &nbsp;&nbsp;&nbsp; unsigned char n;<br>
    &nbsp;&nbsp;&nbsp; unsigned char buf[15];<br>
    };<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>typedef struct RFConfig RFConfig;<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>#define
    NSLOTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Number of samples in one packet<br>
    #define NSYNC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // #frames wo/packets before the slave enters receive mode<br>
    #define RXSLOT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Wait from slot 14 to..<br>
    #define WTSLOT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // ..slot 21 for reception of a packet<br>
    #define SYNCSLOT&nbsp;&nbsp;&nbsp;
    20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // When the slave receives a valid packet set the slot counter to this
    number<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'><br>
    volatile unsigned char idata RxBuf[FSZ];<br>
    volatile unsigned char idata TxBuf[FSZ];<br>
    volatile unsigned char TxWrp, TxRdp, TxNum;<br>
    volatile unsigned char RxWrp, RxRdp, RxNum;<br>
    volatile unsigned char rec, slotn, nosync, slave, prevsample;<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>const RFConfig RxTxConf =<br>
    {<br>
    &nbsp;&nbsp;&nbsp; 15,<br>
    &nbsp;&nbsp;&nbsp; 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br>
    &nbsp;&nbsp;&nbsp; 0xaa, 0xbb, 0x12, 0x34, 0x83, 0x6f, 0x04<br>
    };<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>void InitBuffers(void)<br>
    {<br>
    &nbsp;&nbsp;&nbsp; RxWrp = RxRdp = RxRdp = RxNum = 0;<br>
    &nbsp;&nbsp;&nbsp; TxWrp = TxRdp = TxRdp = TxNum = 0;<br>
    }<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>void Delay100us(volatile unsigned
    char n)<br>
    {<br>
    &nbsp;&nbsp;&nbsp; unsigned char i;<br>
    &nbsp;&nbsp;&nbsp; while(n--)<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(i=0;i&lt;35;i++)<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;<br>
    }<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>unsigned char
    SpiReadWrite(unsigned char b)<br>
    {<br>
    &nbsp;&nbsp;&nbsp; EXIF &amp;=
    ~0x20;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Clear SPI interrupt<br>
    &nbsp;&nbsp;&nbsp; SPI_DATA =
    b;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // Move byte to send to SPI data register<br>
    &nbsp;&nbsp;&nbsp; while((EXIF &amp; 0x20) ==
    0x00)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
    Wait until SPI hs finished transmitting<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;<br>
    &nbsp;&nbsp;&nbsp; return SPI_DATA;<br>
    }<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>void Init(void)<br>
    {<br>
    &nbsp;&nbsp;&nbsp; unsigned char i;<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>&nbsp;&nbsp;&nbsp; P0_DIR =
    0x04;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // P0.2 is input, the rest output<br>
    &nbsp;&nbsp;&nbsp; P0 =
    0x02;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    // P0.1 = 1 for the master/slave selection<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>&nbsp;&nbsp;&nbsp; slotn = nosync
    = 0;<br>
    &nbsp;&nbsp;&nbsp; InitBuffers();<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>&nbsp;&nbsp;&nbsp; if ((P0 &amp;
    0x04) == 0x04)<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; slave = 1;<br>
    &nbsp;&nbsp;&nbsp; else<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; slave = 0;<o:p></o:p></span></p>
    <p style='line-height:150%;word-break:break-all'><span lang=EN-US
    style='font-size:9.0pt;line-height:150%'>&nbsp;&nbsp;&nbsp; // TIMER2:<br>
    &nbsp;&nbsp;&nbsp; TR2 =

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -