in reply to Digilent Inc. Analog Discovery

Did something like this (but for U2F authentication). It's not that hard, but depending on the library you Do have to play around with C code a bit.

Thankfully, most libraries also come with a open source example on how to use them, most likely some test program that let's you exercise all (or most) hardware function.

So, first thing i usually do is to write a small, low level wrapper library around the original library by hacking up the example code. This will give me the option of abstracting away stuff like memory managment.

On this, my low level wrapper library, i run h2xs to turn it into a low level Perl module. Depending on what i want to do with that, most of the time i create a high level Perl module around THAT to have nice and easy access.

You can kind of see that in Crypt::U2F (which reminds me i have to fix some things and release a new version).

If there's interest, i'll be willing to write up a step-by-step description as a meditation. (Since it's a lot of work, knowing that there is at least one interested reader would be nice).

"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."

Replies are listed 'Best First'.
Re^2: Digilent Inc. Analog Discovery
by jmlynesjr (Deacon) on Jun 12, 2015 at 16:09 UTC

    cavac, I am an interested reader! I have read the h2xs man page. It's a little cryptic with many options. I haven't tried to run it yet. I will look at Crypt::U2F in a few minutes.

    The shared library(libdwf.so.2.7.5) has 80 +/- functions and the header file(dwf.h) defines many constants. A custom USB driver is also provided. This driver has been tested on Ubuntu up to 12.xx, so it should be ok on my 14.04 system.

    Thank you for your

    James

    There's never enough time to do it right, but always enough time to do it over...

      The cross-platform software, WaveForms3 is under development:
      https://forum.digilentinc.com/topic/98-waveforms3-beta/

        Excellent! Thank you kovacslattila for this reference. It's amazing what off-topic topics the Monks here can contribute to.

        James

        There's never enough time to do it right, but always enough time to do it over...

      Ok, i'll do my best to come up with a step-by-step walkthrough on how to h2xs a small library. May take a few days, though, what with the weekend comming up and all (my office at home isn't climate controlled and it's a gazillion degrees out there).

      Will post here when i'm finished.

      "For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."