|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __D_GPIO_H__ |
|
20 #define __D_GPIO_H__ |
|
21 |
|
22 #include <e32def.h> |
|
23 #include <e32cmn.h> |
|
24 #include <e32ver.h> |
|
25 |
|
26 #ifndef __KERNEL_MODE__ |
|
27 #include <e32std.h> |
|
28 #endif |
|
29 |
|
30 class RGpio : public RBusLogicalChannel |
|
31 { |
|
32 public: |
|
33 class TCaps |
|
34 { |
|
35 public: |
|
36 TVersion iVersion; |
|
37 }; |
|
38 |
|
39 public: |
|
40 TInt Open(); |
|
41 TInt CallStaticExtension(); |
|
42 inline static const TDesC& Name(); |
|
43 inline static TVersion VersionRequired(); |
|
44 enum TControl |
|
45 { |
|
46 ECallStaticExtension = 0x8fff |
|
47 }; |
|
48 |
|
49 // Kernel side LDD channel is a friend |
|
50 //friend class DGpioChannel; |
|
51 }; |
|
52 |
|
53 inline const TDesC& RGpio::Name() |
|
54 { |
|
55 _LIT(KGpioName,"GPIO"); |
|
56 return KGpioName; |
|
57 } |
|
58 |
|
59 inline TVersion RGpio::VersionRequired() |
|
60 { |
|
61 const TInt KMajorVersionNumber=1; |
|
62 const TInt KMinorVersionNumber=0; |
|
63 const TInt KBuildVersionNumber=KE32BuildVersionNumber; |
|
64 return TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber); |
|
65 } |
|
66 |
|
67 #ifndef __KERNEL_MODE__ |
|
68 |
|
69 TInt RGpio::Open() |
|
70 { |
|
71 return DoCreate(Name(),VersionRequired(),KNullUnit,NULL,NULL,EOwnerThread); |
|
72 } |
|
73 |
|
74 TInt RGpio::CallStaticExtension() |
|
75 { |
|
76 return DoControl(ECallStaticExtension, NULL); |
|
77 } |
|
78 |
|
79 #endif // !__KERNEL_MODE__ |
|
80 |
|
81 #endif // __GPIO_H__ |
|
82 |