kernel/eka/include/drivers/mmc.h
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
  3012 	// Methods for double-buffered data transfer:
  3012 	// Methods for double-buffered data transfer:
  3013 	inline TBool RequestMoreData();
  3013 	inline TBool RequestMoreData();
  3014 	inline void EnableDoubleBuffering(TUint32 aNumBlocks);							  /**< @internalTechnology */
  3014 	inline void EnableDoubleBuffering(TUint32 aNumBlocks);							  /**< @internalTechnology */
  3015 	inline void SetDataTransferCallback(TMMCCallBack& aCallback);					  /**< @internalTechnology */
  3015 	inline void SetDataTransferCallback(TMMCCallBack& aCallback);					  /**< @internalTechnology */
  3016 	inline void MoreDataAvailable(TUint32 aNumBlocks, TUint8* aMemoryP, TInt aError); /**< @internalTechnology */
  3016 	inline void MoreDataAvailable(TUint32 aNumBlocks, TUint8* aMemoryP, TInt aError); /**< @internalTechnology */
  3017 
       
  3018 	inline void SaveCard();			/**< @internalTechnology */
       
  3019 	inline void RestoreCard();		/**< @internalTechnology */
       
  3020 
       
  3021 public:
  3017 public:
  3022 	/**
  3018 	/**
  3023     The last R1 response.
  3019     The last R1 response.
  3024 	*/
  3020 	*/
  3025 	TMMCStatus iLastStatus;
  3021 	TMMCStatus iLastStatus;
  3059 	
  3055 	
  3060 	TMMCCommandDesc iCommand[KMaxMMCCommandStackDepth];	// Command stack
  3056 	TMMCCommandDesc iCommand[KMaxMMCCommandStackDepth];	// Command stack
  3061 	
  3057 	
  3062 	TMMCCallBack iDataTransferCallback;	// A callback function, used to request more data when performing double-buffering
  3058 	TMMCCallBack iDataTransferCallback;	// A callback function, used to request more data when performing double-buffering
  3063 
  3059 
  3064 	TUint32 iSpare[21];				// Spare data (stolen from iCommand)
  3060 	TUint32 iSpare[22];				// Spare data (stolen from iCommand)
  3065 
       
  3066 	TMMCard* iSavedCardP;			// Saved copy of iCardP
       
  3067 
  3061 
  3068 	TMMCStateMachine iMachine;		// State Machine context
  3062 	TMMCStateMachine iMachine;		// State Machine context
  3069 #ifdef __EPOC32__
  3063 #ifdef __EPOC32__
  3070 	NTimer iPollTimer;
  3064 	NTimer iPollTimer;
  3071 	NTimer iRetryTimer;
  3065 	NTimer iRetryTimer;
  3095 		KInterfaceMachineInfo,
  3089 		KInterfaceMachineInfo,
  3096 		KInterfaceSwitchToLowVoltageSM,
  3090 		KInterfaceSwitchToLowVoltageSM,
  3097 		KInterfaceSetBusWidth,
  3091 		KInterfaceSetBusWidth,
  3098 		KInterfaceDemandPagingInfo,
  3092 		KInterfaceDemandPagingInfo,
  3099 		KInterfaceCancelSession,
  3093 		KInterfaceCancelSession,
  3100 		KInterfaceDoWakeUpSM,
  3094 		KInterfaceDoWakeUpSM
  3101 		KInterfaceAddressCard,
       
  3102 		};
  3095 		};
  3103 
  3096 
  3104 	/** generic interface */
  3097 	/** generic interface */
  3105 	class MInterface
  3098 	class MInterface
  3106 		{
  3099 		{
  3140 	 */
  3133 	 */
  3141 	class MDoWakeUp
  3134 	class MDoWakeUp
  3142 		{
  3135 		{
  3143 	public:
  3136 	public:
  3144 		virtual TMMCErr DoWakeUpSM()=0;
  3137 		virtual TMMCErr DoWakeUpSM()=0;
  3145 		};
       
  3146 
       
  3147 	/**
       
  3148 	 * An optional interface implemented by the derived class. Used when the stack supports more than one 
       
  3149 	 * card and the cards are individually selectable, i.e. iMultiplexedBus is true
       
  3150 	 * @see KInterfaceAddressCard
       
  3151 	 */
       
  3152 	class MAddressCard
       
  3153 		{
       
  3154 	public:
       
  3155 		virtual void AddressCard(TInt aCardNumber)=0;
       
  3156 		};
  3138 		};
  3157 
  3139 
  3158 
  3140 
  3159 public:
  3141 public:
  3160 	IMPORT_C DMMCStack(TInt aBus, DMMCSocket* aSocket);
  3142 	IMPORT_C DMMCStack(TInt aBus, DMMCSocket* aSocket);
  3542 		E52MhzMask = E4Bits52Mhz | E8Bits52Mhz
  3524 		E52MhzMask = E4Bits52Mhz | E8Bits52Mhz
  3543 		};
  3525 		};
  3544 
  3526 
  3545 	void DetermineBusWidthAndClock(const TMMCard& aCard, TBool aLowVoltage, TUint& aPowerClass, TBusWidthAndClock& aBusWidthAndClock);
  3527 	void DetermineBusWidthAndClock(const TMMCard& aCard, TBool aLowVoltage, TUint& aPowerClass, TBusWidthAndClock& aBusWidthAndClock);
  3546 	TUint GetPowerClass(const TMMCard& aCard, TBusWidthAndClock aWidthAndClock, TBool aLowVoltage);
  3528 	TUint GetPowerClass(const TMMCard& aCard, TBusWidthAndClock aWidthAndClock, TBool aLowVoltage);
  3547 	
       
  3548 	void DoAddressCard(TInt aCardNumber);
       
  3549 
  3529 
  3550 
  3530 
  3551     //	----------- Data Members -------------
  3531     //	----------- Data Members -------------
  3552 private:
  3532 private:
  3553 	//
  3533 	//
  3622     IMPORT_C virtual void Dummy1();
  3602     IMPORT_C virtual void Dummy1();
  3623 
  3603 
  3624 protected:
  3604 protected:
  3625 	/** 
  3605 	/** 
  3626 	Gets an interface from a derived class
  3606 	Gets an interface from a derived class
  3627 	N.B the derived class should call the base class's default implementation of this function
       
  3628 	if it does not support the specified interface
       
  3629 	replaces reserved virtual Dummy4()
  3607 	replaces reserved virtual Dummy4()
  3630 	*/
  3608 	*/
  3631 	IMPORT_C virtual void GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr);
  3609 	IMPORT_C virtual void GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr);
  3632 
  3610 
  3633 private:
  3611 private:
  4127 		EMMCInvalidDBCommand			=16,
  4105 		EMMCInvalidDBCommand			=16,
  4128 		EMMCInvalidDBBlockLength		=17,
  4106 		EMMCInvalidDBBlockLength		=17,
  4129 		EMMCUnblockingInWrongContext	=18,
  4107 		EMMCUnblockingInWrongContext	=18,
  4130 		EMMCInvalidCardNumber			=19,
  4108 		EMMCInvalidCardNumber			=19,
  4131 		EMMCNotInDfcContext				=20,
  4109 		EMMCNotInDfcContext				=20,
  4132 		EMMCAddressCardNotSupported		=21,
       
  4133 		};
  4110 		};
  4134     IMPORT_C static void Panic(TMMCPanic aPanic);
  4111     IMPORT_C static void Panic(TMMCPanic aPanic);
  4135 	friend class DMMCStack;
  4112 	friend class DMMCStack;
  4136 	friend class DMMCSession;
  4113 	friend class DMMCSession;
  4137 	friend class DMMCMediaChange;
  4114 	friend class DMMCMediaChange;