os/kernelhwsrv/kerneltest/e32test/system/d_mstim.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/system/d_mstim.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,111 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\system\d_mstim.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#if !defined(__D_MSTIM_H__)
    1.22 +#define __D_MSTIM_H__
    1.23 +#include <e32cmn.h>
    1.24 +#ifndef __KERNEL_MODE__
    1.25 +#include <e32std.h>
    1.26 +#endif
    1.27 +
    1.28 +_LIT(KMsTimerLddName,"MsTim");
    1.29 +
    1.30 +class TCapsMsTimV01
    1.31 +	{
    1.32 +public:
    1.33 +	TVersion	iVersion;
    1.34 +	};
    1.35 +
    1.36 +struct SMsTimerInfo
    1.37 +	{
    1.38 +	TInt iMin;
    1.39 +	TInt iMax;
    1.40 +	TInt iAvg;
    1.41 +	TInt iCount;
    1.42 +	};
    1.43 +
    1.44 +struct SRandomTestInfo
    1.45 +	{
    1.46 +	TInt iMin;
    1.47 +	TInt iMax;
    1.48 +	TInt iXferC;
    1.49 +	TInt iCritC;
    1.50 +	TInt iStartFail;
    1.51 +	TInt iCallBacks;
    1.52 +	TInt iCompletions;
    1.53 +	};
    1.54 +
    1.55 +class RMsTim : public RBusLogicalChannel
    1.56 +	{
    1.57 +public:
    1.58 +	enum TControl
    1.59 +		{
    1.60 +		EControlStartPeriodicInt,
    1.61 +		EControlStartPeriodicDfc,
    1.62 +		EControlStopPeriodic,
    1.63 +		EControlGetInfo,
    1.64 +		EControlBeginRandomTest,
    1.65 +		EControlEndRandomTest,
    1.66 +		EControlGetRandomTestInfo,
    1.67 +		EControlGetIdleTime,
    1.68 +		};
    1.69 +
    1.70 +	enum TRequest
    1.71 +		{
    1.72 +		ERequestOneShotInt,
    1.73 +		ERequestOneShotDfc,
    1.74 +		ERequestIntCancel,
    1.75 +		ERequestOneShotIntAgain,
    1.76 +		ERequestOneShotUserDfc,
    1.77 +		ERequestOneShotUserDfcAgain
    1.78 +		};
    1.79 +public:
    1.80 +#ifndef __KERNEL_MODE__
    1.81 +	inline TInt Open()
    1.82 +		{ return DoCreate(KMsTimerLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
    1.83 +	inline TInt StartPeriodicInt(TInt aId, TInt aInterval)
    1.84 +		{ return DoControl(EControlStartPeriodicInt, (TAny*)aId, (TAny*)aInterval); }
    1.85 +	inline TInt StartPeriodicDfc(TInt aId, TInt aInterval)
    1.86 +		{ return DoControl(EControlStartPeriodicDfc, (TAny*)aId, (TAny*)aInterval); }
    1.87 +	inline TInt StopPeriodic(TInt aId)
    1.88 +		{ return DoControl(EControlStopPeriodic, (TAny*)aId); }
    1.89 +	inline TInt GetInfo(TInt aId, SMsTimerInfo& anInfo)
    1.90 +		{ return DoControl(EControlGetInfo, (TAny*)aId, &anInfo); }
    1.91 +	inline TInt BeginRandomTest()
    1.92 +		{ return DoControl(EControlBeginRandomTest); }
    1.93 +	inline TInt EndRandomTest()
    1.94 +		{ return DoControl(EControlEndRandomTest); }
    1.95 +	inline TInt GetRandomTestInfo(SRandomTestInfo& anInfo)
    1.96 +		{ return DoControl(EControlGetRandomTestInfo, &anInfo); }
    1.97 +	inline TInt GetIdleTime()
    1.98 +		{ return DoControl(EControlGetIdleTime); }
    1.99 +	inline void StartOneShotInt(TRequestStatus& aStatus, TInt aId, TInt aInterval)
   1.100 +		{ DoRequest(ERequestOneShotInt, aStatus, (TAny*)aId, (TAny*)aInterval); }
   1.101 +	inline void StartOneShotDfc(TRequestStatus& aStatus, TInt aId, TInt aInterval)
   1.102 +		{ DoRequest(ERequestOneShotDfc, aStatus, (TAny*)aId, (TAny*)aInterval); }
   1.103 +	inline void IntCancel(TRequestStatus& aStatus, TInt aId, TInt aInterval)
   1.104 +		{ DoRequest(ERequestIntCancel, aStatus, (TAny*)aId, (TAny*)aInterval); }
   1.105 +	inline void StartOneShotIntAgain(TRequestStatus& aStatus, TInt aId, TInt aInterval)
   1.106 +		{ DoRequest(ERequestOneShotIntAgain, aStatus, (TAny*)aId, (TAny*)aInterval); }
   1.107 +	inline void StartOneShotUserDfc(TRequestStatus& aStatus, TInt aId, TInt aInterval)
   1.108 +		{ DoRequest(ERequestOneShotUserDfc, aStatus, (TAny*)aId, (TAny*)aInterval); }
   1.109 +	inline void StartOneShotUserDfcAgain(TRequestStatus& aStatus, TInt aId, TInt aInterval)
   1.110 +		{ DoRequest(ERequestOneShotUserDfcAgain, aStatus, (TAny*)aId, (TAny*)aInterval); }
   1.111 +#endif
   1.112 +	};
   1.113 +
   1.114 +#endif