[etherlab-users] Real datatypes

Jeroen Van den Keybus jeroen.vandenkeybus at gmail.com
Thu Oct 9 17:27:38 CEST 2014


>  Anyone here have some experience with this datatype?
>

We have done something similar to the existing access functions:

#define EC_READ_SINGLE(DATA)    ((float)(*((float *)((DATA)))))
#define EC_WRITE_SINGLE(DATA, VAL) \
do { \
    *((float*) ((DATA))) = (float) (VAL); \
} while (0)


Note that the byte order may be different. In that case you can use
cpu_to_le32 and friends. For us it worked since we also made the slave that
generated the data.


J.


>
>  Thanks,
>
>  Steven
>
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20141009/171d12cf/attachment-0004.htm>


More information about the Etherlab-users mailing list