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

📄 rtl8019_8h-source.html

📁 avr应用测试程序
💻 HTML
📖 第 1 页 / 共 2 页
字号:
00095 <span class="preprocessor"></span><span class="preprocessor">#define  RDC        0x40</span>00096 <span class="preprocessor"></span><span class="preprocessor">#define  OVW        0x10</span>00097 <span class="preprocessor"></span><span class="preprocessor">#define  RXE        0x08</span>00098 <span class="preprocessor"></span><span class="preprocessor">#define  TXE        0x04</span>00099 <span class="preprocessor"></span><span class="preprocessor">#define  PTX        0x02</span>00100 <span class="preprocessor"></span><span class="preprocessor">#define  PRX        0x01</span>00101 <span class="preprocessor"></span><span class="comment">// RTL8019/NE2000 RCR Register Bit Definitions</span>00102 <span class="preprocessor">#define  MON        0x20</span>00103 <span class="preprocessor"></span><span class="preprocessor">#define  PRO        0x10</span>00104 <span class="preprocessor"></span><span class="preprocessor">#define  AM         0x08</span>00105 <span class="preprocessor"></span><span class="preprocessor">#define  AB         0x04</span>00106 <span class="preprocessor"></span><span class="preprocessor">#define  AR         0x02</span>00107 <span class="preprocessor"></span><span class="preprocessor">#define  SEP        0x01</span>00108 <span class="preprocessor"></span><span class="comment">// RTL8019/NE2000 TCR Register Bit Definitions</span>00109 <span class="preprocessor">#define  FDU        0x80    // full duplex</span>00110 <span class="preprocessor"></span><span class="preprocessor">#define  PD         0x40    // pad disable</span>00111 <span class="preprocessor"></span><span class="preprocessor">#define  RLO        0x20    // retry of late collisions</span>00112 <span class="preprocessor"></span><span class="preprocessor">#define  LB1        0x04    // loopback 1</span>00113 <span class="preprocessor"></span><span class="preprocessor">#define  LB0        0x02    // loopback 0</span>00114 <span class="preprocessor"></span><span class="preprocessor">#define  CRC        0x01    // generate CRC</span>00115 <span class="preprocessor"></span><span class="comment">// RTL8019 EECR Register Bit Definitions</span>00116 <span class="preprocessor">#define  EEM1       0x80</span>00117 <span class="preprocessor"></span><span class="preprocessor">#define  EEM0       0x40</span>00118 <span class="preprocessor"></span><span class="preprocessor">#define  EECS       0x08</span>00119 <span class="preprocessor"></span><span class="preprocessor">#define  EESK       0x04</span>00120 <span class="preprocessor"></span><span class="preprocessor">#define  EEDI       0x02</span>00121 <span class="preprocessor"></span><span class="preprocessor">#define  EEDO       0x01</span>00122 <span class="preprocessor"></span>00123 00124 <span class="comment">// RTL8019 Initial Register Values</span>00125 <span class="comment">// RCR : INT trigger active high and Accept Broadcast ENET packets</span>00126 <span class="preprocessor">#define RCR_INIT        (AB)</span>00127 <span class="preprocessor"></span><span class="preprocessor">#define DCR_INIT        0x58    // FIFO thrsh. 8bits, 8bit DMA transfer</span>00128 <span class="preprocessor"></span><span class="comment">// TCR : default transmit operation - CRC is generated</span>00129 <span class="preprocessor">#define TCR_INIT        0x00</span>00130 <span class="preprocessor"></span><span class="comment">// IMR : interrupt enabled for receive and overrun events</span>00131 <span class="preprocessor">#define IMR_INIT        0x11    // PRX and OVW interrupt enabled</span>00132 <span class="preprocessor"></span><span class="comment">// buffer boundaries</span>00133 <span class="comment">//  transmit has 6 256-byte pages</span>00134 <span class="comment">//  receive has 26 256-byte pages</span>00135 <span class="comment">//  entire available packet buffer space is allocated</span>00136 <span class="preprocessor">#define TXSTART_INIT    0x40</span>00137 <span class="preprocessor"></span><span class="preprocessor">#define RXSTART_INIT    0x46</span>00138 <span class="preprocessor"></span><span class="preprocessor">#define RXSTOP_INIT     0x60</span>00139 <span class="preprocessor"></span>00140 <span class="comment">// Ethernet constants</span>00141 <span class="preprocessor">#define ETHERNET_MIN_PACKET_LENGTH  0x3C</span>00142 <span class="preprocessor"></span><span class="comment">//#define ETHERNET_HEADER_LENGTH        0x0E</span>00143 00144 <span class="comment">// offsets into ax88796 ethernet packet header</span>00145 <span class="preprocessor">#define  PKTHEADER_STATUS       0x00    // packet status</span>00146 <span class="preprocessor"></span><span class="preprocessor">#define  PKTHEADER_NEXTPAGE     0x01    // next buffer page</span>00147 <span class="preprocessor"></span><span class="preprocessor">#define  PKTHEADER_PKTLENL      0x02    // packet length low</span>00148 <span class="preprocessor"></span><span class="preprocessor">#define  PKTHEADER_PKTLENH      0x03    // packet length high</span>00149 <span class="preprocessor"></span>00150 00151 <span class="comment">// functions</span>00152 <span class="preprocessor">#include "<a class="code" href="nic_8h.html">nic.h</a>"</span>00153 00154 <span class="comment">// setup ports for I/O</span>00155 <span class="keywordtype">void</span> rtl8019SetupPorts(<span class="keywordtype">void</span>);00156 00157 <span class="comment">// read ax88796 register</span>00158 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> rtl8019Read(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> address);00159 00160 <span class="comment">// write ax88796 register</span>00161 <span class="keywordtype">void</span> rtl8019Write(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> address, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> data);00162 00163 <span class="comment">// initialize the ethernet interface for transmit/receive</span>00164 <span class="keywordtype">void</span> rtl8019Init(<span class="keywordtype">void</span>);00165 00166 <span class="comment">// packet transmit functions</span>00167 <span class="keywordtype">void</span> rtl8019BeginPacketSend(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> packetLength);00168 <span class="keywordtype">void</span> rtl8019SendPacketData(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * localBuffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length);00169 <span class="keywordtype">void</span> rtl8019EndPacketSend(<span class="keywordtype">void</span>);00170 00171 <span class="comment">// packet receive functions</span>00172 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rtl8019BeginPacketRetreive(<span class="keywordtype">void</span>);00173 <span class="keywordtype">void</span> rtl8019RetreivePacketData(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * localBuffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length);00174 <span class="keywordtype">void</span> rtl8019EndPacketRetreive(<span class="keywordtype">void</span>);00175 00176 <span class="comment">// Processes RTL8019 interrupts.</span>00177 <span class="comment">// Currently, this function looks only for a receive overflow condition.</span>00178 <span class="comment">// The function need not be called in response to an interrupt,</span>00179 <span class="comment">// but can be executed just before checking the receive buffer for incoming packets.</span>00180 <span class="keywordtype">void</span> rtl8019ProcessInterrupt(<span class="keywordtype">void</span>);00181 00182 <span class="comment">// execute procedure for recovering from a receive overflow</span>00183 <span class="comment">// this should be done when the receive memory fills up with packets</span>00184 <span class="keywordtype">void</span> rtl8019ReceiveOverflowRecover(<span class="keywordtype">void</span>);00185 00186 <span class="comment">// formatted print of all important RTL8019 registers</span>00187 <span class="keywordtype">void</span> rtl8019RegDump(<span class="keywordtype">void</span>);00188 00189 <span class="preprocessor">#endif</span>00190 <span class="preprocessor"></span><span class="comment">//@}</span></span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:07 2006 for Procyon AVRlib by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address></body></html>

⌨️ 快捷键说明

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