00000028.htm

来自「水木社区 embeded 版精华区 下载」· HTM 代码 · 共 65 行

HTM
65
字号
<?xml version="1.0" encoding="gb2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>单片机与TCP/IP网络 (十)               jacobw </title></head><body><center><h1>BBS 水木清华站∶精华区</h1></center><a name="top"></a>发信人:&nbsp;turbolinux&nbsp;(hoho~神啊,救救我吧...),&nbsp;信区:&nbsp;Embedded&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />标&nbsp;&nbsp;题:&nbsp;单片机与TCP/IP网络&nbsp;(十)&nbsp;<br />发信站:&nbsp;BBS&nbsp;水木清华站&nbsp;(Fri&nbsp;Jul&nbsp;13&nbsp;00:37:25&nbsp;2001)&nbsp;<br />&nbsp;<br />&nbsp;<br />(十)设置网卡地址&nbsp;<br />&nbsp;<br />&nbsp;<br />------------------------------------------------------------------------&nbsp;<br />&nbsp;<br />----&nbsp;很久没有写网卡的文章了,很多网友很关心其他方面的内容,也只好写下去.&nbsp;<br />&nbsp;<br />以下程序是设置网卡的地址,只有符合这个地址的数据包才接收.&nbsp;<br />&nbsp;<br />&nbsp;&nbsp;<br />&nbsp;<br />void&nbsp;writemynodeid()&nbsp;<br />&nbsp;<br />{&nbsp;page(1);&nbsp;<br />&nbsp;<br />reg01=mynodeid[0].bytes.high;&nbsp;//PAR0&nbsp;<br />reg02=mynodeid[0].bytes.low;&nbsp;//PAR1&nbsp;<br />reg03=mynodeid[1].bytes.high;&nbsp;//PAR2&nbsp;<br />reg04=mynodeid[1].bytes.low;&nbsp;//PAR3&nbsp;<br />reg05=mynodeid[2].bytes.high;&nbsp;//PAR4&nbsp;<br />reg06=mynodeid[2].bytes.low;&nbsp;//PAR5&nbsp;<br />&nbsp;<br />&nbsp;<br />}&nbsp;<br />&nbsp;<br />&nbsp;<br />又用到几个新的寄存器,是页1的几个寄存器:&nbsp;<br />&nbsp;<br />PAR0,PAR1,&nbsp;PAR2,&nbsp;PAR3,PAR4,PAR5&nbsp;<br />&nbsp;<br />这几个寄存器是网卡的工作时候用的地址,只有符合这个地址的数据包才接收,这个&nbsp;<br />地址是可以设置为其他的值,不一定设置为网卡的物理地址,为了不跟别的网卡地址&nbsp;<br />冲突,最好设置为网卡的地址,(如果用户需要设置为其他的值,也是可以的).&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />(未完)&nbsp;<br />&nbsp;<br />--&nbsp;<br />&nbsp;<br />※&nbsp;来源:·BBS&nbsp;水木清华站&nbsp;smth.org·[FROM:&nbsp;166.111.174.125]&nbsp;<br /><a href="00000027.htm">上一篇</a><a href="javascript:history.go(-1)">返回上一页</a><a href="index.htm">回到目录</a><a href="#top">回到页首</a><a href="00000029.htm">下一篇</a></h1></center><center><h1>BBS 水木清华站∶精华区</h1></center></body></html>

⌨️ 快捷键说明

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