* [Xenomai-help] how to use rt_io_get_region function on AT91SAM9263 in user space
@ 2011-08-29 7:43 yi zheng
2011-08-29 11:24 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: yi zheng @ 2011-08-29 7:43 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 551 bytes --]
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()?
Anybody knows how to use it,please tell me. It is best if there is a little
example.IF there is another way to access memory for user space application
on arm, please let me know.Thank you.
regards
yizheng
[-- Attachment #2: Type: text/html, Size: 2277 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] how to use rt_io_get_region function on AT91SAM9263 in user space
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
0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2011-08-29 11:24 UTC (permalink / raw)
To: yi zheng; +Cc: xenomai
On 08/29/2011 09:43 AM, 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
probably better to write an RTDM driver using linux gpiolib. This way,
you get mutual exclusion between linux and xenomai.
--
Gilles.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] how to use rt_io_get_region function on AT91SAM9263 in user space
2011-08-29 11:24 ` Gilles Chanteperdrix
@ 2011-08-29 12:09 ` yi zheng
2011-08-29 12:22 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: yi zheng @ 2011-08-29 12:09 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
>
> >> 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.
> >--
> > Gilles.
>
regards
yizheng
[-- Attachment #2: Type: text/html, Size: 2467 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] how to use rt_io_get_region function on AT91SAM9263 in user space
2011-08-29 12:09 ` yi zheng
@ 2011-08-29 12:22 ` Gilles Chanteperdrix
0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2011-08-29 12:22 UTC (permalink / raw)
To: yi zheng; +Cc: xenomai
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-29 12:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.