|
1 // Copyright (c) 1998-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 // e32\include\drivers\mmccd_ifc.h |
|
15 // Factory class for creating platform-specific MMC Drivers |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedPartner |
|
22 @released |
|
23 */ |
|
24 |
|
25 #ifndef __MMCCD_IFC_H__ |
|
26 #define __MMCCD_IFC_H__ |
|
27 |
|
28 #include <drivers/mmc.h> |
|
29 #include <drivers/locmedia.h> |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 /** |
|
35 The factory class for creating platform specific MultiMediaCard objects. |
|
36 |
|
37 The class defines the interface that must be implemented by a derived class. |
|
38 */ |
|
39 class TMMCardControllerInterface |
|
40 { |
|
41 public: |
|
42 IMPORT_C TInt Create(); |
|
43 |
|
44 |
|
45 /** |
|
46 Creates a platform specific socket object. |
|
47 |
|
48 The function is called from TMMCardControllerInterface::Create(), and |
|
49 an implementation must be provided by the platform specific layer in |
|
50 the Variant DLL. |
|
51 |
|
52 @param aSocketNum The socket number. |
|
53 @param aPasswordStore A pointer to the password store. |
|
54 |
|
55 @return A pointer to the new socket object. |
|
56 |
|
57 @see Create() |
|
58 */ |
|
59 virtual DMMCSocket* NewSocket(TInt aSocketNum, TMMCPasswordStore* aPasswordStore)=0; |
|
60 |
|
61 |
|
62 /** |
|
63 Creates a platform specific stack object. |
|
64 |
|
65 The function is called from TMMCardControllerInterface::Create(), and |
|
66 an implementation must be provided by the platform specific layer in |
|
67 the Variant DLL. |
|
68 |
|
69 @param aSocketNum The socket number. |
|
70 @param aSocket A pointer to the socket object. |
|
71 |
|
72 @return A pointer to the new stack object. |
|
73 |
|
74 @see Create() |
|
75 */ |
|
76 virtual DMMCStack* NewStack(TInt aSocketNum, DMMCSocket* aSocket)=0; |
|
77 |
|
78 |
|
79 /** |
|
80 Creates a platform specific media change object. |
|
81 |
|
82 The function is called from TMMCardControllerInterface::Create(), and |
|
83 an implementation must be provided by the platform specific layer in |
|
84 the Variant DLL. |
|
85 |
|
86 @param aMcId The media change number. |
|
87 |
|
88 @return A pointer to the new media change object. |
|
89 |
|
90 @see Create() |
|
91 @see MediaChangeID() |
|
92 */ |
|
93 virtual DMMCMediaChange* NewMediaChange(TInt aMcId)=0; |
|
94 |
|
95 |
|
96 /** |
|
97 Creates a platform specific power supply unit object. |
|
98 |
|
99 The function is called from TMMCardControllerInterface::Create(), and |
|
100 an implementation must be provided by the platform specific layer in |
|
101 the Variant DLL. |
|
102 |
|
103 @param aVccNum The power supply unit number |
|
104 @param aMcId The associated media change number. |
|
105 |
|
106 @return A pointer to the new power supply unit object. |
|
107 |
|
108 @see Create() |
|
109 @see MediaChangeID() |
|
110 @see VccID() |
|
111 */ |
|
112 virtual DMMCPsu* NewVcc(TInt aVccNum, TInt aMcId)=0; |
|
113 |
|
114 /** |
|
115 Creates a platform specific VccCore power supply unit object. |
|
116 |
|
117 The function is called from TMMCardControllerInterface::Create(), and |
|
118 an implementation can be provided by the platform specific layer in |
|
119 the Variant DLL. |
|
120 |
|
121 @param aVccQNum The power supply unit number (must match paired Vcc unit number). |
|
122 @param aMcId The associated media change number. |
|
123 |
|
124 @return A pointer to the new power supply unit object. |
|
125 |
|
126 @see Create() |
|
127 @see MediaChangeID() |
|
128 @see VccID() |
|
129 */ |
|
130 virtual inline DMMCPsu* NewVccCore(TInt aVccCoreNum, TInt aMcId); |
|
131 |
|
132 |
|
133 /** |
|
134 Performs platform specific initialisation. |
|
135 |
|
136 The function is called from TMMCardControllerInterface::Create(), and |
|
137 an implementation must be provided by the platform specific layer in |
|
138 the Variant DLL. |
|
139 |
|
140 @return KErrNone to indicate that initialisation has completed |
|
141 successfully, otherwise one of the other system-wide error codes |
|
142 to indicate initialisation failure. |
|
143 |
|
144 @see Create() |
|
145 */ |
|
146 virtual TInt Init()=0; |
|
147 |
|
148 |
|
149 /** |
|
150 Indicates whether the peripheral bus socket, as identified by the specified |
|
151 peripheral bus socket number, is designated as a MultiMediaCard socket on |
|
152 this platform. |
|
153 |
|
154 If the socket is designated as a MultiMediaCard socket, then the function |
|
155 must also provide the media information for that socket. |
|
156 |
|
157 The function is called from TMMCardControllerInterface::Create(), and |
|
158 an implementation must be provided by the platform specific layer in |
|
159 the Variant DLL. |
|
160 |
|
161 @param aSocket The peripheral bus socket number. |
|
162 @param aMediaDeviceInfo The media information for that socket, if |
|
163 the socket is designated as a MultiMediaCard |
|
164 socket. |
|
165 |
|
166 @return True, if the socket is designated as a MultiMediaCard socket; |
|
167 false, otherwise. |
|
168 |
|
169 @see Create() |
|
170 */ |
|
171 virtual TBool IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo)=0; |
|
172 |
|
173 |
|
174 /** |
|
175 Reports which media change object is to be associated with the specified |
|
176 peripheral bus socket number. |
|
177 |
|
178 The function is called from TMMCardControllerInterface::Create(), and |
|
179 an implementation must be provided by the platform specific layer in |
|
180 the Variant DLL. |
|
181 |
|
182 @param aSocket The socket number |
|
183 |
|
184 @return The media change number. |
|
185 |
|
186 @see Create() |
|
187 @see NewMediaChange() |
|
188 */ |
|
189 virtual TInt MediaChangeID(TInt aSocket)=0; |
|
190 |
|
191 |
|
192 /** |
|
193 Reports which power supply unit (PSU) object is to be associated with |
|
194 the specified peripheral bus socket number. |
|
195 |
|
196 The function is called from TMMCardControllerInterface::Create(), and |
|
197 an implementation must be provided by the platform specific layer in |
|
198 the Variant DLL. |
|
199 |
|
200 @param aSocket The socket number. |
|
201 |
|
202 @return The power supply unit number. |
|
203 |
|
204 @see Create() |
|
205 @see NewVcc() |
|
206 */ |
|
207 virtual TInt VccID(TInt aSocket)=0; |
|
208 |
|
209 protected: |
|
210 |
|
211 |
|
212 /** |
|
213 * Performs registration of the media devices on the current socket |
|
214 * @internalComponent |
|
215 */ |
|
216 IMPORT_C virtual TInt RegisterMediaDevices(TInt aSocket); |
|
217 }; |
|
218 |
|
219 |
|
220 DMMCPsu* TMMCardControllerInterface::NewVccCore(TInt /*aVccCoreNum*/, TInt /*aMcId*/) |
|
221 /** |
|
222 * Default implementation. |
|
223 * Only eMMC v4.3+ media supports a seperate supply for VccCore. |
|
224 */ |
|
225 {return NULL;}; |
|
226 |
|
227 #endif |
|
228 |
|
229 |