CUsbpCyUSB Class Reference

#include <usbp_cyusb.h>

Inheritance diagram for CUsbpCyUSB:

iUSB_Driver

Public Member Functions

 CUsbpCyUSB ()
virtual ~CUsbpCyUSB ()
int deviceInfo (void)
 For now simply prints out a bunch of information about the USB bus that is using the CyUSB driver.
int deviceInfo (int vid, int pid)
 Get information about a particular device.
int deviceOpen (int vid, int pid)
int deviceStatus (void)
int deviceCheck (void)
int deviceClose (int vid, int pid)
int controlWrite (byte reqCode, unsigned short value, unsigned short index, byte *b, int len, int timeout)
 Control Interface.
int bulkRead (int ep, int size, byte *b)
 Read a bulk transfer.
int bulkWrite (int ep, int size, byte *b)
 Bulk write a data block.
int bulkWriteRead (int ep_out, int ep_in, int size, byte *b)
 Read a bulk transfer after a write.
int assignEpt (void)
 Assign the endpoints to a class global buffer for now.

Data Fields

CCyUSBDevice * USBDevice
CCyUSBEndPoint * OutEndpt
 Endpoints on the Cypress, Note endpoints are alwasy from the host (PC) perspective.
CCyUSBEndPoint * InEndpt

Detailed Description

Definition at line 39 of file usbp_cyusb.h.


Constructor & Destructor Documentation

CUsbpCyUSB::CUsbpCyUSB (  )  [inline]

Definition at line 63 of file usbp_cyusb.h.

References InEndpt, OutEndpt, and USBDevice.

virtual CUsbpCyUSB::~CUsbpCyUSB (  )  [inline, virtual]

Definition at line 73 of file usbp_cyusb.h.

References USBDevice.


Member Function Documentation

int CUsbpCyUSB::deviceInfo ( void   )  [virtual]

For now simply prints out a bunch of information about the USB bus that is using the CyUSB driver.

May be smart in the future to change not to print directly. May use fprintf(sdtout, ""); or something so it can be redirected. Or return a string buffer, so it can be used in a GUI. Maybe add String msg, to each function?

Todo:
StatusReport or Logging, no printfs!!

Implements iUSB_Driver.

Definition at line 50 of file usbp_cyusb.cpp.

References UPL_OK, UPL_USB_ERR, and USBDevice.

Referenced by bulkRead(), and bulkWrite().

int CUsbpCyUSB::deviceInfo ( int  vid,
int  pid 
) [virtual]

Get information about a particular device.

Implements iUSB_Driver.

Definition at line 112 of file usbp_cyusb.cpp.

References UPL_OK.

int CUsbpCyUSB::deviceOpen ( int  vid,
int  pid 
) [virtual]

Implements iUSB_Driver.

Definition at line 124 of file usbp_cyusb.cpp.

References assignEpt(), UPL_ERR, UPL_OK, and USBDevice.

int CUsbpCyUSB::deviceStatus ( void   )  [virtual]

Implements iUSB_Driver.

Definition at line 168 of file usbp_cyusb.cpp.

References UPL_OK, and USBDevice.

int CUsbpCyUSB::deviceCheck ( void   )  [virtual]

Implements iUSB_Driver.

Definition at line 186 of file usbp_cyusb.cpp.

References UPL_OK.

int CUsbpCyUSB::deviceClose ( int  vid,
int  pid 
) [virtual]

Implements iUSB_Driver.

Definition at line 198 of file usbp_cyusb.cpp.

References UPL_OK, and USBDevice.

int CUsbpCyUSB::controlWrite ( byte  reqCode,
unsigned short  value,
unsigned short  index,
byte b,
int  len,
int  timeout 
) [virtual]

Control Interface.

Implements iUSB_Driver.

Definition at line 220 of file usbp_cyusb.cpp.

References UPL_ERR, UPL_OK, UPL_USB_ERR, and USBDevice.

int CUsbpCyUSB::bulkRead ( int  ep,
int  size,
byte b 
) [virtual]

Read a bulk transfer.

Implements iUSB_Driver.

Definition at line 302 of file usbp_cyusb.cpp.

References deviceInfo(), UPL_ERR, and UPL_OK.

int CUsbpCyUSB::bulkWrite ( int  ep,
int  size,
byte b 
) [virtual]

Bulk write a data block.

Implements iUSB_Driver.

Definition at line 267 of file usbp_cyusb.cpp.

References deviceInfo(), UPL_ERR, and UPL_OK.

int CUsbpCyUSB::bulkWriteRead ( int  ep_out,
int  ep_in,
int  size,
byte b 
) [virtual]

Read a bulk transfer after a write.

Implements iUSB_Driver.

Definition at line 337 of file usbp_cyusb.cpp.

References UPL_OK.

int CUsbpCyUSB::assignEpt ( void   )  [virtual]

Assign the endpoints to a class global buffer for now.

Implements iUSB_Driver.

Definition at line 349 of file usbp_cyusb.cpp.

References UPL_OK, and USBDevice.

Referenced by deviceOpen().


Field Documentation

CCyUSBDevice* CUsbpCyUSB::USBDevice

Definition at line 52 of file usbp_cyusb.h.

Referenced by assignEpt(), controlWrite(), CUsbpCyUSB(), deviceClose(), deviceInfo(), deviceOpen(), deviceStatus(), and ~CUsbpCyUSB().

CCyUSBEndPoint* CUsbpCyUSB::OutEndpt

Endpoints on the Cypress, Note endpoints are alwasy from the host (PC) perspective.

IN - into the PC, OUT - out from the PC. EP0 - Control Endpoint, OUT/IN, 64-byte buffer EP1IN - 64 byte bulk or interrupt EP1OUT - 64 byte bulk or interrupt EP2,6 - 2 OUT, 6 IN EP4,8 - 4 OUT, 8 IN

Definition at line 60 of file usbp_cyusb.h.

Referenced by CUsbpCyUSB().

CCyUSBEndPoint* CUsbpCyUSB::InEndpt

Definition at line 61 of file usbp_cyusb.h.

Referenced by CUsbpCyUSB().


The documentation for this class was generated from the following files:
Generated on Mon Mar 5 20:44:21 2007 for usbp by  doxygen 1.5.1-p1