1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/e32/inc/USBConstants.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,142 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +// This contains namespace USB
1.21 +
1.22 +#ifndef USBCONSTANTS_H
1.23 +#define USBCONSTANTS_H
1.24 +
1.25 +/**
1.26 + * Namespace for constant variables and data types, common to USBerian
1.27 + */
1.28 +namespace USB
1.29 + {
1.30 + /**
1.31 + * USB logical device driver name
1.32 + * */
1.33 + #ifdef __WINS__
1.34 + _LIT(KLDDName, "testusbc");
1.35 + #else
1.36 + _LIT(KLDDName, "eusbc");
1.37 + #endif
1.38 +
1.39 + /**
1.40 + * Endpoint type constants - Short descriptions of types
1.41 + (see USB 2.0 specification for details) */
1.42 +
1.43 + /**
1.44 + Control
1.45 + "Control transfers are intended to support configuration/command/status
1.46 + type communication flows between client software and its function. Each
1.47 + USB device is required to implement the Default Control Pipe as a message pipe."
1.48 + */
1.49 + _LIT(KEPControl, "Control");
1.50 +
1.51 + /**
1.52 + Bulk
1.53 + "The bulk transfer type is designed to support devices that need to communicate
1.54 + relatively large amounts of data at highly variable times where the transfer can
1.55 + use any available bandwidth."
1.56 + */
1.57 + _LIT(KEPBulk, "Bulk");
1.58 +
1.59 + /**
1.60 + Interrupt
1.61 + "The interrupt transfer type is designed to support those devices that need to
1.62 + send or receive data infrequently but with bounded service periods."
1.63 + */
1.64 + _LIT(KEPInterrupt, "Interrupt");
1.65 + /*
1.66 + Isochronous
1.67 + "Isochronous transfer type provides the requester:
1.68 + - guaranteed access to USB bandwidth with bounded latency
1.69 + - guaranteed constant data rate through the pipe as long as data is provided to the pipe
1.70 + - in the case of a delivery failure due to error, no retrying of the attempt to deliver the data "
1.71 + */
1.72 + _LIT(KEPIsochronous, "Isochronous");
1.73 +
1.74 + /**
1.75 + * Endpoint direction constants
1.76 + * */
1.77 +
1.78 + _LIT(KEPIn, "In"); // "IN refers to transfers to the host"
1.79 + _LIT(KEPOut, "Out"); // "OUT refers to transfers from the host."
1.80 + _LIT(KEPBidirectional, "Bidirectional"); // only for control transfers
1.81 +
1.82 + /**
1.83 + * The following are default offsets data in device descriptor
1.84 + Offsets are used to set */
1.85 + const TInt KSpecOffset = 2;
1.86 + const TInt KVendorOffset = 8;
1.87 + const TInt KProductIDOffset = 10;
1.88 + const TInt KReleaseOffset = 12;
1.89 +
1.90 + /* Default number of channels to open. Used only to initialize variable with proper value */
1.91 + const TInt MinNumberOfChannels = 1;
1.92 +
1.93 + /* Value which is not used by USB client driver, "For future compatibility, should always be zero." */
1.94 + const TInt KUSBChannelOpenParameter = 0;
1.95 +
1.96 + /* Value for how long to wait before test case ends after re-enumeration */
1.97 + const TInt KSecond = 1000000; // 1 secs = 1000000 microseconds
1.98 +
1.99 + enum TUSBEndPointMode {
1.100 + ENotChosen = -1,
1.101 + EBulk,
1.102 + EInterrupt,
1.103 + EIsochronous
1.104 + };
1.105 +
1.106 + /**
1.107 + * USB Actions indicate which action is done in async call
1.108 + * The flag is set before async calls to RDevUsbcClient
1.109 + * It is used by USBReader and USBWriter classes
1.110 + */
1.111 +
1.112 + enum USBAction
1.113 + {
1.114 +
1.115 + // Read Actions - used by USBReader
1.116 + ENone, // ENone Used by both USBReader and USBWriter
1.117 + ERead,
1.118 + EReadWithLength,
1.119 + EReadUntilShort,
1.120 + EReadUntilShortWithLength,
1.121 + EReadOneOrMore,
1.122 + EReadOneOrMoreWithLength,
1.123 + EReadError,
1.124 +
1.125 + // Write Actions - used by USBWriter
1.126 + EWrite,
1.127 + EWriteFile,
1.128 + EWriteError
1.129 +
1.130 + };
1.131 +
1.132 + // Read and write buffers 0.5MB by default
1.133 + const TInt KDefaultReadBufferSize = 1024 * 512;
1.134 + const TInt KDefaultWriteBufferSize = 1024 * 512;
1.135 +
1.136 + const TInt KDelayBetweenDataAvailabilityQueries = 1000000;
1.137 +
1.138 + const TInt KTransferDataSize5MB = 5242880;
1.139 + const TInt KMicroSecondsToSecondsMultiplier = 1000000;
1.140 + }
1.141 +
1.142 +
1.143 +
1.144 +#endif
1.145 +