[fpc-pascal] USB Human Interface Devices
Johann Glaser
Johann.Glaser at gmx.at
Fri Aug 9 13:17:16 CEST 2019
Hi!
Just a quick reply while at work, I'll reply to all EMails in the evening.
First of all: Thanks for finding the bug with the index variable I vs. J. I'll fix that in the evening.
Secondly: You are correct, the "EZ-USB" is a specific chip family by Cypress, e.g., AN2131, without Flash/ROM but with SRAM for the firmware. I built a few devices with that chip, therefore I also implemented the Pascal "driver" to download the firmware into the "naked" device. There are also many (old) devices on the marked which use that chip, e.g., the Keil uLink (1st generation).
To understand how USB actually works (endpoints, in and out transfers, control/bulk/interrupt/isochronous transfers, ...), I have learned a lot from the Technical Reference Manual (TRM) of the EZ-USB. Just search for it, there are plenty of sources. Chapter 1 is the interesting one. If you directly search at the Cypress page, they will redirect you to the successor product FX2, but its chapter 1 is nearly identical to that of EZ-USB.
The EZ-USB firmware download is performed with control transfers to EP0. So you can find examples for control transfers in ezusb.pas.
You can find example code for bulk and interrupt endpoints e.g., in https://github.com/hansiglaser/pas-gpib/blob/master/usb/usbtmc.pas.
I can provide more examples in the evening.
Bye
Hansi
> Gesendet: Freitag, 09. August 2019 um 12:09 Uhr
> Von: "James Richters" <james at productionautomation.net>
> An: "'FPC-Pascal users discussions'" <fpc-pascal at lists.freepascal.org>
> Betreff: Re: [fpc-pascal] USB Human Interface Devices
>
> Maybe I am going down the wrong path trying to get test_arduino_with_bmp280.pas to work with my device... I think I am confusing easyusb with easyhid which is what is used to communicate with the device in the python code I am trying to use. It looks like easyusb is to send firmware to a specific usb device that has no rom in it... and that's not exactly what I'm trying to do...
>
> I'm trying to figure out how to open the device and read data and write data to this device. Is there an example of how to do that with pas-libusb?
>
> Sorry I am so confused by all this. I feel like I'm almost to where I will understand things again but I'm just missing something.
>
> James
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
More information about the fpc-pascal
mailing list