与GPIO通讯 [英] Communication with GPIO

查看:167
本文介绍了与GPIO通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用具有GPIO por的单板计算机上工作,操作系统是windows xp ebmedded,gpio的驱动程序是.sys文件,该文件已安装在windows \ system32 \ drivers中
我需要用C#编写一个与gpio通信(读写)的程序
我正在使用createfile函数来处理驱动程序并使用此句柄来调用DeviceIOcontrol,但是问题是我总是(通过测试creatfile函数)得到-1,这意味着invaled_handle_file
我认为我的问题是设备名称,我使用了从设备的inf文件获取的类GUID,但我遇到了相同的问题
任何建议可能是我的问题!
以及我应该如何找到该设备的GUID?
以及如何在C#的Createfile函数中使用它? 感谢您的帮助
RH

Hi,
I''m working on a single board computer which has GPIO por, the os is windows xp ebmedded, the driver for the gpio is .sys file which have been installed in windows\system32\drivers
I need to write a program in c# which communicate with gpio (read and write)
I am using createfile function in order to handle the driver and use this handle to call DeviceIOcontrol but the problem is i always get (by testing creatfile function)-1 which means invaled_handle_file
i think my problem is the device name i used the class GUID which i get from the inf file for the device but i have the same problem
any suggestion where could be me problem!
and how exactly i should find the GUID for the device?
and how to use it in the Createfile function in C#??
thanks for any help
RH

推荐答案

您还没有关于该驱动程序的文档吗?如果您(或您的公司)购买了该板,则应拥有其驱动程序和有关其API的文档.如果您不这样做,则只需找到电路板的参考,然后从互联网上搜索其文档/SDK.

在大多数情况下,此类开发板甚至都附带了代码示例.

如果您告诉我们您使用的是哪种板,也许我们中的某些人将能够为您提供帮助.否则,您的问题太笼统了……
Haven''t you got any documentation on that driver? If you (or your company) bought the board, you should have its drivers and the documentation about its API. If you don''t, just find the board''s reference and search its documentation/SDK from internet.

In most cases, such boards even come with code examples.

If you tell us what board you are using, maybe some of us will be able to help you. Otherwise your question is too generic...


这篇关于与GPIO通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆