Update contrib.
1 // Copyright (c) 1997-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\system\d_tick.h
18 #if !defined(__D_TICK_H__)
21 #ifndef __KERNEL_MODE__
25 _LIT(KTickTestLddName,"TickTest");
27 const TInt KMaxTimers=8;
29 class TCapsTickTestV01
45 struct STimerStartInfo
51 TRequestStatus* iStatus;
54 #define PERIODIC(i,s,iv,c) \
55 STimerStartInfo i; i.iStatus=&s; i.iMin=iv; i.iRange=1; i.iCount=c; i.iMode=EPeriodic
56 #define NSHOTREL(i,s,m,r,c) \
57 STimerStartInfo i; i.iStatus=&s; i.iMin=m; i.iRange=r; i.iCount=c; i.iMode=EOneShot
58 #define NSHOTABS(i,s,m,r,c) \
59 STimerStartInfo i; i.iStatus=&s; i.iMin=m; i.iRange=r; i.iCount=c; i.iMode=EAbsolute
60 #define NSHOTDLY(i,s,p,d,c) \
61 STimerStartInfo i; i.iStatus=&s; i.iMin=p; i.iRange=d; i.iCount=c; i.iMode=ETickDelay
63 class RTickTest : public RBusLogicalChannel
72 EControlGetTickPeriod,
83 #ifndef __KERNEL_MODE__
85 { return DoCreate(KTickTestLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
86 inline TInt StartPeriodic(TRequestStatus& aStatus, TInt aId, TInt aInterval, TInt aCount)
87 { aStatus=KRequestPending; PERIODIC(info,aStatus,aInterval,aCount); return DoControl(EControlStart, (TAny*)aId, &info); }
88 inline TInt StartNShotRel(TRequestStatus& aStatus, TInt aId, TInt aMin, TInt aRange, TInt aCount)
89 { aStatus=KRequestPending; NSHOTREL(info,aStatus,aMin,aRange,aCount); return DoControl(EControlStart, (TAny*)aId, &info); }
90 inline TInt StartNShotAbs(TRequestStatus& aStatus, TInt aId, TInt aMin, TInt aRange, TInt aCount)
91 { aStatus=KRequestPending; NSHOTABS(info,aStatus,aMin,aRange,aCount); return DoControl(EControlStart, (TAny*)aId, &info); }
92 inline TInt StartNShotDelay(TRequestStatus& aStatus, TInt aId, TInt aPeriod, TInt aDelay, TInt aCount)
93 { aStatus=KRequestPending; NSHOTDLY(info,aStatus,aPeriod,aDelay,aCount); return DoControl(EControlStart, (TAny*)aId, &info); }
94 inline TInt Stop(TInt aId)
95 { return DoControl(EControlStop, (TAny*)aId); }
96 inline TInt GetInfo(TInt aId, STickTestInfo& anInfo)
97 { return DoControl(EControlGetInfo, (TAny*)aId, &anInfo); }
98 inline TInt ReadRtc(TTime& aSwRtc, TTime& aHwRtc)
99 { return DoControl(EControlReadRtc, &aSwRtc, &aHwRtc); }
100 inline TInt TickPeriodUs()
101 { return DoControl(EControlGetTickPeriod); }