test.h 1.48 KB
#ifndef __test_h__
#define __test_h__
/*HEADER******************************************************************
**************************************************************************
*** 
*** Copyright (c) Precise Software Technologies Incorporated
*** All rights reserved
***
*** This software is provided under license and contains proprietary
*** and confidential material which is the property of VAutomation Inc.
*** HTTP://www.vautomation.com
***
*** $Workfile: test.h$
*** $Revision: 1.1 $
*** $Date: 2003/02/17 20:49:00 $
***
*** Description:      
***  This file contains the USB 1.1 benchmark example.
***                                                               
***
**************************************************************************
*END*********************************************************************/

/* USB 1.1 Setup Packet */
typedef struct setup_struct {
   uint_8      REQUESTTYPE;
   uint_8      REQUEST;
   uint_16     VALUE;
   uint_16     INDEX;
   uint_16     LENGTH;
} SETUP_STRUCT, _PTR_ SETUP_STRUCT_PTR;

#define MIN(a,b) ((a) < (b) ? (a) : (b))      

#define BUFFERSIZE      1023

typedef struct double_buffer_struct { /* Body */
   uint_8      buffer[2][BUFFERSIZE];
   boolean     whichbuffer;
} DOUBLE_BUFFER_STRUCT, _PTR_ DOUBLE_BUFFER_STRUCT_PTR;

#define INIT_DBUF(x)    ((x.whichbuffer) = 0)
#define TOGGLE_DBUF(x)  ((x.whichbuffer) ^= 1)
#define DBUF(x)         (x.buffer[x.whichbuffer])
      
#endif
/* EOF */