From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: yi zheng <yizheng23@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] how to use rt_io_get_region function on AT91SAM9263 in user space
Date: Mon, 29 Aug 2011 14:22:33 +0200 [thread overview]
Message-ID: <4E5B8489.5080000@domain.hid> (raw)
In-Reply-To: <CAHoMn5oX=cJ080BEbC9DCYN4rreTE5+m=Lh=N80Xi4qsiZFfbg@domain.hid>
On 08/29/2011 02:09 PM, yi zheng wrote:
>>
>>>> Hi,all
>>>> I want to write a Xenomai application running in user space that
>> can
>>>> access the
>>>> GPIO pins of my AT91SAM9263 ARM. To get the memory
>>>> region I found the function rt_misc_get_io_region(). Unfortunately
>>>> there is no discription of this function in the API documentation.
>>>> Does this function work like request_mem_region()?
>>
>>> Yes, it allows user-space access to request_mem_region. So, in addition
>>> to this, you should do the usual mmap(/dev/mem) dance. However, it is
>>> you get mutual exclusion between>probably better to write an RTDM driver
>> using linux gpiolib. This way,
>
>> linux and xenomai.
>
> Do you mean I just access io memory like standard linux with following
> steps:
> fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1);
> map_base = mmap((void *)target, nSize, PROT_READ | PROT_WRITE,
> MAP_SHARED,fd, target)
> or there is something wrong with my understanding.If this is not the
> correct way please give me a simple example,thank you.
For an example of /dev/mem usage, see devmem2.c sources. For instance here:
http://www.mail-archive.com/busybox@domain.hid
We do not have an example of rt_misc_get_io_region() available.
--
Gilles.
prev parent reply other threads:[~2011-08-29 12:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 7:43 [Xenomai-help] how to use rt_io_get_region function on AT91SAM9263 in user space yi zheng
2011-08-29 11:24 ` Gilles Chanteperdrix
2011-08-29 12:09 ` yi zheng
2011-08-29 12:22 ` Gilles Chanteperdrix [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E5B8489.5080000@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@xenomai.org \
--cc=yizheng23@domain.hid \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.