I posted this on the lazarus list but they suggested to send it to the FPC list instead in order to possibly get better answers...
Mailing lists / fpc-pascal / 2011-03
Re: Accessing USB HID from Lazarus programs?
9 messages · 6 people · –
- BBo Berglund 3
- MMark Morgan Lloyd 2
- HHenry Vermaak 1
- LLukasz Sokol 1
- MMarco van de Voort 1
- SSven Barth 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Bo Berglund wrote 21 lines
What you seen hidapi?
http://www.signal11.us/oss/hidapi/
You will probably have to translate the headers.
Henry
Henry Vermaak wrote 28 lines
Thanks, interesting read. I looked over what I thought would be the valid items and also tested the included enumeration test project, which found my keyboard, mouse and Microchip PicKit3 programmer. So far so good....
But it looks like this is C or C++ stuff.... :-(
Is there any FPC translation anywhere?
I don't believe I can translate the C stuff properly myself to FPC.
I posted this on the lazarus list but they suggested to send it to the FPC list instead…
Bo Berglund wrote 30 lines
I'm accessing a Velleman K8055, which I think fits your description, using libusb etc. I used Uwe Zimmerman's port of libusb http://wiki.lazarus.freepascal.org/Hardware_Access#USB with very minor changes, I used some C sources as examples but can't remember which- possibly http://libk8055.sourceforge.net/
On Sun, 20 Mar 2011 19:47:28 +0000, Henry Vermaak Thanks, interesting read. I looked over…
Bo Berglund wrote 18 lines
In Turbo Delphi I have successfully used the headers found in JEDI project. They're very Windows specific thou, as it captures system messages fwd to forms. Haven't tried to use in Lazarus or multi-platform yet.
L.
On Sun, 20 Mar 2011 19:47:28 +0000, Henry Vermaak Thanks, interesting read. I looked over…
Bo Berglund wrote 42 lines
You can try to use h2pas, a tool which is distributed together with FPC. It reads a C header file and outputs a Pascal file that contains the bindings for the C library.
For the manual see here:
http://www.freepascal.org/tools/h2pas.var
For a little how to see here:
http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries
If it reports errors you should report back here as not every C construct is understood by the tool.
Regards,
Sven
I posted this on the lazarus list but they suggested to send it to the FPC list instead…
In our previous episode, Bo Berglund said:
I posted this on the lazarus list but they suggested to send it to the FPC list instead in order to possibly get better answers...
While I use dspic33F now, that is exclusively with serial. (232/422). In the past I did use USB though with PIC18, and the microchip USB SDK had a delphi example for that?
So I would check if pic18 and pic24 USB kits use the same dlls on the PC side, and then use the headers and example from the SDK.
I'm accessing a Velleman K8055, which I think fits your description, using libusb etc. I…
Mark Morgan Lloyd wrote 6 lines
On the page it says:
libusb
A cross platform possibility for Linux, BSDs and Mac OS X is libusb
Does this mean it won't work on Windows?
I can't test right now cause I am travelling today.
Bo Berglund wrote 15 lines
There's a port of libusb for Windows. I half-heartedly tried my code a couple of years ago against NT with the Edgeport USB stack but it failed due to a missing kernel call, I've not tried it with a newer version of Windows (i.e. one with the WDM) but I'd suggest it would be worth investigating.
