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