sunshine_fl
驱动牛犊
驱动牛犊
  • 注册日期2002-08-22
  • 最后登录2005-09-23
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1498回复:4

编程控制gpio信号

楼主#
更多 发布于:2004-04-19 15:13
evc环境下 我想编程控制gpio信号,大家有什么可以经验或者参考资料文献吗?谢谢大家
sunshine_fl
驱动牛犊
驱动牛犊
  • 注册日期2002-08-22
  • 最后登录2005-09-23
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-04-20 09:15
还是没有人 :(
simgu
驱动牛犊
驱动牛犊
  • 注册日期2003-05-16
  • 最后登录2004-06-23
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-06-23 11:01
控制gpio很难吗?我们的wince下驱动很多都用到gpio啊。 我们用的PXA255。
microsun
论坛版主
论坛版主
  • 注册日期2002-11-11
  • 最后登录2014-07-18
  • 粉丝0
  • 关注0
  • 积分1052分
  • 威望1159点
  • 贡献值0点
  • 好评度848点
  • 原创分0分
  • 专家分0分
地板#
发布于:2004-06-24 12:37
这只与你所用的硬件(CPU)有关了,所以关于它的文档就够了,对它写0写1就行了。
学海无涯
wenzai
驱动中牛
驱动中牛
  • 注册日期2002-04-16
  • 最后登录2011-03-04
  • 粉丝0
  • 关注0
  • 积分14分
  • 威望424点
  • 贡献值0点
  • 好评度309点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-07-03 23:36
Well, eVC is going to be an easier task.  You need to use MmMapIoSpace() to
map the physical address of the GPIO control registers in the processor to a
virtual address that you can use from regular C code.  Once you have that
pointer, you'd write code that might look something like this:

volatile BYTE *    gpioPtr = MmMapIoSpace( physicalAddress, gpioLength,
FALSE );

*(DWORD*)( gpioPtr + GPCR0 ) = 0x00010000;

This would set the clear bit for GPIO16, causing the output to go low.
Similar code would set the output.

You'd get the physical address information and the length of the area that
you need to map from the Developer's Manual for the processor.  Same for the
offsets for things like GPCR0, etc.
游客

返回顶部