DeviceIOControl and Linux libusb/cyusb libraries

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

cross mob
Anonymous
Not applicable

Hello!

   

The problem is, that I'm trying to rewrite my existing Windows program to Linux. The program uses DeviceIoControl() function to communicate with the CY7C68013A controller. I used it like this:
           
            VENDOR_OR_CLASS_REQUEST_CONTROL    myRequest;
            int nBytes = 0;
            myRequest.direction = 0x00;
            myRequest.index = 0xBEEF;
            myRequest.recepient = 0x00;
            myRequest.request = 0xA2;
            myRequest.requestType = 0x02;
            myRequest.requestTypeReservedBits = 0x01;
            myRequest.value = 0x007F & addr_I2C;
           
            DeviceIoControl (handle,
                                           IOCTL_EZUSB_VENDOR_OR_CLASS_REQUEST,
                                           &myRequest,
                                           sizeof(VENDOR_OR_CLASS_REQUEST_CONTROL),
                                           buffer,
                                           bufferSize,
                                           (unsigned long *)&nBytes,
                                           NULL);

to set some control data into the device, and

                BULK_TRANSFER_CONTROL bulkControl;
                DWORD ioctl_val = IOCTL_EZUSB_BULK_READ;
                int nBytes = 0;
                bulkControl.pipeNum = 2;
                DeviceIoControl (handle,
                                                ioctl_val,
                                               &bulkControl,
                                               sizeof (BULK_TRANSFER_CONTROL),
                                               buffer,
                                               MAX_DATA_SIZE,
                                               (unsigned long *)&nBytes,
                                               NULL);

to get some bulk data from the device.
Now I'd like to rewrite these code fragments to Linux using libusb or cyusb libraries. Could you help me, please, to find any information source that shows the existing code analogs of Win32 and Linux libusb/cyusb for the CY7C68013A controller programming?

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

   

 

   

Please install EZ-USB FX3 SDK v1.2.3 for Linux from http://www.cypress.com/?rID=57990. That has many examples.

   

 

   

Regards,

   

Gayathri

0 Likes