- 1、本文档共27页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
横沥半仙山医院(Hengli half mountains hospital)
# includes stdio.h 导入stdio.h头文件 / * * /
# includes dos.h 导入dos.h头文件夹 / * * /
# includes conio.h 导入conio.h头文件 / * * /
# define size 1024 * 16 / * 定义接收缓冲区大小 * /
# define gdp 波特率是115200 0x01 / * * /
unsigned char were;
void init _ com _ interrupts (); / * 初始化com2端口, 用于中断 * /
void init _ com _ chanxun (); / * 初始化com2端口, 用于查询方式 * /
void send _ wait (); / * 发送等待 * /
void receive _ wait (); / * 接收等待 * /
long file _ size (file * fp); / * 计算文件大小 * /
void send _ ch (); / * 发送字符, 字符串 * /
void send _ file (); / * 发送文件 * /
void receive _ ch (); / * 接收字符, 字符串 * /
void receive _ file (); / * 接收文件 * /
void close _ intr (); / * 关闭中断服务 * /
void interrupt (* old _ int) (void);
void interrupt to receive _ intr (); / * 中断服务程序, 用于中断接收文件 * /
void file _ begin ();
int flag = 1;
/ *
outputb和inportb对应的函数为 _ inp和 _ outp.使用时需要 conio.h 头文件 .
建议使用 _ inp和 _ outp, 而不是使用inp和outp.因为 _ inp和 _ outp在debug和release都可以使用.
而inp和outp只能用于release设置.如果在debug设置时使用inp和outp, 编译时不会错.
但会产生链接错误如下:
error link2001: unresolved external symbol _ inp
error link2001: unresolved external symbol _ outp
fatal error: 2 externals lnk1120 unresolved.
以上方法只适用于win9x, 在windows nt / 2000下任何硬件i / o操作均需要通过设备启动程序.
你可以借助ddk (http: / / / ddk) 编写设备驱动程序.当然你也可以购买现成的软件.
如http: / / / ~ zealsoft / cn / ntport /.
the * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
int _ inp (unsigned short port).
int _ outp (unsigned short port, int databyte);
_ inp原型为:
int _ inp (unsigned short port).
port参数为指定的输入端口号.调用后, 它从port参数指定的端口读入并返回一个字节.
输入值可以是在0 - 255范围内的任意无符号整数值.
_ outp原型为:
int _ outp (unsigned short port, int databyte);
port 参数为指定的输出端口号, databyte 参数为输出的值.
调用后, 它将databyte参数指定的值输出到port 参数指定的端口并返回该值.
Databyte can be 0 - 255 within the scope of any integer value.
These two functions have no error return value.
The library is bios.h
In Win98 can be used directly, but must be linked to driver in NT
* /
Void init_com_chanxun (COM2) / * * / port initialization
{
/*0x rep
您可能关注的文档
- 磷化生产工艺(Phosphating process).doc
- 磷化与涂装——国家标准一览表(Phosphating and painting -- national standard list).doc
- 磷化资料(Phosphating data).doc
- 磷酸根的鉴定(Identification of phosphate).doc
- 灵隐寺(Lingyin Temple).doc
- 理发店的小知识(Little knowledge of barber shops).doc
- 留三分(Take three points).doc
- 留学词汇(Vocabulary for studying abroad).doc
- 留学德国出国行李清单(Baggage list for studying abroad in Germany).doc
- 留学准备支票兑换现金三步走(Study abroad, ready to cash cheque, three steps).doc
- 2025蓝色商务风年中述职汇报ppt模板.pptx
- 2025蓝金色简约商务风工作汇报总结模板.pptx
- 江苏省海安高级中学2024-2025学年高二下学期6月月考历史试题.docx
- 统编版语文六年级上册课外阅读材料 西游记阅读指导课 课件(共27张PPT).pptx
- 第5课《雷锋叔叔,你在哪里》课件(共38张PPT).pptx
- 5《一个豆荚里的五粒豆》 课件(共40张PPT).pptx
- 23 黄继光 课件(共24张PPT).pptx
- 2025年浙江省高一下学期6月学考适应性考试历史试题.docx
- 河南省周口市沈丘县第二高级中学2024-2025学年高二下学期6月测试数学试卷.docx
- 山东省聊城市阳谷县2024-2025学年七年级下学期期中道德与法治试题.docx
文档评论(0)