All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Use of a4l_dtoraw
@ 2011-07-29 13:44 julien.delange
  2011-08-01 21:44 ` Alexis Berlemont
  0 siblings, 1 reply; 9+ messages in thread
From: julien.delange @ 2011-07-29 13:44 UTC (permalink / raw)
  To: xenomai

Hello,

I try to use the RTDM API to communicate with my boards. In fact, I 
adapted a driver from comedi to RTDM ; the low-level aspects seem to work 
(meaning : when I send something on a channel, I see an output on this 
channel). However, now, I would like the analogy API to interact with my 
device. So, I'm wondering how the conversion functions work.

For example, for the a4l_dtoraw function, if some arguments are easy to 
understand, some others need more explanations. In particular,what means 
the cnt argument of this function and how should we use it ? Is there some 
example of the usage of the level 2 API of the analogy level ? It would 
really help in understanding how this API interacts with the boards.

Thanks in advance for any help regarding the use of this API.

Best regards,



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-07-29 13:44 [Xenomai-help] Use of a4l_dtoraw julien.delange
@ 2011-08-01 21:44 ` Alexis Berlemont
  2011-08-01 21:47   ` Alexis Berlemont
  0 siblings, 1 reply; 9+ messages in thread
From: Alexis Berlemont @ 2011-08-01 21:44 UTC (permalink / raw)
  To: julien.delange; +Cc: xenomai

Hi,

On Fri, Jul 29, 2011 at 3:44 PM,  <julien.delange@domain.hid> wrote:
> Hello,
>

Sorry for the late reply. I am currently on holidays.

> I try to use the RTDM API to communicate with my boards. In fact, I
> adapted a driver from comedi to RTDM ; the low-level aspects seem to work
> (meaning : when I send something on a channel, I see an output on this
> channel). However, now, I would like the analogy API to interact with my
> device. So, I'm wondering how the conversion functions work.
>
> For example, for the a4l_dtoraw function, if some arguments are easy to
> understand, some others need more explanations. In particular,what means
> the cnt argument of this function and how should we use it ?

The cnt argument means "count of double values to convert into raw
values" . Sorry, this was not very clear. I currently do not have time
to look back at the code and give you a detailed explanation. However,
I remember that:

If you want to use a4l_dtoraw, I think you have double float data you
want to inject in some output subdevice.
- Double value size is constant: let's say 64 bits.
- The size of a raw value to be injected depends on the subdevice you
use in your card, it can be 8bits, 16bits, 24bits or whatever.

I wanted a4l_dtoraw to be generic, so I decided that this function
should take as arguments the channel descriptor and the range
descriptor that the user will use. These descriptors can be retrieved
via a4l_get_chinfo and a4l_get_rnginfo (cf. examples in
src/utils/analogy/*.c) once the user has opened a device (with
a4l_open and a4l_fill_desc).

a4l_dtoraw takes also two more arguments an input buffer (src: the
double values) and an output buffer (dst: the raw values). Obviously,
these buffers do not have the same size but they are supposed to
contain the same count of values.

That is why I decided that the last argument was the count of values
to be converted (cnt). An alternative was to pass each buffer's size
but that implies using two arguments instead of one (two arguments to
pass a redundant piece of information because internally all I need is
the count of values to convert).

The user is, of course, in charge of passing large enough output
buffer. A helper function, a4l_sizeof_chan, is available to get the
size of a raw sample, if need be.

Thus, I think the user is able to develop generic user-space code
which does not depend on the acquisition board.

> Is there some
> example of the usage of the level 2 API of the analogy level ? It would
> really help in understanding how this API interacts with the boards.
>

In src/utils/analogy/cmd_read.c, I use a4l_rawtoul so as to correctly
display hexadecimal values (freshly acquired).
In src/utils/analogy/insn_read.c: I use a4l_rawtod if a range is
passed as argument.

> Thanks in advance for any help regarding the use of this API.
>
> Best regards,
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>

Alexis.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-01 21:44 ` Alexis Berlemont
@ 2011-08-01 21:47   ` Alexis Berlemont
  2011-08-02  8:09     ` julien.delange
  0 siblings, 1 reply; 9+ messages in thread
From: Alexis Berlemont @ 2011-08-01 21:47 UTC (permalink / raw)
  To: julien.delange; +Cc: xenomai

On Mon, Aug 1, 2011 at 11:44 PM, Alexis Berlemont
<alexis.berlemont@domain.hid> wrote:
> Hi,
>
> On Fri, Jul 29, 2011 at 3:44 PM,  <julien.delange@domain.hid> wrote:
>> Hello,
>>
>
> Sorry for the late reply. I am currently on holidays.
>
>> I try to use the RTDM API to communicate with my boards. In fact, I
>> adapted a driver from comedi to RTDM ; the low-level aspects seem to work
>> (meaning : when I send something on a channel, I see an output on this
>> channel). However, now, I would like the analogy API to interact with my
>> device. So, I'm wondering how the conversion functions work.
>>
>> For example, for the a4l_dtoraw function, if some arguments are easy to
>> understand, some others need more explanations. In particular,what means
>> the cnt argument of this function and how should we use it ?
>
> The cnt argument means "count of double values to convert into raw
> values" . Sorry, this was not very clear. I currently do not have time
> to look back at the code and give you a detailed explanation. However,
> I remember that:
>
> If you want to use a4l_dtoraw, I think you have double float data you
> want to inject in some output subdevice.
> - Double value size is constant: let's say 64 bits.
> - The size of a raw value to be injected depends on the subdevice you
> use in your card, it can be 8bits, 16bits, 24bits or whatever.
>
> I wanted a4l_dtoraw to be generic, so I decided that this function
> should take as arguments the channel descriptor and the range
> descriptor that the user will use. These descriptors can be retrieved
> via a4l_get_chinfo and a4l_get_rnginfo (cf. examples in
> src/utils/analogy/*.c) once the user has opened a device (with
> a4l_open and a4l_fill_desc).
>
> a4l_dtoraw takes also two more arguments an input buffer (src: the
> double values) and an output buffer (dst: the raw values). Obviously,
> these buffers do not have the same size but they are supposed to
> contain the same count of values.
>
> That is why I decided that the last argument was the count of values
> to be converted (cnt). An alternative was to pass each buffer's size
> but that implies using two arguments instead of one (two arguments to
> pass a redundant piece of information because internally all I need is
> the count of values to convert).
>
> The user is, of course, in charge of passing large enough output
> buffer. A helper function, a4l_sizeof_chan, is available to get the
> size of a raw sample, if need be.
>
> Thus, I think the user is able to develop generic user-space code
> which does not depend on the acquisition board.
>

I forgot to say that Doxygen documentation is available at:
http://www.xenomai.org/documentation/xenomai-2.5/html/api/index.html

Do not hesitate to tell me that it is not clear enough. Furthermore, I
welcome any enrichment of the documentation :)

>> Is there some
>> example of the usage of the level 2 API of the analogy level ? It would
>> really help in understanding how this API interacts with the boards.
>>
>
> In src/utils/analogy/cmd_read.c, I use a4l_rawtoul so as to correctly
> display hexadecimal values (freshly acquired).
> In src/utils/analogy/insn_read.c: I use a4l_rawtod if a range is
> passed as argument.
>
>> Thanks in advance for any help regarding the use of this API.
>>
>> Best regards,
>>
>>
>> _______________________________________________
>> Xenomai-help mailing list
>> Xenomai-help@domain.hid
>> https://mail.gna.org/listinfo/xenomai-help
>>
>
> Alexis.
>

Alexis.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-01 21:47   ` Alexis Berlemont
@ 2011-08-02  8:09     ` julien.delange
  2011-08-02  8:29       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 9+ messages in thread
From: julien.delange @ 2011-08-02  8:09 UTC (permalink / raw)
  To: Alexis Berlemont; +Cc: xenomai

Alexis Berlemont <alexis.berlemont@domain.hid> wrote on 01/08/2011 
23:47:39:
> Do not hesitate to tell me that it is not clear enough. Furthermore, I
> welcome any enrichment of the documentation :)

Dear Alexis,

I would be glad to propose patch and contribution to the documentation. 
Can you tell me how can I contribute ?
I noticed that also, the doc on the wiki could be improved so that I tried 
to register on the wiki but I cannot because the captcha function seems to 
be broken (I can see "Internal Error Requested bogus captcha image" when I 
tried to access the picture).

In addition, I submit a patch for new device. I have also code to be 
integrated within the src/rtdm skin. How can I submit my code ? Just a 
diff against the latest revision/release ?

Best,



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-02  8:09     ` julien.delange
@ 2011-08-02  8:29       ` Gilles Chanteperdrix
  2011-08-02 12:16         ` julien.delange
  2011-08-03  7:25         ` Gilles Chanteperdrix
  0 siblings, 2 replies; 9+ messages in thread
From: Gilles Chanteperdrix @ 2011-08-02  8:29 UTC (permalink / raw)
  To: julien.delange; +Cc: xenomai

On 08/02/2011 10:09 AM, julien.delange@domain.hid wrote:
> Alexis Berlemont <alexis.berlemont@domain.hid> wrote on 01/08/2011 
> 23:47:39:
>> Do not hesitate to tell me that it is not clear enough. Furthermore, I
>> welcome any enrichment of the documentation :)
> 
> Dear Alexis,
> 
> I would be glad to propose patch and contribution to the documentation. 
> Can you tell me how can I contribute ?
> I noticed that also, the doc on the wiki could be improved so that I tried 
> to register on the wiki but I cannot because the captcha function seems to 
> be broken (I can see "Internal Error Requested bogus captcha image" when I 
> tried to access the picture).

Ok, I will have a look at this mediawiki issue, the last upgrade
probably broke this.

> 
> In addition, I submit a patch for new device. I have also code to be 
> integrated within the src/rtdm skin. How can I submit my code ? Just a 
> diff against the latest revision/release ?

Even better, please use git and git send-email.

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-02  8:29       ` Gilles Chanteperdrix
@ 2011-08-02 12:16         ` julien.delange
  2011-08-02 12:35           ` Gilles Chanteperdrix
  2011-08-03  7:25         ` Gilles Chanteperdrix
  1 sibling, 1 reply; 9+ messages in thread
From: julien.delange @ 2011-08-02 12:16 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Dear all,

Unfortunately, I cannot use git since I have strong firewall policy on my 
connection. So, I think the best would be to send patch, no ?




From:
Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To:
julien.delange@domain.hid
Cc:
Alexis Berlemont <alexis.berlemont@domain.hid>, xenomai@xenomai.org
Date:
02/08/2011 10:29
Subject:
Re: [Xenomai-help] Use of a4l_dtoraw



On 08/02/2011 10:09 AM, julien.delange@domain.hid wrote:
> Alexis Berlemont <alexis.berlemont@domain.hid> wrote on 01/08/2011 
> 23:47:39:
>> Do not hesitate to tell me that it is not clear enough. Furthermore, I
>> welcome any enrichment of the documentation :)
> 
> Dear Alexis,
> 
> I would be glad to propose patch and contribution to the documentation. 
> Can you tell me how can I contribute ?
> I noticed that also, the doc on the wiki could be improved so that I 
tried 
> to register on the wiki but I cannot because the captcha function seems 
to 
> be broken (I can see "Internal Error Requested bogus captcha image" when 
I 
> tried to access the picture).

Ok, I will have a look at this mediawiki issue, the last upgrade
probably broke this.

> 
> In addition, I submit a patch for new device. I have also code to be 
> integrated within the src/rtdm skin. How can I submit my code ? Just a 
> diff against the latest revision/release ?

Even better, please use git and git send-email.

-- 
      Gilles.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-02 12:16         ` julien.delange
@ 2011-08-02 12:35           ` Gilles Chanteperdrix
  0 siblings, 0 replies; 9+ messages in thread
From: Gilles Chanteperdrix @ 2011-08-02 12:35 UTC (permalink / raw)
  To: julien.delange; +Cc: xenomai

On 08/02/2011 02:16 PM, julien.delange@domain.hid wrote:
> Dear all,
> 
> Unfortunately, I cannot use git since I have strong firewall policy on my 
> connection. So, I think the best would be to send patch, no ?

As you wish, but you can also clone the repository over http. Cloning
for instance:

http://git.xenomai.org/xenomai-head.git

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-02  8:29       ` Gilles Chanteperdrix
  2011-08-02 12:16         ` julien.delange
@ 2011-08-03  7:25         ` Gilles Chanteperdrix
  2012-02-29 18:52           ` Gilles Chanteperdrix
  1 sibling, 1 reply; 9+ messages in thread
From: Gilles Chanteperdrix @ 2011-08-03  7:25 UTC (permalink / raw)
  To: julien.delange; +Cc: xenomai

On 08/02/2011 10:29 AM, Gilles Chanteperdrix wrote:
> On 08/02/2011 10:09 AM, julien.delange@domain.hid wrote:
>> Alexis Berlemont <alexis.berlemont@domain.hid> wrote on 01/08/2011 
>> 23:47:39:
>>> Do not hesitate to tell me that it is not clear enough. Furthermore, I
>>> welcome any enrichment of the documentation :)
>>
>> Dear Alexis,
>>
>> I would be glad to propose patch and contribution to the documentation. 
>> Can you tell me how can I contribute ?
>> I noticed that also, the doc on the wiki could be improved so that I tried 
>> to register on the wiki but I cannot because the captcha function seems to 
>> be broken (I can see "Internal Error Requested bogus captcha image" when I 
>> tried to access the picture).
> 
> Ok, I will have a look at this mediawiki issue, the last upgrade
> probably broke this.

I failed to fix it quickly, so, I will try and fix it during the week-end.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Xenomai-help] Use of a4l_dtoraw
  2011-08-03  7:25         ` Gilles Chanteperdrix
@ 2012-02-29 18:52           ` Gilles Chanteperdrix
  0 siblings, 0 replies; 9+ messages in thread
From: Gilles Chanteperdrix @ 2012-02-29 18:52 UTC (permalink / raw)
  To: julien.delange; +Cc: xenomai

On 08/03/2011 09:25 AM, Gilles Chanteperdrix wrote:
> On 08/02/2011 10:29 AM, Gilles Chanteperdrix wrote:
>> On 08/02/2011 10:09 AM, julien.delange@domain.hid wrote:
>>> Alexis Berlemont <alexis.berlemont@domain.hid> wrote on 01/08/2011 
>>> 23:47:39:
>>>> Do not hesitate to tell me that it is not clear enough. Furthermore, I
>>>> welcome any enrichment of the documentation :)
>>>
>>> Dear Alexis,
>>>
>>> I would be glad to propose patch and contribution to the documentation. 
>>> Can you tell me how can I contribute ?
>>> I noticed that also, the doc on the wiki could be improved so that I tried 
>>> to register on the wiki but I cannot because the captcha function seems to 
>>> be broken (I can see "Internal Error Requested bogus captcha image" when I 
>>> tried to access the picture).
>>
>> Ok, I will have a look at this mediawiki issue, the last upgrade
>> probably broke this.
> 
> I failed to fix it quickly, so, I will try and fix it during the week-end.
> 
A "few" monthes later... I have managed to fix this, now registering a
new user to xenomai wiki should work again.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-29 18:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-29 13:44 [Xenomai-help] Use of a4l_dtoraw julien.delange
2011-08-01 21:44 ` Alexis Berlemont
2011-08-01 21:47   ` Alexis Berlemont
2011-08-02  8:09     ` julien.delange
2011-08-02  8:29       ` Gilles Chanteperdrix
2011-08-02 12:16         ` julien.delange
2011-08-02 12:35           ` Gilles Chanteperdrix
2011-08-03  7:25         ` Gilles Chanteperdrix
2012-02-29 18:52           ` 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.