阅读:1556回复:4
编程控制gpio信号
evc环境下 我想编程控制gpio信号,大家有什么可以经验或者参考资料文献吗?谢谢大家
|
|
沙发#
发布于:2004-04-20 09:15
还是没有人 :(
|
|
板凳#
发布于:2004-06-23 11:01
控制gpio很难吗?我们的wince下驱动很多都用到gpio啊。 我们用的PXA255。
|
|
地板#
发布于:2004-06-24 12:37
这只与你所用的硬件(CPU)有关了,所以关于它的文档就够了,对它写0写1就行了。
|
|
|
地下室#
发布于: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. |
|