Read and Write GPIO I/O addresses

  • Thread starter Thread starter Jose
  • Start date Start date
J

Jose

Hello:
I'm a newbie in CF and I would like to read and write GPIO data, accessing
to some I/O addresses in my PC104 using C#.
How can I access directly to the memory mapped addresses using managed code?
Where can I find information about that?

Best regards
Jose
 
Do you have a driver that wraps them, or just the addresses? Do you have
the physical or virtual address?

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
No. I dont't have a driver to access to the memory addreses. Only the
physical I/O addresses.
I haven't found a clear information about that in the newsgroup, and any
good article about that.

Thanks for your help.
 
You need to P/Invoke an API to map the physical address to a virtual
address, then read/write to the virtual address. MmMapIoSpace would work,
VirtualAlloc would work. You realize real-time is not an option here, and
that a misstep can cause bad behavior? A driver is a better way to go, but
IMHO, there's really nothing inherently wrong with direct access. It's just
not terribly portable.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
Back
Top