cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

kwli_4638031
New Contributor

We are trying to upgrade our ezusb device(cy64613) to ezusb fx1(cy64713) for 64bit windows.

Our windows app has been developed using CBuilder2007.

1. Previously

For this old device control,

First got handle for device using CreateFile windows API

and used  deviceIOcontrol API with taken handle.

In our case for devicename \\\\.\\ezusb-0 is used

i.e.

Handle=CreateFile("\\\\.\\ezusb-0",.....) for getting handle.

Then

what  name has to be used for new device ezusb fx1 or fx2?

2. Referring to TRM

for getting device handle using CyAPI

     USBDevice= new CCyUSBDevice( );

can be used.

But

   When trying to above using CyAPI.lib(for BC6)( taken from installed Cypress Suite USB 3.4.7)

  Alaways access vilation error happened!!

Please help me!!!

Kenny Lim

1 Solution
YatheeshD_36
Moderator
Moderator

Hello,

Please use the CyAPI.lib from the FX3 SDK which contains the latest library files.

Once the FX3 SDK is installed you can find the library files in the path: <installation directory>\Cypress\EZ-USB FX3 SDK\1.3\library

The API document "CyAPI.pdf" is present in folder path: <installation directory>\Cypress\EZ-USB FX3 SDK\1.3\doc\SuiteUSB

Note: for the CyAPI.lib to be used, the device should be bound to the cypress cyusb3 driver.

Using the CyAPI library:

A device instance should be created using the CCyUSBDevice class.

example: CCyUSBDevice *FX2 = new CCyUSBDevice();

This will not return a handle to the device yet.

To get the handle to the device you can either use the Open() method  with the device number as an argument. If only one cypress device is connected to the host then you can direct pass 0 as an argument.

example:

if (!FX2->Open(0))

{

printf("open failed\n");

//exit(0);

}

printf("device opened\n");

Once the device is opened you can use the DeviceHandle() function to get an handle to the device opened.

example:

HANDLE handle = FX2->DeviceHandle();

Please refer to the attached host appication, which detects number of devices bound to the cyusb3 driver and opens device 0, prints the VID, PID in decimal and the number of endpoints, of the device connected.

Thanks,

Yatheesh

View solution in original post

0 Likes
1 Reply
YatheeshD_36
Moderator
Moderator

Hello,

Please use the CyAPI.lib from the FX3 SDK which contains the latest library files.

Once the FX3 SDK is installed you can find the library files in the path: <installation directory>\Cypress\EZ-USB FX3 SDK\1.3\library

The API document "CyAPI.pdf" is present in folder path: <installation directory>\Cypress\EZ-USB FX3 SDK\1.3\doc\SuiteUSB

Note: for the CyAPI.lib to be used, the device should be bound to the cypress cyusb3 driver.

Using the CyAPI library:

A device instance should be created using the CCyUSBDevice class.

example: CCyUSBDevice *FX2 = new CCyUSBDevice();

This will not return a handle to the device yet.

To get the handle to the device you can either use the Open() method  with the device number as an argument. If only one cypress device is connected to the host then you can direct pass 0 as an argument.

example:

if (!FX2->Open(0))

{

printf("open failed\n");

//exit(0);

}

printf("device opened\n");

Once the device is opened you can use the DeviceHandle() function to get an handle to the device opened.

example:

HANDLE handle = FX2->DeviceHandle();

Please refer to the attached host appication, which detects number of devices bound to the cyusb3 driver and opens device 0, prints the VID, PID in decimal and the number of endpoints, of the device connected.

Thanks,

Yatheesh

View solution in original post

0 Likes