devreqst.c 4.83 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.1 $
*** $Date: 2003/02/17 20:49:00 $
***
*** Description:      
***   This file contains the Device Framework Requests
***                                                               
**************************************************************************
*END*********************************************************************/
#include "types.h"
#include "hostapi.h"
#include "test_h.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 */
   2        /* wLength: 2 bytes */
};

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 */
   3,       /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup,b_hnp_enable  */
   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 */
   0x0100,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x12     /* wLength: Descriptor Length */
};

USB_SETUP tx_get_string_desc =
{
   0x80,    /* device-to-host */
   6,       /* Get Descriptor */
   0x0300,  /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration, 
            ** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index 
            */
   0,       /* wIndex: 0 (or language ID) */
   0x12     /* wLength: Descriptor Length */
};

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

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

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

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

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

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 */
   2        /* wLength: 2 bytes */
};

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