Read/write to/from a CY7C68013A-56LFXC device | Cypress Semiconductor
Read/write to/from a CY7C68013A-56LFXC device
Sorry for the novice question, but I am really struggling to read data from the device! I am somewhat new to C++ and
completely new to USB configurations and protocols.
Could any one provide me with a sample code of how to write to the device (CY7C68013A-56LFXC) in bulk mode?
I am able to detect the device and read some arbitrary USB settings, but I am unsure of what values to set
to be able to read and write to the device. I am accessing an ADI device - they used this chip to talk to it.
Maybe it is their firmware stoppping me? What I would like is a *standard* sample sequence of how a USB port would be set up using the chip as mentioned in the subject.
This is what I have done so far (in a nutshell):
CCyUSBDevice* USBDevice = new CCyUSBDevice(NULL);
// Find out how many devices the class is connecting to
USHORT usNoOfDevices = USBDevice->DeviceCount(); // The one device opens successfully
// if (USBDevice->BulkOutEndPt) // THIS IS ALWAYS FALSE! (?)
unsigned char buf = "11111";
LONG length = 5;
OVERLAPPED *ov = NULL;
// CCyUSBEndPoint *pInEndpt = NULL;
// pInEndpt = USBDevice->BulkInEndPt->BeginDataXfer(puchDataPacket, length, NULL); // Memory access violation
// if (USBDevice->BulkInEndPt->XferData(buf, length)) // Memory access violation
// Do stuff
Why is USBDevice->BulkOutEndPt alwyas false? I think I am not setting certain parameters correctly. I must read/write the
data in bulk mode, so what endpoint must/can I use? And what parameters must I set do successfully do this?
Sample code would really help, I am not a "copy/paster" but would understand it easier when I see working code.
The sample provided by the USB suite includes GUI apps and I can not see the code I want from in there (I guess I must try harder?).