资源简介
实现rs232通信,基于FPGA的verilog实现,经典范例编码,随时供大家调用
代码片段和文件信息
// RS-232 example
// Compiles with Microsoft Visual C++ 5.0/6.0
// (c) fpga4fun.com KNJN LLC - 2003 2004 2005 2006
#include
#include
#include
HANDLE hCom;
void OpenCom()
{
DCB dcb;
COMMTIMEOUTS ct;
hCom = CreateFile(“COM1:“ GENERIC_READ | GENERIC_WRITE 0 NULL OPEN_EXISTING FILE_ATTRIBUTE_NORMAL NULL);
if(hCom==INVALID_HANDLE_VALUE) exit(1);
if(!SetupComm(hCom 4096 4096)) exit(1);
if(!GetCommState(hCom &dcb)) exit(1);
dcb.BaudRate = 115200;
((DWORD*)(&dcb))[2] = 0x1001; // set port properties for TXDI + no flow-control
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = 2;
if(!SetCommState(hCom &dcb)) exit(1);
// set the timeouts to 0
ct.ReadIntervalTimeout = MAXDWORD;
ct.ReadTotalTimeoutMultiplier = 0;
ct.ReadTotalTimeoutConstant = 0;
ct.WriteTotalTimeoutMultiplier = 0;
ct.WriteTotalTimeoutConstant = 0;
if(!SetCommTimeouts(hCom &ct)) exit(1);
}
void CloseCom()
{
CloseHand
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3555 2006-01-06 11:19 async_receiver.v
文件 2587 2006-01-06 11:27 async_transmitter.v
文件 1831 2006-06-10 11:28 com.c
- 上一篇:用来测试的pcm文件
- 下一篇:达内飞机大战图片素材
相关资源
- 暗影2MAC12系统安装clover.zip
- fdt_4_09_03.exe
- pkg-win.zip
- PRML最全资料集合.zip
- 数据可视化驾驶舱.zip
- 李晓峰通信原理.zip
- 图解西门子S71200PLC入门到实践(清晰
- AI拓客商家联盟V2.1.3前端+后端.rar
- echarts大数据领导仓demo.rar
- [C51单片机开发工具Keil.UV4].Keil.C51.V9
- Deep_Learning_2016.pdf
- zw_Classification1.zip
- Griffiths-IntroductiontoElectrodynamics4thEdit
- ParaViewTutorial.pdf
- xyisv_10236804.zip
- 计算机图形学第4版高清电子书.pdf
- 《多粒度知识获取与不确定性度量》
- 华成英模电课件.zip
- 70d0cd041f738f12db575d3b46e97582.pdf
- OfficeTabEnterprise13.1.zip
- wxu998.rar
- PowerDesigner16.5汉化文件.rar
- jsgis.zip
- PinyinIME(关键代码写了注释).zip
- 锁相环设计、仿真与应用第5版中.pd
- novelOnLine.zip
- SingleSensorImagingMethodsandApplicationsforDi
- ControlSystemsEngineering7th(NormanS.Nise)
- ModernControlSystems13th(RichardC.Dorf).ra
- VectorMagic_1.15pojie.rar
评论
共有 条评论