sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\include\drivers\mmccd_ifc.h sl@0: // Factory class for creating platform-specific MMC Drivers sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __MMCCD_IFC_H__ sl@0: #define __MMCCD_IFC_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: The factory class for creating platform specific MultiMediaCard objects. sl@0: sl@0: The class defines the interface that must be implemented by a derived class. sl@0: */ sl@0: class TMMCardControllerInterface sl@0: { sl@0: public: sl@0: IMPORT_C TInt Create(); sl@0: sl@0: sl@0: /** sl@0: Creates a platform specific socket object. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aSocketNum The socket number. sl@0: @param aPasswordStore A pointer to the password store. sl@0: sl@0: @return A pointer to the new socket object. sl@0: sl@0: @see Create() sl@0: */ sl@0: virtual DMMCSocket* NewSocket(TInt aSocketNum, TMMCPasswordStore* aPasswordStore)=0; sl@0: sl@0: sl@0: /** sl@0: Creates a platform specific stack object. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aSocketNum The socket number. sl@0: @param aSocket A pointer to the socket object. sl@0: sl@0: @return A pointer to the new stack object. sl@0: sl@0: @see Create() sl@0: */ sl@0: virtual DMMCStack* NewStack(TInt aSocketNum, DMMCSocket* aSocket)=0; sl@0: sl@0: sl@0: /** sl@0: Creates a platform specific media change object. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aMcId The media change number. sl@0: sl@0: @return A pointer to the new media change object. sl@0: sl@0: @see Create() sl@0: @see MediaChangeID() sl@0: */ sl@0: virtual DMMCMediaChange* NewMediaChange(TInt aMcId)=0; sl@0: sl@0: sl@0: /** sl@0: Creates a platform specific power supply unit object. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aVccNum The power supply unit number sl@0: @param aMcId The associated media change number. sl@0: sl@0: @return A pointer to the new power supply unit object. sl@0: sl@0: @see Create() sl@0: @see MediaChangeID() sl@0: @see VccID() sl@0: */ sl@0: virtual DMMCPsu* NewVcc(TInt aVccNum, TInt aMcId)=0; sl@0: sl@0: /** sl@0: Creates a platform specific VccCore power supply unit object. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation can be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aVccQNum The power supply unit number (must match paired Vcc unit number). sl@0: @param aMcId The associated media change number. sl@0: sl@0: @return A pointer to the new power supply unit object. sl@0: sl@0: @see Create() sl@0: @see MediaChangeID() sl@0: @see VccID() sl@0: */ sl@0: virtual inline DMMCPsu* NewVccCore(TInt aVccCoreNum, TInt aMcId); sl@0: sl@0: sl@0: /** sl@0: Performs platform specific initialisation. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @return KErrNone to indicate that initialisation has completed sl@0: successfully, otherwise one of the other system-wide error codes sl@0: to indicate initialisation failure. sl@0: sl@0: @see Create() sl@0: */ sl@0: virtual TInt Init()=0; sl@0: sl@0: sl@0: /** sl@0: Indicates whether the peripheral bus socket, as identified by the specified sl@0: peripheral bus socket number, is designated as a MultiMediaCard socket on sl@0: this platform. sl@0: sl@0: If the socket is designated as a MultiMediaCard socket, then the function sl@0: must also provide the media information for that socket. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aSocket The peripheral bus socket number. sl@0: @param aMediaDeviceInfo The media information for that socket, if sl@0: the socket is designated as a MultiMediaCard sl@0: socket. sl@0: sl@0: @return True, if the socket is designated as a MultiMediaCard socket; sl@0: false, otherwise. sl@0: sl@0: @see Create() sl@0: */ sl@0: virtual TBool IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo)=0; sl@0: sl@0: sl@0: /** sl@0: Reports which media change object is to be associated with the specified sl@0: peripheral bus socket number. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aSocket The socket number sl@0: sl@0: @return The media change number. sl@0: sl@0: @see Create() sl@0: @see NewMediaChange() sl@0: */ sl@0: virtual TInt MediaChangeID(TInt aSocket)=0; sl@0: sl@0: sl@0: /** sl@0: Reports which power supply unit (PSU) object is to be associated with sl@0: the specified peripheral bus socket number. sl@0: sl@0: The function is called from TMMCardControllerInterface::Create(), and sl@0: an implementation must be provided by the platform specific layer in sl@0: the Variant DLL. sl@0: sl@0: @param aSocket The socket number. sl@0: sl@0: @return The power supply unit number. sl@0: sl@0: @see Create() sl@0: @see NewVcc() sl@0: */ sl@0: virtual TInt VccID(TInt aSocket)=0; sl@0: sl@0: protected: sl@0: sl@0: sl@0: /** sl@0: * Performs registration of the media devices on the current socket sl@0: * @internalComponent sl@0: */ sl@0: IMPORT_C virtual TInt RegisterMediaDevices(TInt aSocket); sl@0: }; sl@0: sl@0: sl@0: DMMCPsu* TMMCardControllerInterface::NewVccCore(TInt /*aVccCoreNum*/, TInt /*aMcId*/) sl@0: /** sl@0: * Default implementation. sl@0: * Only eMMC v4.3+ media supports a seperate supply for VccCore. sl@0: */ sl@0: {return NULL;}; sl@0: sl@0: #endif sl@0: sl@0: