devreqst.c 5.68 KB
/*HEADER******************************************************************
**************************************************************************
*** 
*** Copyright (c) 2001-2002 ARC International.
*** All rights reserved                                          
***                                                              
*** This software embodies materials and concepts which are      
*** confidential to ARC International and is made
*** available solely pursuant to the terms of a written license   
*** agreement with ARC International             
***
*** $Workfile:devreqst.c$
*** $Revision: 1.2 $
*** $Date: 2003/05/08 03:44:09 $
***
*** Description:      
***   This file contains the Device Framework Requests
***                                                               
**************************************************************************
*END*********************************************************************/

#include "osint.h"
#include "host.h"

USB_SETUP tx_get_status =
{
   0x80,    /* device-to-host, 0x80: default, 0x81: Interface, 0x82: Endpoint*/
   0,       /* Get Status */
   0,       /* wValue: 0: Default */
   0,       /* wIndex: 0, Interface or Endpoint */
#ifdef BIG_ENDIAN
   0x0200   /* wLength: 2 bytes */
#else
   2        /* wLength: 2 bytes */
#endif
};

USB_SETUP tx_clear_feature =
{
   0x00,    /* host-to-device, 0: default, 1: Interface, 2: Endpoint */
   1,       /* Clear Feature */
   0,       /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup */
   0,       /* wIndex: 0, Interface or Endpoint */
   0        /* wLength */
};

USB_SETUP tx_set_feature =
{
   0,       /* host-to-device, 0: default, 1: Interface, 2: Endpoint */
   3,       /* Set Feature */
#ifdef BIG_ENDIAN
   0x0300, /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup,b_hnp_enable  */
#else
   3,       /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup,b_hnp_enable  */
#endif
   0,       /* wIndex: 0, Interface or Endpoint */
   0        /* wLength */
};

USB_SETUP tx_set_address =
{
   0,       /* host-to-device */
   5,       /* Set Address */
   0,       /* wValue: Device address to assign */
   0,       /* wIndex: 0 */
   0        /* wLength */
};

USB_SETUP tx_get_desc =
{
   0x80,    /* device-to-host */
   6,       /* Get Descriptor */
#ifdef BIG_ENDIAN
   0x0001,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x1200   /* wLength: Descriptor Length */
#else
   0x0100,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x0012   /* wLength: Descriptor Length */
#endif
};

USB_SETUP tx_get_config_desc =
{
   0x80,    /* device-to-host */
   6,       /* Get Descriptor */
#ifdef BIG_ENDIAN
   0x0002,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x4000   /* wLength: Descriptor Length */
#else
   0x0200,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x0040   /* wLength: Descriptor Length */
#endif
};

USB_SETUP tx_set_desc =
{
   0,       /* device-to-host */
   7,       /* Set Descriptor */
#ifdef BIG_ENDIAN
   0x0001,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x1200   /* wLength: Descriptor Length */
#else
   0x0100,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x0012   /* wLength: Descriptor Length */
#endif
};

USB_SETUP tx_get_config =
{
   0x80,    /* device-to-host */
   8,       /* Get Config */
   0,       /* wValue: 0: default */
   0,       /* wIndex: 0 = Default */
#ifdef BIG_ENDIAN
   0x0100   /* wLength: 1 byte */
#else
   1        /* wLength: 1 byte */
#endif
};

USB_SETUP tx_set_config =
{
   0,       /* host-to-device */
   9,       /* Set Config */
#ifdef BIG_ENDIAN
   0x0100,  /* wValue: Configuration value */
#else
   1,       /* wValue: Configuration value */
#endif
   0,       /* wIndex: 0 */
   0        /* wLength */
};

USB_SETUP tx_get_interface =
{
   0x81,    /* device-to-host */
   0x0A,    /* Get Interface */
   0,       /* 0: default */
   0,       /* wIndex: Interface */
#ifdef BIG_ENDIAN
   0x0100,  /* wLength: 1 byte */
#else
   1,       /* wLength: 1 byte */
#endif
};

USB_SETUP tx_set_interface =
{
   0x21,    /* host-to-device, class, other */
   0x0B,    /* Set Interface */
   0,       /* wValue: Alternate Setting */
   0,       /* wIndex: Zero or Interface or Endpoint (1 for port 1) */
   0,       /* wLength */
};

USB_SETUP tx_synch_frame =
{
   0x82,    /* device-to-host */
   0x0C,    /* Synch Frame */
   0,       /* wValue: 0: Default */
   0,       /* wIndex: Endpoint */
#ifdef BIG_ENDIAN
   0x0200   /* wLength: 2 bytes */
#else
   2        /* wLength: 2 bytes */
#endif
};

/* Example of a Vendor Specific Request */
USB_SETUP tx_enable_echo =
{
   0x40,    /* Vendor Specific request */
   0x02,
#ifdef BIG_ENDIAN
   0x1d00,  /* wValue:  */
   0x0100,  /* wIndex: Endpoint */
#else
   0x001d,  /* wValue:  */
   0x0001,  /* wIndex: Endpoint */
#endif
   0x0000   /* wLength: 0 bytes */
};