logo       

RE: Accessing GPIO pins: msg#00100

windows.ce.devel

Subject: RE: Accessing GPIO pins

Hi Tom,



An other hint, as you are giving a physical address to VirtualCopy, do not
forget to use the PAGE_PHYSICAL flag and you also have to divide the
physical address by 256. ( like stated in WinCE help).

So your code would work if you had those changes and also you would have to
change

#define GPIO 0x40E00068

To

#define GPIO 0x40E00000

because of the division, so make sure you are binding enough memory.



Finally yes you can have access to your GPIOs by assigning a value to the
obtained pointer.



Regards,



Nicolas Frayer.



_____

From: windowsce-dev@xxxxxxxxxxxxxxx [mailto:windowsce-dev@xxxxxxxxxxxxxxx]
On Behalf Of Tom Convent
Sent: Friday, November 18, 2005 6:25 AM
To: windowsce-dev@xxxxxxxxxxxxxxx
Subject: Re: [windowsce-dev] Accessing GPIO pins



Hello Rob,

With you hints I got VirtualAlloc and VirtualCopy funtions help. I have
written a sample code and Included here.

#define GPIO 0x40E00068 // physical addess of device
#define size 4800*4 //page size
int set;
set = VirtualCopy(lps, GPIO, size, PAGE_READWRITE); // lps is handle
written by VirtualAlloc function


if I understand the functions correctly, I should write values to a
virable "set" to toggle GPIO pins, like

set = 0x64000000; // toggles GPIO pins ??

please carify,
thanks
Tom Convent.


Rob Wehrli <rwehrli@xxxxxxxxxxx> wrote: On Thu, 17 Nov 2005 17:05:23 -0000,
conventag <conventag@xxxxxxxxx> wrote:

> hello friends,
>
> Iam new to CE 5.0 and Iam using intelPXA270 processor. I want to write
> bytes to processor GPIO control register. it is possible to write
> directly, for example I defined
> #define GAFR2 (*((volatile unsigned long *) 0x40E00068))
> GAFR2 = 0x64000000;
>
> unfortunately I cannot see my GPIO pins acts accordingly. It is
> possible to write directly or there are some functions in Windows CE
> 5.0 to control processor registers. I appreciate if someone just pass
> hints on how to access processor register under CE 5.0
>
> thanks
>
>

Do a search of VirtualAlloc and VirtualCopy in your MSDN for WinCE.
Basically, you need to obtain a handle to physical memory mapped to the
virtual address space before you can use it. Once you have a handle,
you'll have fun toggling your GPIO pins by the dozens...


Take Care.

Rob!



Mailing list addresses:
Post message: windowsce-dev@xxxxxxxxxxxxxxx
Unsubscribe: windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx
List owner: windowsce-dev-owner@xxxxxxxxxxxxxxx

Website: http://groups.yahoo.com/group/windowsce-dev



SPONSORED LINKS
Windows ce Win32 programming Window ce development Basic
programming language Computer programming languages Microsoft window ce

---------------------------------
YAHOO! GROUPS LINKS


Visit your group "windowsce-dev" on the web.

To unsubscribe from this group, send an email to:
windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------






---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.

[Non-text portions of this message have been removed]



Mailing list addresses:
Post message: windowsce-dev@xxxxxxxxxxxxxxx
Unsubscribe: windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx
List owner: windowsce-dev-owner@xxxxxxxxxxxxxxx

Website: http://groups.yahoo.com/group/windowsce-dev




SPONSORED LINKS


Windows
<http://groups.yahoo.com/gads?t=ms&k=Windows+ce&w1=Windows+ce&w2=Win32+progr
amming&w3=Window+ce+development&w4=Basic+programming+language&w5=Computer+pr
ogramming+languages&w6=Microsoft+window+ce&c=6&s=159&.sig=4DOBP6Xylk6ZXdMRpc
azbQ> ce

Win32
<http://groups.yahoo.com/gads?t=ms&k=Win32+programming&w1=Windows+ce&w2=Win3
2+programming&w3=Window+ce+development&w4=Basic+programming+language&w5=Comp
uter+programming+languages&w6=Microsoft+window+ce&c=6&s=159&.sig=OjIip5XsPYf
JGcamqL441g> programming

Window
<http://groups.yahoo.com/gads?t=ms&k=Window+ce+development&w1=Windows+ce&w2=
Win32+programming&w3=Window+ce+development&w4=Basic+programming+language&w5=
Computer+programming+languages&w6=Microsoft+window+ce&c=6&s=159&.sig=MLycE5M
xrB-SFn6ArPdyXA> ce development


Basic
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Windows+c
e&w2=Win32+programming&w3=Window+ce+development&w4=Basic+programming+languag
e&w5=Computer+programming+languages&w6=Microsoft+window+ce&c=6&s=159&.sig=lf
RfGeA1G_n8UeKjxrEnew> programming language

Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Windo
ws+ce&w2=Win32+programming&w3=Window+ce+development&w4=Basic+programming+lan
guage&w5=Computer+programming+languages&w6=Microsoft+window+ce&c=6&s=159&.si
g=HDV6AkQnfQKAetOsWmyvlg> programming languages

Microsoft
<http://groups.yahoo.com/gads?t=ms&k=Microsoft+window+ce&w1=Windows+ce&w2=Wi
n32+programming&w3=Window+ce+development&w4=Basic+programming+language&w5=Co
mputer+programming+languages&w6=Microsoft+window+ce&c=6&s=159&.sig=sgSqi1Fv4
PmlTcZTNfOruA> window ce



_____

YAHOO! GROUPS LINKS



* Visit your group "windowsce-dev
<http://groups.yahoo.com/group/windowsce-dev> " on the web.

* To unsubscribe from this group, send an email to:
windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx
<mailto:windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>

* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.



_____



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~-->
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->

Mailing list addresses:
Post message: windowsce-dev@xxxxxxxxxxxxxxx
Unsubscribe: windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx
List owner: windowsce-dev-owner@xxxxxxxxxxxxxxx

Website: http://groups.yahoo.com/group/windowsce-dev
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/windowsce-dev/

<*> To unsubscribe from this group, send an email to:
windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/







<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise