From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Victor Hiairrassary <victor.hiairrassary.ml@gmail.com>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] How to use rtdm_(io/m)map_to_user
Date: Tue, 23 Apr 2013 20:29:15 +0200 [thread overview]
Message-ID: <5176D2FB.8050101@xenomai.org> (raw)
In-Reply-To: <E3B5BC29-0015-4473-B5F5-304EEAEC8122@gmail.com>
On 04/23/2013 02:50 PM, Victor Hiairrassary wrote:
>
>
> On 23 avr. 2013, at 13:25, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>>
>> This is wrong. The "abstraction layer" used by an application
>> should be the usual driver interface open/read/write/ioctl and mmap
>> if there are high volumes of data to exchange with the application.
>> Access to the registers should be confined to the driver
>> implementation.
>>
>
> The hardware is a FPGA which expose 1024 registers. Currently to read
> or write in a register, we use mmap. How use them with read/write
> file operations of this registers? i.e. in userspace, once mmaped on
> an ptr, we do : ptr[addr] = value. How achieve this with write
> operation, because write accepts only a value ?
The register access is almost certainly the wrong abstraction layer.
If you need writing to registers 2 to 13 starts a motor, then, there
should be an ioctl START_THE_MOTOR, which implementation in RTDM driver
writes to registers 2 to 13. In other words, without knowing what you do
with this FPGA there is no way to answer.
Anyway, if the 1024 registers are 1024 parameters of the FPGA which you
need to configure individually, you can create an ioctl with a structure
where you pass the register number and the value.
--
Gilles.
next prev parent reply other threads:[~2013-04-23 18:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 13:10 [Xenomai] How to use rtdm_(io/m)map_to_user Victor Hiairrassary
2013-04-23 11:25 ` Gilles Chanteperdrix
2013-04-23 12:50 ` Victor Hiairrassary
2013-04-23 18:29 ` Gilles Chanteperdrix [this message]
2013-04-24 16:38 ` Victor Hiairrassary
2013-04-24 19:37 ` Gilles Chanteperdrix
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=5176D2FB.8050101@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=victor.hiairrassary.ml@gmail.com \
--cc=xenomai@xenomai.org \
/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.