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/[email protected]/msg01355.html

We do not have an example of rt_misc_get_io_region() available.

-- 
                                            Gilles.


_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to