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.inl sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without noticed. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: // Class TPBusCallBack sl@0: inline void TPBusCallBack::NotifyPBusStateChange(TInt aState, TInt anError) sl@0: { if (iFunction) (*iFunction)(iPtr,EPBusStateChange,(TAny*)aState,(TAny*)anError); } sl@0: inline void TPBusCallBack::NotifyCustom(TInt aParam, TInt anError) sl@0: { if (iFunction) (*iFunction)(iPtr,EPBusCustomNotification,(TAny*)aParam,(TAny*)anError); } sl@0: inline void TPBusCallBack::Isr(TInt anId) sl@0: { if (iIntMask&(1<PowerUp(); } sl@0: inline TInt TPBusCallBack::PBusState() sl@0: { return iSocket->State(); } sl@0: inline TDfcQue* TPBusCallBack::DfcQ() sl@0: { return iSocket->DfcQ(); } sl@0: inline void TPBusCallBack::Add() sl@0: { iSocket->Add(this); } sl@0: sl@0: // Class DPBusPsuBase sl@0: /** sl@0: Checks whether the PSU is off. sl@0: sl@0: The PSU is off when it is in the EPsuOff state. sl@0: sl@0: @see EPsuOff sl@0: sl@0: @return ETrue PSU state is EPsuOff, EFalse otherwise sl@0: */ sl@0: inline TBool DPBusPsuBase::IsOff() sl@0: {return(iState==EPsuOff);} sl@0: sl@0: /** sl@0: Limits the PSU current to a safe level. sl@0: */ sl@0: inline void DPBusPsuBase::SetCurrLimited() sl@0: {iCurrLimited=ETrue;} sl@0: sl@0: /** sl@0: Resets inactivity and not-locked counts. sl@0: */ sl@0: inline void DPBusPsuBase::ResetInactivityTimer() sl@0: {iInactivityCount=0; iNotLockedCount=0;} sl@0: sl@0: /** sl@0: Gets the voltage level, or range of supported voltage levels. sl@0: sl@0: @return The voltage level, or range of voltages supported. sl@0: sl@0: @see TPBusPsuInfo::iVoltageSupported sl@0: */ sl@0: inline TUint DPBusPsuBase::VoltageSupported() sl@0: {return(iVoltageSupported);} sl@0: sl@0: /** sl@0: Gets the maximum current (in microAmps) that the PSU is able to supply. sl@0: sl@0: @return Maximum current (in microAmps). sl@0: sl@0: @see TPBusPsuInfo::iMaxCurrentInMicroAmps sl@0: */ sl@0: inline TInt DPBusPsuBase::MaxCurrentInMicroAmps() sl@0: {return(iMaxCurrentInMicroAmps);} sl@0: sl@0: sl@0: // class DPBusSocket sl@0: sl@0: /** sl@0: Gets the current PBUS state. sl@0: @return Current PBus state. sl@0: @see TPBusState sl@0: */ sl@0: inline TInt DPBusSocket::State() sl@0: { return iState; } sl@0: /** sl@0: This function returns the address of DPBusSocket::iDfcQ queue. sl@0: @return Address of DPBusSocket::iDfcQ sl@0: @see TDfcQue sl@0: */ sl@0: inline TDfcQue* DPBusSocket::DfcQ() sl@0: { return &iDfcQ; } sl@0: sl@0: /** sl@0: Gets media state as EDoorOpen if the media door is open, EDoorClosed if the media door is closed. sl@0: @return TMediaState enumeration describing the state of door (EDoorOpen, EDoorClosed) sl@0: @see TMediaState sl@0: */ sl@0: inline TMediaState DPBusSocket::MediaState() sl@0: { return iMediaChange->MediaState(); } sl@0: sl@0: