williamr@2: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // e32\include\drivers\pbus.inl williamr@2: // williamr@2: // williamr@2: williamr@2: // Class TPBusCallBack williamr@2: inline void TPBusCallBack::NotifyPBusStateChange(TInt aState, TInt anError) williamr@2: { if (iFunction) (*iFunction)(iPtr,EPBusStateChange,(TAny*)aState,(TAny*)anError); } williamr@2: inline void TPBusCallBack::NotifyCustom(TInt aParam, TInt anError) williamr@2: { if (iFunction) (*iFunction)(iPtr,EPBusCustomNotification,(TAny*)aParam,(TAny*)anError); } williamr@2: inline void TPBusCallBack::Isr(TInt anId) williamr@2: { if (iIntMask&(1<PowerUp(); } williamr@2: inline TInt TPBusCallBack::PBusState() williamr@2: { return iSocket->State(); } williamr@2: inline TDfcQue* TPBusCallBack::DfcQ() williamr@2: { return iSocket->DfcQ(); } williamr@2: inline void TPBusCallBack::Add() williamr@2: { iSocket->Add(this); } williamr@2: williamr@2: // Class DPBusPsuBase williamr@2: /** williamr@2: Checks whether the PSU is off. williamr@2: williamr@2: The PSU is off when it is in the EPsuOff state. williamr@2: williamr@2: @see EPsuOff williamr@2: williamr@2: @return ETrue PSU state is EPsuOff, EFalse otherwise williamr@2: */ williamr@2: inline TBool DPBusPsuBase::IsOff() williamr@2: {return(iState==EPsuOff);} williamr@2: williamr@2: /** williamr@2: Limits the PSU current to a safe level. williamr@2: */ williamr@2: inline void DPBusPsuBase::SetCurrLimited() williamr@2: {iCurrLimited=ETrue;} williamr@2: williamr@2: /** williamr@2: Resets inactivity and not-locked counts. williamr@2: */ williamr@2: inline void DPBusPsuBase::ResetInactivityTimer() williamr@2: {iInactivityCount=0; iNotLockedCount=0;} williamr@2: williamr@2: /** williamr@2: Gets the voltage level, or range of supported voltage levels. williamr@2: williamr@2: @return The voltage level, or range of voltages supported. williamr@2: williamr@2: @see TPBusPsuInfo::iVoltageSupported williamr@2: */ williamr@2: inline TUint DPBusPsuBase::VoltageSupported() williamr@2: {return(iVoltageSupported);} williamr@2: williamr@2: /** williamr@2: Gets the maximum current (in microAmps) that the PSU is able to supply. williamr@2: williamr@2: @return Maximum current (in microAmps). williamr@2: williamr@2: @see TPBusPsuInfo::iMaxCurrentInMicroAmps williamr@2: */ williamr@2: inline TInt DPBusPsuBase::MaxCurrentInMicroAmps() williamr@2: {return(iMaxCurrentInMicroAmps);} williamr@2: williamr@2: williamr@2: // class DPBusSocket williamr@2: williamr@2: /** williamr@2: Gets the current PBUS state. williamr@2: @return Current PBus state. williamr@2: @see TPBusState williamr@2: */ williamr@2: inline TInt DPBusSocket::State() williamr@2: { return iState; } williamr@2: /** williamr@2: This function returns the address of DPBusSocket::iDfcQ queue. williamr@2: @return Address of DPBusSocket::iDfcQ williamr@2: @see TDfcQue williamr@2: */ williamr@2: inline TDfcQue* DPBusSocket::DfcQ() williamr@2: { return &iDfcQ; } williamr@2: williamr@2: /** williamr@2: Gets media state as EDoorOpen if the media door is open, EDoorClosed if the media door is closed. williamr@2: @return TMediaState enumeration describing the state of door (EDoorOpen, EDoorClosed) williamr@2: @see TMediaState williamr@2: */ williamr@2: inline TMediaState DPBusSocket::MediaState() williamr@2: { return iMediaChange->MediaState(); }