Hi Hansi, Thanks for the explanation. Here's the python code I’m trying to port over to FPC: https://github.com/wolfmanjm/kivy-smoothie-host/blob/master/modules/hb04.py
it uses functions like hid.open, hid.close, hid.read, hid.write, and hid.send_feature_report I'm trying to figure out how to somehow get similar functions to those in FPC. Some example of how to perform those kinds of functions would be extremely helpful! Thank you for your help with this James -----Original Message----- From: fpc-pascal <fpc-pascal-boun...@lists.freepascal.org> On Behalf Of Johann Glaser Sent: Friday, August 9, 2019 7:17 AM To: fpc-pascal@lists.freepascal.org Subject: Re: [fpc-pascal] USB Human Interface Devices 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" <ja...@productionautomation.net> > An: "'FPC-Pascal users discussions'" <fpc-pascal@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@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal