os/kernelhwsrv/kerneltest/e32test/iic/t_iic.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32test\iic\t_iic.h
sl@0
    15
//
sl@0
    16
sl@0
    17
#ifndef __T_IIC_H__
sl@0
    18
#define __T_IIC_H__
sl@0
    19
sl@0
    20
#include <e32ver.h>
sl@0
    21
sl@0
    22
const TInt KIicClientMajorVersionNumber = 1;
sl@0
    23
const TInt KIicClientMinorVersionNumber = 0;
sl@0
    24
const TInt KIicClientBuildVersionNumber = KE32BuildVersionNumber;
sl@0
    25
sl@0
    26
const TInt KPriorityTestNum = 6; // 1 blocking transaction + 5 test transactions
sl@0
    27
sl@0
    28
// For IIC,
sl@0
    29
// If bit 31 is set and bit 30 cleared it is used to extend the Master-Slave channel;
sl@0
    30
// if bit 31 is cleared and bit 30 is set, it extends the Master channel; 
sl@0
    31
// if both bits 31 and 30 are cleared it extends the Slave channel interface.
sl@0
    32
// However,
sl@0
    33
// since the kernel-side proxy clients interpret the msb being set as indicative of an
sl@0
    34
// asynchronous request, the values here will have the static extension pattern represented
sl@0
    35
// in bits 30 and 29, instead. In addition, to support communication with the slave-side proxy,
sl@0
    36
// the Slave extension value will be represented as bits 30 and 29 set, so that it can be distinguished
sl@0
    37
// from 'normal' synchronous operations.
sl@0
    38
//
sl@0
    39
const TUint KTestControlIoMask =			0x60000000;
sl@0
    40
const TUint KTestMasterControlIo =		0x20000000;
sl@0
    41
const TUint KTestSlaveControlIo =		0x60000000;
sl@0
    42
const TUint KTestMasterSlaveControlIo =	0x40000000;
sl@0
    43
const TUint KTestControlIoPilOffset =	0x00000002;	// Corresponds to 1 higher than the number used by PIL
sl@0
    44
const TUint KTestControlUnitTestOffset = 0x10000000;
sl@0
    45
sl@0
    46
//
sl@0
    47
// Enumerations TReqType and TBusType defined in kernel-side class TIicBusTransfer
sl@0
    48
// The user-side test, and the kernel-side proxy client require access to this
sl@0
    49
enum TReqType
sl@0
    50
	{
sl@0
    51
	EMasterRead,
sl@0
    52
	EMasterWrite
sl@0
    53
	};
sl@0
    54
enum TBusType
sl@0
    55
	{
sl@0
    56
	EI2c	   = 0,
sl@0
    57
	ESpi	   = 0x01,
sl@0
    58
	EMicrowire = 0x02,
sl@0
    59
	ECci	   = 0x03,
sl@0
    60
	ESccb	   = 0x04,
sl@0
    61
	EInvalidBus
sl@0
    62
	};
sl@0
    63
sl@0
    64
#define MAX_TRANS_LENGTH 20	
sl@0
    65
sl@0
    66
sl@0
    67
#ifndef __KERNEL_MODE__
sl@0
    68
//
sl@0
    69
//	For convenience, selected kernel-side information is replicated here
sl@0
    70
//  to allow the user-side test to populate buffers accordingly
sl@0
    71
//
sl@0
    72
// Bus-specific configuration
sl@0
    73
//
sl@0
    74
enum TEndianness
sl@0
    75
	{
sl@0
    76
	EBigEndian,
sl@0
    77
	ELittleEndian
sl@0
    78
	};
sl@0
    79
sl@0
    80
enum TBitOrder
sl@0
    81
	{
sl@0
    82
	ELsbFirst,
sl@0
    83
	EMsbFirst
sl@0
    84
	};
sl@0
    85
sl@0
    86
//
sl@0
    87
// Bus-specific configuration for SPI bus
sl@0
    88
//
sl@0
    89
sl@0
    90
enum TSpiWordWidth
sl@0
    91
	{
sl@0
    92
	ESpiWordWidth_8,
sl@0
    93
	ESpiWordWidth_10,
sl@0
    94
	ESpiWordWidth_12,
sl@0
    95
	ESpiWordWidth_16
sl@0
    96
	};
sl@0
    97
sl@0
    98
enum TSpiClkMode
sl@0
    99
	{
sl@0
   100
	ESpiPolarityLowRisingEdge,		// Active high, odd edges
sl@0
   101
	ESpiPolarityLowFallingEdge,		// Active high, even edges
sl@0
   102
	ESpiPolarityHighFallingEdge,	// Active low,  odd edges
sl@0
   103
	ESpiPolarityHighRisingEdge		// Active low,  even edges
sl@0
   104
	};
sl@0
   105
sl@0
   106
enum TSpiSsPinMode
sl@0
   107
    {
sl@0
   108
    ESpiCSPinActiveLow,      // Active low
sl@0
   109
    ESpiCSPinActiveHigh     // Active high
sl@0
   110
    };
sl@0
   111
sl@0
   112
class TConfigSpiV01
sl@0
   113
	{
sl@0
   114
public:
sl@0
   115
	TSpiWordWidth	iWordWidth;
sl@0
   116
	TInt32			iClkSpeedHz;
sl@0
   117
	TSpiClkMode		iClkMode;
sl@0
   118
	TInt32			iTimeoutPeriod;
sl@0
   119
	TEndianness		iEndianness;
sl@0
   120
	TBitOrder		iBitOrder;
sl@0
   121
	TUint			iTransactionWaitCycles;
sl@0
   122
	TSpiSsPinMode	iSSPinActiveMode;
sl@0
   123
	};
sl@0
   124
sl@0
   125
typedef TPckgBuf <TConfigSpiV01> TConfigSpiBufV01;
sl@0
   126
sl@0
   127
sl@0
   128
//
sl@0
   129
// Bus-specific configuration for I2C bus
sl@0
   130
//
sl@0
   131
sl@0
   132
enum TI2cAddrType
sl@0
   133
	{
sl@0
   134
	EI2cAddr7Bit,
sl@0
   135
	EI2cAddr10Bit
sl@0
   136
	};
sl@0
   137
sl@0
   138
class TConfigI2cV01
sl@0
   139
	{
sl@0
   140
	public:
sl@0
   141
	TI2cAddrType	iAddrType;		// 7 or 10-bit addressing
sl@0
   142
	TInt32			iClkSpeedHz;
sl@0
   143
	TEndianness		iEndianness;
sl@0
   144
	TInt32			iTimeoutPeriod;
sl@0
   145
	};
sl@0
   146
sl@0
   147
typedef TPckgBuf <TConfigI2cV01> TConfigI2cBufV01;
sl@0
   148
sl@0
   149
sl@0
   150
inline static TInt CreateSpiBuf(TConfigSpiBufV01*& aBuf,
sl@0
   151
								TSpiWordWidth	aWordWidth,
sl@0
   152
								TInt32			aClkSpeedHz,
sl@0
   153
								TSpiClkMode		aClkMode,
sl@0
   154
								TInt32			aTimeoutPeriod,
sl@0
   155
								TEndianness		aEndianness,
sl@0
   156
								TBitOrder		aBitOrder,
sl@0
   157
								TUint			aTransactionWaitCycles,
sl@0
   158
								TSpiSsPinMode	aSSPinActiveMode)
sl@0
   159
// Utility function to create a buffer for the SPI bus
sl@0
   160
	{
sl@0
   161
	aBuf = new TConfigSpiBufV01();
sl@0
   162
	if(aBuf==NULL)
sl@0
   163
		return KErrNoMemory;
sl@0
   164
	TConfigSpiV01 *buf = &((*aBuf)());
sl@0
   165
	buf->iWordWidth = aWordWidth;
sl@0
   166
	buf->iClkSpeedHz = aClkSpeedHz;
sl@0
   167
	buf->iClkMode = aClkMode;
sl@0
   168
	buf->iTimeoutPeriod = aTimeoutPeriod;
sl@0
   169
	buf->iEndianness = aEndianness;
sl@0
   170
	buf->iBitOrder = aBitOrder;
sl@0
   171
	buf->iTransactionWaitCycles = aTransactionWaitCycles;
sl@0
   172
	buf->iSSPinActiveMode = aSSPinActiveMode;
sl@0
   173
	return KErrNone;
sl@0
   174
	}
sl@0
   175
sl@0
   176
inline static TInt CreateI2cBuf(TConfigI2cBufV01*& aBuf,
sl@0
   177
								TI2cAddrType	aAddrType,
sl@0
   178
								TInt32			aClkSpeedHz,
sl@0
   179
								TEndianness		aEndianness,
sl@0
   180
								TInt32			aTimeoutPeriod)
sl@0
   181
// Utility function to create a buffer for the I2C bus
sl@0
   182
	{
sl@0
   183
	aBuf = new TConfigI2cBufV01();
sl@0
   184
	if(aBuf==NULL)
sl@0
   185
		return KErrNoMemory;
sl@0
   186
	TConfigI2cV01 *buf = &((*aBuf)());
sl@0
   187
	buf->iAddrType = aAddrType;
sl@0
   188
	buf->iClkSpeedHz = aClkSpeedHz;
sl@0
   189
	buf->iEndianness = aEndianness;
sl@0
   190
	buf->iTimeoutPeriod = aTimeoutPeriod;
sl@0
   191
	return KErrNone;
sl@0
   192
	}
sl@0
   193
sl@0
   194
//
sl@0
   195
// Enumerations for channel type and channel duplex defined in kernel-side class DIicBusChannel
sl@0
   196
// duplicated for temporary test
sl@0
   197
enum TChannelType
sl@0
   198
	{
sl@0
   199
	EMaster			= 0,
sl@0
   200
	ESlave			= 0x01,
sl@0
   201
	EMasterSlave	= 0x02,
sl@0
   202
	EInvalidType
sl@0
   203
	};
sl@0
   204
enum TChannelDuplex
sl@0
   205
	{
sl@0
   206
	EHalfDuplex = 0,	// supports only half duplex transactions (even if bus spec supports full duplex)
sl@0
   207
	EFullDuplex = 0x1,	// supports full duplex transactions (queud transactions may still be half duplex)
sl@0
   208
	EInvalidDuplex
sl@0
   209
	};
sl@0
   210
//
sl@0
   211
// Bus realisation configuration
sl@0
   212
//
sl@0
   213
// 31 30 29 28 | 27 26 25 24 | 23 22 21 20 | 19 18 17 16 | 15 14 13 12 | 11 10  9  8 |  7  6  5  4 |  3  2  1  0
sl@0
   214
//
sl@0
   215
// 31:29 - HS Master address (I2C only)
sl@0
   216
// 28    - HS address valid bit
sl@0
   217
// 27:23 - Reserved
sl@0
   218
// 22:20 - Bus type
sl@0
   219
// 19:15 - Channel number
sl@0
   220
// 14:10 - Transaction speed
sl@0
   221
//  9:0  - Slave address
sl@0
   222
#define HS_MASTER_ADDR_SHIFT 29
sl@0
   223
#define HS_MASTER_ADDR_MASK 0x7
sl@0
   224
#define HS_ADDR_VALID_SHIFT 28
sl@0
   225
#define HS_ADDR_VALID_MASK 0x1
sl@0
   226
#define BUS_TYPE_SHIFT 20
sl@0
   227
#define BUS_TYPE_MASK 0x7
sl@0
   228
#define CHANNEL_NO_SHIFT 15
sl@0
   229
#define CHANNEL_NO_MASK 0x1F
sl@0
   230
#define TRANS_SPEED_SHIFT 10
sl@0
   231
#define TRANS_SPEED_MASK 0x1F
sl@0
   232
#define SLAVE_ADDR_SHIFT 0
sl@0
   233
#define SLAVE_ADDR_MASK 0x3FF
sl@0
   234
//
sl@0
   235
// Macros to access fields within Bus Realisation Configuration data, used on a per-transaction basis with IIC
sl@0
   236
#define SET_CONFIG_FIELD(aBusId,aField,aMask,aShift) aBusId=(aBusId&~(aMask<<aShift))|((aField&aMask)<<aShift);
sl@0
   237
#define GET_CONFIG_FIELD(aBusId,aMask,aShift) (((aBusId)>>(aShift))&(aMask))
sl@0
   238
sl@0
   239
#define GET_HS_MASTER_ADDR(aBusId) GET_CONFIG_FIELD(aBusId,HS_MASTER_ADDR_MASK,HS_MASTER_ADDR_SHIFT)
sl@0
   240
#define SET_HS_MASTER_ADDR(aBusId,aHsMasterAddr) SET_CONFIG_FIELD(aBusId,aHsMasterAddr,HS_MASTER_ADDR_MASK,HS_MASTER_ADDR_SHIFT)
sl@0
   241
#define GET_HS_VALID(aBusId) GET_CONFIG_FIELD(aBusId,HS_ADDR_VALID_MASK,HS_ADDR_VALID_SHIFT)
sl@0
   242
#define SET_HS_VALID(aBusId,aHsValid) SET_CONFIG_FIELD(aBusId,aHsValid,HS_ADDR_VALID_MASK,HS_ADDR_VALID_SHIFT)
sl@0
   243
#define GET_BUS_TYPE(aBusId) GET_CONFIG_FIELD(aBusId,BUS_TYPE_MASK,BUS_TYPE_SHIFT)
sl@0
   244
#define SET_BUS_TYPE(aBusId,aBusType) SET_CONFIG_FIELD(aBusId,aBusType,BUS_TYPE_MASK,BUS_TYPE_SHIFT)
sl@0
   245
#define GET_CHAN_NUM(aBusId) GET_CONFIG_FIELD(aBusId,CHANNEL_NO_MASK,CHANNEL_NO_SHIFT)
sl@0
   246
#define SET_CHAN_NUM(aBusId,aChanNum) SET_CONFIG_FIELD(aBusId,aChanNum,CHANNEL_NO_MASK,CHANNEL_NO_SHIFT)
sl@0
   247
#define SET_TRANS_SPEED(aBusId,aTransSpeed) SET_CONFIG_FIELD(aBusId,aTransSpeed,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
sl@0
   248
#define GET_TRANS_SPEED(aBusId) GET_CONFIG_FIELD(aBusId,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
sl@0
   249
#define SET_SLAVE_ADDR(aBusId,aSlaveAddr) SET_CONFIG_FIELD(aBusId,aSlaveAddr,SLAVE_ADDR_MASK,SLAVE_ADDR_SHIFT)
sl@0
   250
#define GET_SLAVE_ADDR(aBusId) GET_CONFIG_FIELD(aBusId,SLAVE_ADDR_MASK,SLAVE_ADDR_SHIFT)
sl@0
   251
sl@0
   252
static const TUint8 KTransactionWithPreamble = 0x80;
sl@0
   253
static const TUint8 KTransactionWithMultiTransc = 0x40;
sl@0
   254
sl@0
   255
enum TIicBusSlaveTrigger
sl@0
   256
	{
sl@0
   257
	ERxAllBytes			= 0x01,
sl@0
   258
	ERxUnderrun			= 0x02,
sl@0
   259
	ERxOverrun			= 0x04,
sl@0
   260
	ETxAllBytes			= 0x08,
sl@0
   261
	ETxUnderrun			= 0x10,
sl@0
   262
	ETxOverrun			= 0x20,
sl@0
   263
	EGeneralBusError	= 0x40,
sl@0
   264
	EAsyncCaptChan		= 0x80
sl@0
   265
	};
sl@0
   266
sl@0
   267
#endif // #ifndef __KERNEL_MODE__
sl@0
   268
sl@0
   269
//
sl@0
   270
// User-Side abbreviation of kernel side classes TIicBusTransfer and TIicBusTransaction
sl@0
   271
//
sl@0
   272
struct TUsideTferDesc
sl@0
   273
	{
sl@0
   274
	TInt8 iType;			// as one of TReqType
sl@0
   275
	TInt8 iBufGranularity;	// width of a transfer word in bits
sl@0
   276
	TDes8* iBuffer;	// the data for this transfer (packed into 8-bit words with padding)
sl@0
   277
	TUsideTferDesc* iNext;
sl@0
   278
	};
sl@0
   279
sl@0
   280
struct TUsideTracnDesc
sl@0
   281
	{
sl@0
   282
	TBusType iType;
sl@0
   283
	TDes8* iHeader;
sl@0
   284
	TUsideTferDesc* iHalfDuplexTrans;
sl@0
   285
	TUsideTferDesc* iFullDuplexTrans;
sl@0
   286
	TUint8 iFlags;				// used to indicate if it supports a preamble
sl@0
   287
	TAny* iPreambleArg;			// used for preamble argument
sl@0
   288
	TAny* iMultiTranscArg;		// used for multi transc argument
sl@0
   289
	};
sl@0
   290
sl@0
   291
class RBusDevIicClient : public RBusLogicalChannel
sl@0
   292
	{
sl@0
   293
    public:
sl@0
   294
	enum TControl
sl@0
   295
		{
sl@0
   296
// Master mode operations
sl@0
   297
		EQTransSync=1,						/**< Queue Transaction (Synchronous version)					*/
sl@0
   298
// Slave mode operations
sl@0
   299
		EInitSlaveClient,					/**< Instigate Slave initialisation required to support testing	*/
sl@0
   300
		ECaptureChanSync,					/**< Capture Channel (Synchronous version)						*/
sl@0
   301
		EReleaseChan,						/**< ReleaseChannel												*/
sl@0
   302
		ERegisterRxBuffer,					/**< Register a buffer for receiving data						*/
sl@0
   303
		ERegisterTxBuffer,					/**< Register a buffer for transmitting data					*/
sl@0
   304
		ESetNotifTrigger					/**< Set the notification triggers                               */									
sl@0
   305
		};
sl@0
   306
sl@0
   307
	enum TStaticExt
sl@0
   308
		{
sl@0
   309
		ECtlIoNone = 0,
sl@0
   310
		ECtlIoDumpChan = 1, // KCtrlIoDumpChan - defined only for UDEB
sl@0
   311
// ControlIO codes for Master follow
sl@0
   312
		ECtlIoBlockReqCompletion=(KTestMasterControlIo+KTestControlIoPilOffset),
sl@0
   313
		ECtlIoUnblockReqCompletion,
sl@0
   314
		ECtlIoDeRegChan,
sl@0
   315
		ECtlIoTracnOne,
sl@0
   316
		ECtlIoPriorityTest,
sl@0
   317
		EGetTestResult,
sl@0
   318
		ECtlIoSetTimeOutFlag,
sl@0
   319
		ECtlIoTestFullDuplexTrans,
sl@0
   320
// ControlIO codes for Slave follow
sl@0
   321
		ECtrlIoRxWords=(KTestSlaveControlIo+KTestControlIoPilOffset),
sl@0
   322
		ECtrlIoTxWords,
sl@0
   323
		ECtrlIoRxTxWords,
sl@0
   324
		ECtrlIoTxChkBuf,
sl@0
   325
		ECtlIoBusError,
sl@0
   326
		ECtrlIoBlockNotification,
sl@0
   327
		ECtrlIoUnblockNotification,
sl@0
   328
		ECtrlIoUpdTimeout,
sl@0
   329
		ECtrlIoNotifNoTrigger
sl@0
   330
		};
sl@0
   331
	
sl@0
   332
	enum TTestFullDuplexTrans
sl@0
   333
		{
sl@0
   334
		ETestValidFullDuplexTrans=1,
sl@0
   335
		ETestInvalidFullDuplexTrans1,
sl@0
   336
		ETestInvalidFullDuplexTrans2,
sl@0
   337
		ETestLastNodeFullDuplexTrans,
sl@0
   338
		ETestDiffNodeNoFullDuplexTrans,
sl@0
   339
		ETestNone
sl@0
   340
		};
sl@0
   341
sl@0
   342
	enum TRequest
sl@0
   343
		{
sl@0
   344
// Master mode operations
sl@0
   345
		EQTransAsync=1,						/**< Queue Transaction (Asynchronous version)					*/
sl@0
   346
		ECtrlIoTestBufReUse,
sl@0
   347
// Slave mode operations
sl@0
   348
		ECaptureChanAsync,					/**< Capture Channel (Asynchronous version)						*/
sl@0
   349
		ECtrlIoOvUndRunRxTx
sl@0
   350
		};
sl@0
   351
		
sl@0
   352
	enum TTestMessages
sl@0
   353
	    {
sl@0
   354
	    ETestIicChannelInlineFunc=KTestControlUnitTestOffset    
sl@0
   355
	    };
sl@0
   356
	
sl@0
   357
#ifndef __KERNEL_MODE__
sl@0
   358
	public:   
sl@0
   359
	inline TInt TestIiicChannelInlineFunc(){return DoControl (ETestIicChannelInlineFunc, NULL, NULL);}	
sl@0
   360
	// Master mode functions
sl@0
   361
	inline TInt Open(TDesC& aProxyName) {return (DoCreate(aProxyName,TVersion(KIicClientMajorVersionNumber,KIicClientMinorVersionNumber,KIicClientBuildVersionNumber),-1,NULL,NULL,EOwnerThread));}
sl@0
   362
sl@0
   363
	inline TInt QueueTransaction(TInt aBusId, TUsideTracnDesc* aTransaction) {return(DoControl(EQTransSync,(TAny*)aBusId,(TAny*)aTransaction));}
sl@0
   364
sl@0
   365
	inline void QueueTransaction(TRequestStatus& aStatus, TInt aBusId, TUsideTracnDesc* aTransaction) {DoRequest(EQTransAsync,aStatus,(TAny*)aBusId,(TAny*)aTransaction);}
sl@0
   366
sl@0
   367
	inline void CancelAsyncOperation(TRequestStatus* aStatus, TInt aBusId)	{TInt* parms[2]; parms[0]=(TInt*)aStatus; parms[1]=(TInt*)aBusId;DoCancel((TInt)&parms[0]);} 
sl@0
   368
sl@0
   369
	// Slave mode functions
sl@0
   370
	inline TInt InitSlaveClient() {return(DoControl(EInitSlaveClient,NULL,NULL));}
sl@0
   371
	inline TInt CaptureChannel(TInt aBusId, TDes8* aConfigHdr, TInt& aChannelId) {TInt* parms[2]; parms[0]=(TInt*)aBusId; parms[1]=&aChannelId;return(DoControl(ECaptureChanSync,(TAny*)aConfigHdr,(TAny*)(&parms[0])));}
sl@0
   372
sl@0
   373
	inline TInt CaptureChannel(TInt aBusId, TDes8* aConfigHdr, TInt& aChannelId, TRequestStatus& aStatus) {TInt* parms[2]; parms[0]=(TInt*)aBusId; parms[1]=&aChannelId;DoRequest(ECaptureChanAsync,aStatus,(TAny*)aConfigHdr,(TAny*)(&parms[0]));return KErrNone;}
sl@0
   374
sl@0
   375
	inline TInt ReleaseChannel(TInt aChannelId){return(DoControl(EReleaseChan,(TAny*)aChannelId,NULL));};
sl@0
   376
	inline TInt RegisterRxBuffer(TInt aChannelId, TInt8 aBufGranularity, TInt8 aNumWords, TInt8 aOffset){TInt8 parms[3]; parms[0]=aBufGranularity; parms[1]=aNumWords; parms[2]=aOffset;return(DoControl(ERegisterRxBuffer,(TAny*)aChannelId,(TAny*)(&parms[0])));};
sl@0
   377
	inline TInt RegisterTxBuffer(TInt aChannelId, TInt8 aBufGranularity, TInt8 aNumWords, TInt8 aOffset){TInt8 parms[3]; parms[0]=aBufGranularity; parms[1]=aNumWords; parms[2]=aOffset;return(DoControl(ERegisterTxBuffer,(TAny*)aChannelId,(TAny*)(&parms[0])));};
sl@0
   378
	inline TInt SetNotificationTrigger(TInt aChannelId, TInt aTrigger, TRequestStatus* aStatus){TInt parms[2]; parms[0]=aChannelId; parms[1]=aTrigger;return(DoControl(ESetNotifTrigger,(TAny*)aStatus,(TAny*)(&parms[0])));};
sl@0
   379
sl@0
   380
	// ControlIO functions follow
sl@0
   381
	inline TInt BlockReqCompletion(TInt aBusId) {return(DoControl(ECtlIoBlockReqCompletion,(TAny*)aBusId));}
sl@0
   382
	inline TInt UnblockReqCompletion(TInt aBusId) {return(DoControl(ECtlIoUnblockReqCompletion,(TAny*)aBusId));}
sl@0
   383
	inline TInt DeRegisterChan(TInt aBusId) {return(DoControl(ECtlIoDeRegChan,(TAny*)aBusId));}
sl@0
   384
	inline TInt TestTracnOne(TInt aBusId) {return(DoControl(ECtlIoTracnOne, (TAny*)aBusId));}
sl@0
   385
	inline TInt SetTimeOutFlag(TInt aBusId){return(DoControl(ECtlIoSetTimeOutFlag,(TAny*)aBusId));}
sl@0
   386
	inline TInt CancelTimeOutFlag(TInt aBusId){return(DoControl(ECtlIoNone,(TAny*)aBusId));}
sl@0
   387
	inline TInt TestPriority(TInt aBusId) {return(DoControl(ECtlIoPriorityTest, (TAny*)aBusId));}
sl@0
   388
sl@0
   389
	inline TInt TestValidFullDuplexTrans(TInt aBusId) {return(DoControl(ECtlIoTestFullDuplexTrans, (TAny*)aBusId, (TAny*)ETestValidFullDuplexTrans));}
sl@0
   390
	inline TInt TestInvalidFullDuplexTrans1(TInt aBusId) {return(DoControl(ECtlIoTestFullDuplexTrans, (TAny*)aBusId, (TAny*)ETestInvalidFullDuplexTrans1));}
sl@0
   391
	inline TInt TestInvalidFullDuplexTrans2(TInt aBusId) {return(DoControl(ECtlIoTestFullDuplexTrans, (TAny*)aBusId, (TAny*)ETestInvalidFullDuplexTrans2));}
sl@0
   392
	
sl@0
   393
	inline TInt TestLastNodeFullDuplexTrans(TInt aBusId) {return(DoControl(ECtlIoTestFullDuplexTrans, (TAny*)aBusId, (TAny*)ETestLastNodeFullDuplexTrans));}
sl@0
   394
	inline TInt TestDiffNodeNumFullDuplexTrans(TInt aBusId) {return(DoControl(ECtlIoTestFullDuplexTrans, (TAny*)aBusId, (TAny*)ETestDiffNodeNoFullDuplexTrans));}
sl@0
   395
sl@0
   396
	inline void TestBufferReUse(TInt aBusId, TRequestStatus& aStatus) {DoRequest(ECtrlIoTestBufReUse,aStatus,(TAny*)aBusId,NULL);}
sl@0
   397
sl@0
   398
	inline TInt SimulateRxNWords(TInt aBusId, TInt aChannelId, TInt aNumWords){TInt parms[2]; parms[0]=aChannelId; parms[1]=aNumWords;return(DoControl(ECtrlIoRxWords,(TAny*)aBusId,(TAny*)(&parms[0])));};
sl@0
   399
	inline TInt SimulateTxNWords(TInt aBusId, TInt aChannelId, TInt aNumWords){TInt parms[2]; parms[0]=aChannelId; parms[1]=aNumWords;return(DoControl(ECtrlIoTxWords,(TAny*)aBusId,(TAny*)(&parms[0])));};
sl@0
   400
	inline TInt SimulateRxTxNWords(TInt aBusId, TInt aChannelId, TInt aNumRxWords, TInt aNumTxWords){TInt parms[3]; parms[0]=aChannelId; parms[1]=aNumRxWords; parms[2]=aNumTxWords;return(DoControl(ECtrlIoRxTxWords,(TAny*)aBusId,(TAny*)(&parms[0])));};
sl@0
   401
	inline TInt SimulateBusErr(TInt aBusId, TInt aChannelId) {return(DoControl(ECtlIoBusError,(TAny*)aBusId,(TAny*)aChannelId));}
sl@0
   402
	inline TInt BlockNotification(TInt aBusId, TInt aChannelId) {return(DoControl(ECtrlIoBlockNotification,(TAny*)aBusId,(TAny*)aChannelId));}
sl@0
   403
	inline TInt UnblockNotification(TInt aBusId, TInt aChannelId) {return(DoControl(ECtrlIoUnblockNotification,(TAny*)aBusId,(TAny*)aChannelId));}
sl@0
   404
	inline TInt UpdateTimeoutValues(TInt aBusId, TInt aChannelId) {return(DoControl(ECtrlIoUpdTimeout,(TAny*)aBusId,(TAny*)aChannelId));}
sl@0
   405
	inline TInt SetNotifNoTrigger(TInt aChannelId, TInt aTrigger){return(DoControl(ECtrlIoNotifNoTrigger,(TAny*)aChannelId,(TAny*)aTrigger));};
sl@0
   406
sl@0
   407
	inline void TestOverrunUnderrun(TInt aBusId, TInt aChannelId, TRequestStatus& aStatus) {DoRequest(ECtrlIoOvUndRunRxTx,aStatus,(TAny*)aBusId,(TAny*)aChannelId);}
sl@0
   408
sl@0
   409
#endif
sl@0
   410
	};
sl@0
   411
sl@0
   412
sl@0
   413
#ifdef __KERNEL_MODE__
sl@0
   414
sl@0
   415
// Definition of function prototype for a callback function provided by the PSL
sl@0
   416
// to be invoked when the part played by the hardware in processing a transfer
sl@0
   417
// has completed.
sl@0
   418
typedef void (*THwDoneCbFn)(TAny* );
sl@0
   419
sl@0
   420
#endif
sl@0
   421
sl@0
   422
// Data used to support tests
sl@0
   423
sl@0
   424
// Transaction One
sl@0
   425
//
sl@0
   426
const TUint8 KTransOneTferOne[21] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
sl@0
   427
const TUint8 KTransOneTferTwo[8] = {17,18,19,20,21,22,23,24};
sl@0
   428
const TUint8 KTransOneTferThree[6] = {87,85,83,81,79,77};
sl@0
   429
const TUint8 KPriorityTestHeader[6] = {0,1,2,3,4,10}; 
sl@0
   430
const TInt KPriorityTestPrio[6] = {1,2,3,4,5,0};
sl@0
   431
sl@0
   432
const TInt KRxBufSizeInBytes = 64;
sl@0
   433
const TInt KTxBufSizeInBytes = 64;
sl@0
   434
sl@0
   435
#endif