Re: Access to IO port on x86 platform
- From: "<ctacke/>" <ctacke[@]opennetcf[dot]com>
- Date: Tue, 26 Dec 2006 12:31:16 -0500
If that code is in a driver, yes. In an app, no.
--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--
"gissa" <ghielec@xxxxxxxxxxxxxxxxxx> wrote in message
news:1167153530.737545.233180@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I found this in the group. Can this be used in V6?
PUCHAR MapDeviceIO(INTERFACE_TYPE Bus,ULONG PhysAddress,ULONG len)
{
PHYSICAL_ADDRESS ioPhysicalBase={PhysAddress,0}; // Note: reverse
order of
members...
ULONG inIoSpace=1; // always try for I/O space
PUCHAR retVal=NULL; // start out assuming FAIL
if(HalTranslateBusAddress(
Bus, // [in] Bus Type
0, // [in] Bus Number
ioPhysicalBase, // [in] Physical Address
&inIoSpace, // [inout] flag for iospace
&ioPhysicalBase) // [out] translated physical address
)
{
if (!inIoSpace) // if not in I/O Space it is memory mapped
{
// so now map the address into processes
// virtual address space
retVal = (PUCHAR)MmMapIoSpace(
ioPhysicalBase, // physical address
len, // Length
FALSE); // Non Cached
}
else
retVal = (PUCHAR)ioPhysicalBase.LowPart;
}
return retVal;
}
Steve Maillet (eMVP) wrote:
What is the easiest way to access a port on x86 using CE version 6?By port I'm assuming you mean on the I/O bus accessed with the dedicated
We have a special hardware on IO port x and want to be able to read and
write to it from my application. Do I need driver? Can use some simple
user mode driver?
x86
IO instructions.
The cleanest and most portable solution is to write a device driver for
the
device. In V5.0 and earlier you could get away with accessing the device
directly but as of V6.0 you cannot.
--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com
.
- References:
- Access to IO port on x86 platform
- From: gissa
- Re: Access to IO port on x86 platform
- From: Steve Maillet \(eMVP\)
- Re: Access to IO port on x86 platform
- From: gissa
- Access to IO port on x86 platform
- Prev by Date: Re: Access to IO port on x86 platform
- Next by Date: Re: Debug hang
- Previous by thread: Re: Access to IO port on x86 platform
- Next by thread: Re: Access to IO port on x86 platform
- Index(es):
Relevant Pages
|
|