/*
 Definitions of USB vendor requests. These need to show up in both firmware
 and host-side code.
 
 Copyright (c) 2008 Dimtel, Inc., All Rights Reserved

 $Id: vendor_commands.h,v 1.1 2013/06/03 17:40:13 dim Exp $
 $Date: 2013/06/03 17:40:13 $
 $Author: dim $
 $Revision: 1.1 $
 $Log: vendor_commands.h,v $
 Revision 1.1  2013/06/03 17:40:13  dim
 Initial import in src_common/

 Revision 1.2  2011/12/27 19:49:01  dim
 Removed extra comment closure

 Revision 1.1  2011/12/27 19:34:26  dim
 Initial import


*/

#ifndef _VENDOR_COMMANDS_H_
#define _VENDOR_COMMANDS_H_

/* 
  Request code 0xa0 is used for firmware up/download. Codes
  0xa1 - 0xaf are reserved by Cypress
*/
    
/* 
  Request codes are kept the same as xguff FW, so
  that usrper can talk to this FW, at least in
  some form. Also, xc3sprog can talk to xguff
*/

/* ---------- Read requests ----------- */
/*
  Read from I2C:
  wValueL:  address
  wLengthL: length 
  returns wLengthL bytes on success
*/
#define USB_REQ_VENDOR_I2C_READ		0x81
/*
  Shift out TMS and TDI, capture TDO:
  wValueL: bit 1 TMS, bit 0 TDI
  returns one byte, LSB - TDO
*/
#define USB_REQ_VENDOR_JTAG_RXTX	0x83
/* Read and reset USB error counter */
#define USB_REQ_VENDOR_GET_STATUS	0x80

/* --------- Write requests ----------- */
/* Shift a block of data out to TDI */
#define USB_REQ_VENDOR_JTAG		0x02
#define JTAG_FLAG_BLOCK			1
#define JTAG_FLAG_INIT			5
/*
  Write to I2C:
  wValueL:  address
*/
#define USB_REQ_VENDOR_I2C_WRITE	0x08
/* Pulse FPGA reset signal (interface reset) */
#define USB_REQ_VENDOR_FPGA_RESET	0x04

/* Firmware load request, handled by FX2 */
#define USB_REQ_VENDOR_FW_LOAD		0xa0

#define EP0_MAX_PKT_SIZE	64

#endif /* _VENDOR_COMMANDS_H_ */
