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\pbus.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __P32STD_H__ sl@0: #define __P32STD_H__ sl@0: #include sl@0: sl@0: #ifdef _DEBUG sl@0: #define __ENABLE_SIMULATED_MEDIA_CHANGE // Enables simulation of media change events using ControlIO sl@0: #endif sl@0: sl@0: /******************************************** sl@0: * Peripheral Bus Definitions sl@0: ********************************************/ sl@0: sl@0: /** sl@0: Defines the maximum number of media change objects. sl@0: sl@0: @see DMediaChangeBase sl@0: */ sl@0: const TInt KMaxMediaChanges=4; sl@0: sl@0: sl@0: sl@0: /** sl@0: Defines the maximum number of power supply unit (PSU) objects. sl@0: sl@0: @see DPBusPsuBase sl@0: */ sl@0: const TInt KMaxPBusVccs=4; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: Defines the state of the media, i.e. whether the media door is sl@0: open or closed. sl@0: sl@0: A value of this type is returned by DMediaChangeBase::MediaState(). sl@0: sl@0: @see DMediaChangeBase::MediaState() sl@0: */ sl@0: enum TMediaState { sl@0: /** sl@0: Indicates that the media door is open. sl@0: */ sl@0: EDoorOpen, sl@0: sl@0: /** sl@0: Indicates that the media door is closed. sl@0: */ sl@0: EDoorClosed}; sl@0: sl@0: sl@0: sl@0: sl@0: enum TPBusType {EPBusTypeNone,EPBusTypePcCard,EPBusTypeMultiMedia,EPBusTypeUSB}; sl@0: sl@0: sl@0: sl@0: sl@0: enum TPBusState sl@0: { sl@0: EPBusCardAbsent=0, sl@0: EPBusOff=1, sl@0: EPBusPoweringUp=2, sl@0: EPBusOn=3, sl@0: EPBusPsuFault=4, sl@0: EPBusPowerUpPending=5, sl@0: }; sl@0: sl@0: typedef void (*TPBusCallBackFn)(TAny* aPtr, TInt aReason, TAny* a1, TAny* a2); sl@0: typedef void (*TPBusIsr)(TAny* aPtr, TInt anId); sl@0: sl@0: class DPBusSocket; sl@0: class TPBusCallBack : public SDblQueLink sl@0: { sl@0: public: sl@0: enum TCallBackReason sl@0: { sl@0: EPBusStateChange=0, sl@0: EPBusCustomNotification=1, // Make this the last value sl@0: }; sl@0: public: sl@0: IMPORT_C TPBusCallBack(); sl@0: IMPORT_C TPBusCallBack(TPBusCallBackFn aFunction, TAny* aPtr); sl@0: IMPORT_C TPBusCallBack(TPBusIsr anIsr, TAny* aPtr, TUint anIntMask); sl@0: public: sl@0: inline void NotifyPBusStateChange(TInt aState, TInt anError); sl@0: inline void NotifyCustom(TInt aParam, TInt anError); sl@0: inline void Isr(TInt anId); sl@0: public: sl@0: inline TInt PowerUp(); sl@0: inline TInt PBusState(); sl@0: inline TDfcQue* DfcQ(); sl@0: inline void Add(); sl@0: IMPORT_C void SetSocket(TInt aSocket); sl@0: IMPORT_C void Remove(); sl@0: public: sl@0: DPBusSocket* iSocket; sl@0: TPBusCallBackFn iFunction; sl@0: TUint iIntMask; sl@0: TPBusIsr iIsr; sl@0: TAny* iPtr; sl@0: }; sl@0: sl@0: sl@0: sl@0: class DMediaChangeBase : public DBase sl@0: /** sl@0: Abstract Base class to handle the insertion and removal of removable media. sl@0: sl@0: This class is intended for derivation at the media and variant layers, sl@0: which handles the media/variant specific functionality such as interrupt detection, sl@0: and passes notifications of media change to the peripheral bus socket layers. sl@0: sl@0: @see DMMCMediaChange sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C DMediaChangeBase(TInt aMediaChangeNum); sl@0: IMPORT_C virtual TInt Create(); sl@0: public: sl@0: IMPORT_C void DoorOpenService(); sl@0: IMPORT_C void DoorClosedService(); sl@0: void MediaChangeEvent(TBool aDoorOpened); sl@0: void AcknowledgeEvent(TBool aDoorOpened); sl@0: static void DoorOpenDfcFn(TAny* aPtr); sl@0: public: sl@0: /** sl@0: * Implemented at the media and variant layers. sl@0: * Forces a media change, performs actions as if a door open has occurred. sl@0: * Used for powering down and restarting media. sl@0: * sl@0: * @see DMediaChangeBase::DoDoorOpen() sl@0: */ sl@0: IMPORT_C virtual void ForceMediaChange()=0; sl@0: sl@0: /** sl@0: * Called by DMediaChangeBase::AcknowledgeEvent when the door is opened. sl@0: * Implemented at the media and variant layer, DoDoorOpen is invoked sl@0: * in response to the variant calling ::DoDoorOpenService upon detection of sl@0: * a door open event. sl@0: * sl@0: * @see DMediaChangeBase::DoorOpenService() sl@0: * @see DMediaChangeBase::DoDoorClosed() sl@0: */ sl@0: IMPORT_C virtual void DoDoorOpen()=0; sl@0: sl@0: /** sl@0: * Called by DMediaChangeBase::AcknowledgeEvent when the door is closed. sl@0: * Implemented at the media and variant layer, DoDoorClosed is invoked sl@0: * in response to the variant calling ::DoorOpenService upon detection of sl@0: * a door closed event. sl@0: * sl@0: * @see DMediaChangeBase::DoorOpenService() sl@0: * @see DMediaChangeBase::DoDoorOpen() sl@0: */ sl@0: IMPORT_C virtual void DoDoorClosed()=0; sl@0: sl@0: /** sl@0: * Returns the current state of the door. sl@0: * Implemented at the variant layer to provide information as to the state of the door. sl@0: * sl@0: * @return TMediaState enumeration describing the state of door (EDoorOpen, EDoorClosed) sl@0: */ sl@0: IMPORT_C virtual TMediaState MediaState()=0; sl@0: public: sl@0: /** Unique media change ID, identification scheme is defined by derived classes*/ sl@0: TInt iMediaChangeNum; sl@0: sl@0: /** Count of media events yet to be acknowledged.*/ sl@0: TInt iReplyCount; sl@0: sl@0: /** Door Open DFC queue.*/ sl@0: TDfc iDoorOpenDfc; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: Defines the required state of the PSU. sl@0: sl@0: A value of this type is passed to DPBusPsuBase::DoSetState(). sl@0: sl@0: @see DPBusPsuBase::DoSetState() sl@0: */ sl@0: enum TPBusPsuState { sl@0: /** sl@0: Indicates that the PSU is to be turned off. sl@0: */ sl@0: EPsuOff, sl@0: sl@0: /** sl@0: Indicates that the PSU is to be turned on in current sl@0: limit mode. sl@0: sl@0: Some power supplies can be turned on in a mode that only sl@0: supplies a limited amount of current to the device. sl@0: A faulty device drawing excessive current would cause sl@0: the PSU output voltage to fall, and would be detected sl@0: by the PSU's voltage checking mechanism. After a brief sl@0: checking period in current limit mode, the PSU is sl@0: subsequently turned fully on. sl@0: sl@0: For PSU's that don't support current limit mode, this is sl@0: treated in the same way as EPsuOnFull. sl@0: */ sl@0: EPsuOnCurLimit, sl@0: sl@0: /** sl@0: Indicates that the PSU is to be turned fully on. sl@0: */ sl@0: EPsuOnFull sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: enum TPBusPsuStatus {EPsuStatOff,EPsuStatOn,EPsuStatError}; sl@0: sl@0: sl@0: sl@0: sl@0: const TInt KPBusPsuTickInterval=1000000; // Units 1uS sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: A bit value that is set into the TPBusPsuInfo::iVoltCheckInterval member to sl@0: indicate that the checking of the PSU voltage level can be performed when sl@0: the power supply is first turned on. sl@0: */ sl@0: const TUint KPsuChkWhileOn=0x00000001; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: A bit value that is set into the TPBusPsuInfo::iVoltCheckInterval member to sl@0: indicate that the checking of the PSU voltage level can be performed sl@0: periodically when the power supply is on. sl@0: */ sl@0: const TUint KPsuChkOnPwrUp=0x00000002; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: Defines the methods that can be used by the platform hardware for checking sl@0: the VCC voltage while on. sl@0: */ sl@0: enum TPsuVoltChkMethod { sl@0: /** sl@0: Indicates a simple good/bad check method normally using sl@0: a comparator arrangement. sl@0: */ sl@0: EPsuChkComparator, sl@0: sl@0: /** sl@0: Not implemented. sl@0: */ sl@0: EPsuChkADCType1, sl@0: sl@0: /** sl@0: Not implemented. sl@0: */ sl@0: EPsuChkADCType2 sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: Encapsulates power supply information. sl@0: sl@0: An object of this type is passed to concrete implementations of sl@0: DPBusPsuBase::PsuInfo(), which are required to fill sl@0: the data members of the object. sl@0: */ sl@0: class TPBusPsuInfo sl@0: { sl@0: public: sl@0: /** sl@0: Indicates the voltage level, or range of voltages supported . sl@0: sl@0: The voltage level, or range of voltages is reported as a bit mask sl@0: in the same format as defined for the OCR register. sl@0: sl@0: If the PSU supports voltage adjustment, rather than a single fixed value, sl@0: then bit31 should be set to indicate this fact sl@0: as well as setting the appropriate bits to indicate the adjustable voltage sl@0: range supported. sl@0: */ sl@0: TUint iVoltageSupported; sl@0: sl@0: /** sl@0: The maximum current (in microAmps) that the PSU is able to supply. sl@0: */ sl@0: TInt iMaxCurrentInMicroAmps; sl@0: sl@0: /** sl@0: Indicates whether the platform hardware has support for checking whether sl@0: the voltage level of the PSU is within its expected voltage limit while turned on. sl@0: sl@0: Such a mechanism could detect when a faulty card is drawing excessive current. sl@0: sl@0: Set one or both of the bits KPsuChkWhileOn and KPsuChkOnPwrUp, sl@0: if there is support for voltage checking. sl@0: Set neither bit if there is no support for voltage checking. sl@0: sl@0: @see KPsuChkWhileOn sl@0: @see KPsuChkOnPwrUp sl@0: */ sl@0: TUint iVoltCheckInterval; sl@0: sl@0: /** sl@0: Indicates the method used by the platform hardware for checking sl@0: the VCC voltage while on. sl@0: sl@0: The method used is identified using the values of sl@0: the TPsuVoltChkMethod enum. sl@0: sl@0: @see TPsuVoltChkMethod sl@0: @see DPBusPsuBase::DoCheckVoltage() sl@0: */ sl@0: TPsuVoltChkMethod iVoltCheckMethod; sl@0: sl@0: /** sl@0: Bus not locked timeout period, in seconds, when no clients are registered. sl@0: sl@0: Set to 0 to disable the not locked timer. sl@0: */ sl@0: TInt iNotLockedTimeOut; sl@0: sl@0: /** sl@0: Bus inactivity timeout period, in seconds, when clients are registered. sl@0: sl@0: Set to 0 to disable the inactivity timer. sl@0: */ sl@0: TInt iInactivityTimeOut; sl@0: }; sl@0: sl@0: sl@0: typedef void (*PsuPwrDownCheckFn)(TAny*); sl@0: /** sl@0: Perherpial bus base class to control the power supply. sl@0: sl@0: This class is intended for derivation at both the media driver and variant layer, sl@0: which respectively handle the media/variant specific functionality of the power supply. sl@0: sl@0: @see DMMCPsu sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class DPBusPsuBase : public DBase sl@0: { sl@0: public: sl@0: /** Currently not in use. */ sl@0: enum TResetMode { sl@0: /** Currently not in use.*/ sl@0: ENormalAndRestorable, sl@0: /** Currently not in use.*/ sl@0: EQuickButRestorable, sl@0: /** Currently not in use.*/ sl@0: EQuickAndNotRestorable sl@0: }; sl@0: public: sl@0: DPBusPsuBase(TInt aPsuNum, TInt aMediaChangeNum); sl@0: IMPORT_C TInt SetState(TPBusPsuState aState); sl@0: TPBusPsuStatus Status(); sl@0: TInt CheckVoltage(TUint aCheckStatus); sl@0: void Reset(); sl@0: public: sl@0: TInt Create(); sl@0: IMPORT_C virtual TInt DoCreate(); sl@0: IMPORT_C virtual void DoTickService(); sl@0: IMPORT_C virtual TBool IsLocked(); sl@0: public: sl@0: IMPORT_C virtual void DoSetState(TPBusPsuState aState)=0; sl@0: sl@0: /** sl@0: Base abstract method. sl@0: Checks the voltage level of the PSU is as expected. sl@0: The result is returned by a call to DPBusPsuBase::ReceiveVoltageCheckResult(), sl@0: passing either KErrNone, KErrGeneral to indicate the pass/fail state or sl@0: KErrNotReady if the voltage check isn't complete. sl@0: sl@0: Provided at the variant layer. sl@0: */ sl@0: IMPORT_C virtual void DoCheckVoltage()=0; sl@0: sl@0: /** sl@0: Fills in the supplied TPBusPsuInfo object with the characteristics of the platform. sl@0: Provided at the variant layer. sl@0: sl@0: @param anInfo A reference to a TPBusPsuInfo to be filled in with the PSU characteristics. sl@0: */ sl@0: IMPORT_C virtual void PsuInfo(TPBusPsuInfo &anInfo)=0; sl@0: sl@0: IMPORT_C virtual void ReceiveVoltageCheckResult(TInt anError); sl@0: public: sl@0: inline TUint VoltageSupported(); sl@0: inline void SetCurrLimited(); sl@0: inline TBool IsOff(); sl@0: inline TInt MaxCurrentInMicroAmps(); sl@0: inline void ResetInactivityTimer(); sl@0: public: sl@0: void PwrDownCheck(); sl@0: static void DoPwrDownCheck(TAny* aPtr); sl@0: public: sl@0: /** Unique power supply unit identification number.*/ sl@0: TInt iPsuNum; sl@0: sl@0: /** Currently not in use. */ sl@0: TInt iMediaChangeNum; sl@0: sl@0: /** sl@0: Indicates the method used by the platform hardware for checking sl@0: the VCC voltage while on. sl@0: sl@0: The method used is identified using the values of sl@0: the TPsuVoltChkMethod enum. sl@0: sl@0: @see TPsuVoltChkMethod sl@0: @see DPBusPsuBase::DoCheckVoltage() sl@0: */ sl@0: TPsuVoltChkMethod iVoltCheckMethod; sl@0: sl@0: /** sl@0: Current PSU State. sl@0: @see TPBusPsuState sl@0: */ sl@0: TPBusPsuState iState; sl@0: sl@0: /** PSU current is limited to a safe level. */ sl@0: TBool iCurrLimited; sl@0: sl@0: /** PSU Tick Timer */ sl@0: TTickLink iTickLink; sl@0: sl@0: /** sl@0: Indicates the voltage level, or range of voltages supported . sl@0: sl@0: The voltage level, or range of voltages is reported as a bit mask sl@0: in the same format as defined for the OCR register. sl@0: sl@0: If the PSU supports voltage adjustment, rather than a single fixed value, sl@0: then bit31 should be set to indicate this fact sl@0: as well as setting the appropriate bits to indicate the adjustable voltage sl@0: range supported. sl@0: */ sl@0: TUint iVoltageSupported; sl@0: sl@0: /** The maximum current (in microAmps) that the PSU is able to supply. */ sl@0: TInt iMaxCurrentInMicroAmps; sl@0: sl@0: /** sl@0: Indicates whether the platform hardware has support for checking whether sl@0: the voltage level of the PSU is within its expected voltage limit while turned on. sl@0: sl@0: Such a mechanism could detect when a faulty card is drawing excessive current. sl@0: sl@0: Set one or both of the bits KPsuChkWhileOn and KPsuChkOnPwrUp, sl@0: if there is support for voltage checking. sl@0: Set neither bit if there is no support for voltage checking. sl@0: sl@0: @see KPsuChkWhileOn sl@0: @see KPsuChkOnPwrUp sl@0: */ sl@0: TUint iVoltCheckInterval; sl@0: sl@0: /** Bus inactivity counter. */ sl@0: TInt iInactivityCount; sl@0: sl@0: /** Bus not locked counter. */ sl@0: TInt iNotLockedCount; sl@0: sl@0: /** Bus inactivity timeout period, in seconds, when clients are registered. */ sl@0: TInt iInactivityTimeout; sl@0: sl@0: /** Bus not locked timeout period, in seconds, when no clients are registered. */ sl@0: TInt iNotLockedTimeout; sl@0: sl@0: /** DPBusSocket which the PSU powers. */ sl@0: DPBusSocket* iSocket; // for the moment assume a PSU only powers one socket sl@0: sl@0: /** sl@0: DFC to handle PSU Tick. sl@0: @see DPBusPsuBase::DoTickService() sl@0: @see TDfc sl@0: */ sl@0: TDfc iPsuDfc; sl@0: sl@0: /** Power Down Function to be utilised, default is PwrDownCheck */ sl@0: PsuPwrDownCheckFn iPwrDownCheckFn; sl@0: sl@0: private: sl@0: TUint32 reserved[4]; sl@0: }; sl@0: sl@0: NONSHARABLE_CLASS(DPBusPowerHandler) : public DPowerHandler sl@0: { sl@0: public: sl@0: DPBusPowerHandler(DPBusSocket* aSocket); sl@0: public: // from DPowerHandler sl@0: // signals from manager to client sl@0: void PowerUp(); sl@0: void PowerDown(TPowerState); sl@0: public: sl@0: DPBusSocket* iSocket; sl@0: }; sl@0: sl@0: /** Abstract base class for a PBUS socket. sl@0: DPBusSocket derived class object oversees the power supply and media change functionality with the socket. sl@0: */ sl@0: NONSHARABLE_CLASS(DPBusSocket) : public DBase sl@0: { sl@0: public: sl@0: /** sl@0: Panic codes to handle the invalid powerup and powerdown state of the PBUS. sl@0: @see TPBusState sl@0: */ sl@0: enum TPanic sl@0: { sl@0: /** sl@0: Indicates the invalid door close state. sl@0: */ sl@0: EDoorCloseInvalidState=0, sl@0: sl@0: /** sl@0: Indicates the invalid powerup state of PBUS, considered as invalid if iState is other than TPBusState while powering up. sl@0: */ sl@0: EPowerUpInvalidState=1, sl@0: sl@0: /** Indicates invalid handler state corresponding to powerup event */ sl@0: EPowerUpInvalidHandlerState=2, sl@0: sl@0: /** Invalid return code corresponding to powerup event */ sl@0: EPowerUpInvalidReturnCode=3, sl@0: sl@0: /** sl@0: Indicates the invalid powerdown state of the media device, sl@0: considered as invalid if iState is other than TPBusState while powering down. sl@0: */ sl@0: EEmergencyPowerDownInvalidState=4, sl@0: sl@0: /** sl@0: Indicates the invalid powerup state of the media device, sl@0: considered as invalid if iState is not in (EPBusCardAbsent,EPBusOff and EPBusPowerUpPending) while on transition from standby. sl@0: */ sl@0: EMcPowerUpInvalidState=5, sl@0: }; sl@0: sl@0: /** sl@0: The purpose of this enumeration is to handle the postponed events corresponding to media change and power down event. sl@0: */ sl@0: enum TPostponedEvent sl@0: { sl@0: /** Handles the postponed media change event */ sl@0: EMediaChange=1, sl@0: sl@0: /** Handles the postponed power down event */ sl@0: EPowerDown=2, sl@0: }; sl@0: sl@0: /** sl@0: Enumeration for handling debug functionality. sl@0: */ sl@0: enum TPBusDebugFunction sl@0: { sl@0: /** Media state used for simulation purposes */ sl@0: EControlMediaState sl@0: }; sl@0: sl@0: /** sl@0: PBUS simulated media states. sl@0: */ sl@0: enum TPBusSimulateMediaState sl@0: { sl@0: /** Normal State */ sl@0: EPeriphBusMediaNormal=0, sl@0: sl@0: /** Simulated door open */ sl@0: EPeriphBusDoorOpen=1, sl@0: sl@0: /** Simulated door close with media absent */ sl@0: EPeriphBusMediaRemoved=2, sl@0: sl@0: /** Simulated door close with media present */ sl@0: EPeriphBusMediaPresent=3, sl@0: sl@0: /** Simulate two consecutive door open interrupts */ sl@0: EPeriphBusMediaDoubleDoorOpen=4 sl@0: }; sl@0: sl@0: public: sl@0: DPBusSocket(TInt aSocketNumber); sl@0: IMPORT_C static DPBusSocket* SocketFromId(TInt anId); sl@0: IMPORT_C static void Panic(DPBusSocket::TPanic aPanic); sl@0: public: sl@0: virtual TInt Create(const TDesC* aName); sl@0: virtual TInt Init(); sl@0: sl@0: /** sl@0: Initiates a power up sequence on the stack. This method should be implemented by the derived class. sl@0: The implementation should call PowerUpSequenceComplete() to notify the status on completion of power up sequence. sl@0: sl@0: @see DMMCSocket::InitiatePowerUpSequence() sl@0: @see DMMCStack::PowerUpStack() sl@0: */ sl@0: virtual void InitiatePowerUpSequence()=0; sl@0: sl@0: /** sl@0: Indicates the presence of a card. This method should be implemented by the derived class. sl@0: The implementation should use variant specific implementation of CardDetect() method to detect the card presence. sl@0: sl@0: @return ETrue if a card is present, else EFalse sl@0: @see DMMCStack::CardDetect() sl@0: */ sl@0: virtual TBool CardIsPresent()=0; sl@0: sl@0: /** sl@0: Resets the socket. This method should be implemented by the derived class. sl@0: The implementation should cancel powerup timer and DFC queue if any of this request is outstanding, sl@0: Power down the stack. sl@0: sl@0: @see DMMCSocket::Reset1() sl@0: */ sl@0: virtual void Reset1()=0; sl@0: sl@0: /** sl@0: Resets the socket on media change event.This method should be implemented by the derived class. sl@0: The implementation should remove any allocated memory following a media change event. sl@0: sl@0: */ sl@0: virtual void Reset2()=0; sl@0: public: sl@0: inline TInt State(); sl@0: inline TDfcQue* DfcQ(); sl@0: inline TMediaState MediaState(); sl@0: public: sl@0: IMPORT_C void Add(TPBusCallBack* aCallBack); sl@0: IMPORT_C TInt PowerUp(); sl@0: IMPORT_C void ForceMediaChange(); sl@0: IMPORT_C TInt InCritical(); sl@0: IMPORT_C void EndInCritical(); sl@0: IMPORT_C void DeltaCurrentConsumption(TInt aDelta); sl@0: IMPORT_C void PowerUpSequenceComplete(TInt anError); sl@0: void PsuFault(TInt anError); sl@0: void PsuTimeout(); sl@0: void ResetSocket(TBool aFullReset); sl@0: void ChangeState(TInt aState, TInt anError); sl@0: void MediaChangeEvent(TBool aDoorOpened); sl@0: void DoorOpenEvent(); sl@0: void DoorCloseEvent(); sl@0: void Isr(TInt anId); sl@0: void DoPowerUp(); sl@0: void DoPowerDown(); sl@0: IMPORT_C void PowerDownComplete(); sl@0: IMPORT_C void RequestAsyncPowerDown(); sl@0: IMPORT_C virtual TInt ControlIO(TInt aFunction, TAny* aParam1, TAny* aParam2); sl@0: public: sl@0: /** sl@0: Current PBus type. sl@0: @see TPBusType sl@0: */ sl@0: TPBusType iType; sl@0: /** sl@0: Current socket number. sl@0: */ sl@0: TInt iSocketNumber; sl@0: /** sl@0: Name of the socket. sl@0: */ sl@0: const TDesC* iName; sl@0: /** sl@0: Current state of Peripheral bus controller. sl@0: @see TPBusState sl@0: */ sl@0: TInt iState; sl@0: /** sl@0: Counter to keep track of postponed events. sl@0: */ sl@0: TInt iPostponeCount; sl@0: /** sl@0: Current postponed events. sl@0: @see TPostponedEvent sl@0: */ sl@0: TUint16 iPostponedEvents; sl@0: /** sl@0: Current simulated state of the Media. sl@0: @see TPBusSimulateMediaState sl@0: */ sl@0: TUint16 iSimulatedMediaState; sl@0: /** sl@0: The call back functions queue. sl@0: @see SDblQue sl@0: */ sl@0: SDblQue iCallBackQ; sl@0: /** sl@0: Pointer to DPBusPowerController object. sl@0: @see DPBusPowerHandler sl@0: */ sl@0: DPBusPowerHandler* iPowerHandler; sl@0: sl@0: /** sl@0: Holds media change number. sl@0: @see MediaChangeFromSocket sl@0: */ sl@0: TInt iMediaChangeNumber; sl@0: sl@0: /** sl@0: Pointer to DMediaChangeBase object. sl@0: @see DMediaChangeBase sl@0: */ sl@0: DMediaChangeBase* iMediaChange; sl@0: sl@0: /** sl@0: Holds the state of media door. sl@0: Updated when there is change in media event corresponing to Door open. sl@0: @see DMediaChangeBase::DoorOpenService() sl@0: @see TMediaState sl@0: */ sl@0: TBool iDoorOpened; sl@0: sl@0: /** sl@0: Pointer to DPBusPsuBase object. sl@0: @see DPBusPsuBase sl@0: */ sl@0: DPBusPsuBase* iVcc; sl@0: sl@0: /** sl@0: Indicates the device is in standby state (i.e. Sets to ETrue when the device is in standby state). sl@0: */ sl@0: TBool iStandby; sl@0: sl@0: /** sl@0: DFC to handle media change events like (DoorOpen,DoorClose). sl@0: @see DMediaChangeBase::AcknowledgeEvent sl@0: @see TDfc sl@0: */ sl@0: TDfc iMediaChangeDfc; sl@0: sl@0: /** sl@0: DFC to handle powering up of the device. sl@0: @see TDfc sl@0: */ sl@0: TDfc iPowerUpDfc; sl@0: sl@0: /** sl@0: DFC to handle powerdown state of the device. sl@0: sl@0: @see TDfc sl@0: */ sl@0: TDfc iPowerDownDfc; sl@0: sl@0: /** sl@0: DFC to handle PSU Tick. sl@0: @see DPBusPsuBase::DoTickService() sl@0: @see TDfc sl@0: */ sl@0: TDfc iPsuDfc; sl@0: sl@0: /** sl@0: The DFC queue used for driver functions. sl@0: @see TDfcQue sl@0: */ sl@0: TDfcQue iDfcQ; sl@0: sl@0: /** sl@0: Used when there is request for power down of the device from client. sl@0: */ sl@0: TInt iRequestPowerDownCount; sl@0: }; sl@0: sl@0: GLREF_D DMediaChangeBase* TheMediaChanges[KMaxMediaChanges]; sl@0: GLREF_D DPBusSocket* TheSockets[KMaxPBusSockets]; sl@0: GLREF_D DPBusPsuBase* TheVccs[KMaxPBusVccs]; sl@0: GLREF_D DPBusPsuBase* TheVccCores[KMaxPBusVccs]; sl@0: sl@0: #include sl@0: #endif