How does CyAPI.lib do away with one needing to know about Windows Driver Foundation?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
okhajut
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

My investigation so far into windows drivers is that, it is a highly arcane field with little information available on the internet. Writing drivers was a punishing concept when Windows Driver Model (WDM) was used to write them. The Windows Driver Foundation (WDF) is supposed to have simplified this process. However, it is still a considerably difficult task to become good at.

The FX3 can be used to create superspeed USB peripherals. A USB peripheral is useless if it can't work with a host. Cypress have created CyAPI.lib for use with C++ applications. I have a few questions about this specifically.

1. How exactly does CyAPI.lib insulate a user from knowing how USB drivers are written and in doing so how does it save a person from a necessity to learn WDF?

2. Is CyAPI.lib also compatible with Linux? If not, what options exist to make an FX3 peripheral work in Linux?

3. What are limitations of CyAPI.lib which will require that a person write their own custom drivers using WDF?

4. Are CyUSB.dll used with .NET applications, and the CyAPI.lib fundamentally the same or were written differently from scratch while providing identical API?

5. Why can't CyAPI.lib take place of WDF drivers for all USB peripherals? 

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I understood from your question that How is CyUSB3.sys being able to support different functionalities of FX3, like streamer example device, bulkloop example device etc having different endpoints. Is my understanding correct?
If yes, vendor driver like CyUSB3.sys gets bound to a device based on the VID PID of the device. The .inf file has a list of VID and PID for which the driver can bind to.

Also, the vendor driver supports all the USB functions independent of the number of endpoints and their characteristics.

Best Regards,
AliAsgar

View solution in original post

3 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi

1. CyAPI.lib is a high level programming interface to the CyUSB3.sys device driver. CyUSB3.sys driver in turn talks with the USB driver.

2. CyAPI.lib is not compatible with Linux. Instead we use the standard libusb library to communicate with USB devices on Linux.

3. Please refer to Page No. 222 of CyAPI.pdf document provided with the FX3 SDK.

4. I will get back to you on this. 

5. CyAPI.lib is meant to give a high level abstraction for only the CyUSB3.sys driver. Hence, it can not take place of WDF drivers for all USB peripherals.

Best Regards,
AliAsgar

okhajut
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

To my knowledge, WPF drivers would have to be written for devices that are not of a standard type like HID Mouse, Camera e.t.c. The FX3 is flexible in what we implement. Thus, I would expect a new driver to be written for each new peripheral created using the FX3. How then is it that the same CyUSB3.sys driver can work regardless of how many endpoints we use in our design and how those endpoints are configured i.e bulk, interrupt e.t.c ???

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I understood from your question that How is CyUSB3.sys being able to support different functionalities of FX3, like streamer example device, bulkloop example device etc having different endpoints. Is my understanding correct?
If yes, vendor driver like CyUSB3.sys gets bound to a device based on the VID PID of the device. The .inf file has a list of VID and PID for which the driver can bind to.

Also, the vendor driver supports all the USB functions independent of the number of endpoints and their characteristics.

Best Regards,
AliAsgar