Re: Access to IO port on x86 platform
- From: "gissa" <ghielec@xxxxxxxxxxxxxxxxxx>
- Date: 26 Dec 2006 09:18:50 -0800
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 x86
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?
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
.
- Follow-Ups:
- Re: Access to IO port on x86 platform
- From: Steve Maillet \(eMVP\)
- Re: Access to IO port on x86 platform
- From: <ctacke/>
- Re: Access to IO port on x86 platform
- References:
- Access to IO port on x86 platform
- From: gissa
- Re: Access to IO port on x86 platform
- From: Steve Maillet \(eMVP\)
- Access to IO port on x86 platform
- Prev by Date: Re: How to make pxa270 run in 520MHz?
- Next by Date: Re: Access to IO port on x86 platform
- 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
|
|