1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/pbus.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,108 @@
1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\drivers\pbus.inl
1.18 +//
1.19 +// WARNING: This file contains some APIs which are internal and are subject
1.20 +// to change without noticed. Such APIs should therefore not be used
1.21 +// outside the Kernel and Hardware Services package.
1.22 +//
1.23 +
1.24 +// Class TPBusCallBack
1.25 +inline void TPBusCallBack::NotifyPBusStateChange(TInt aState, TInt anError)
1.26 + { if (iFunction) (*iFunction)(iPtr,EPBusStateChange,(TAny*)aState,(TAny*)anError); }
1.27 +inline void TPBusCallBack::NotifyCustom(TInt aParam, TInt anError)
1.28 + { if (iFunction) (*iFunction)(iPtr,EPBusCustomNotification,(TAny*)aParam,(TAny*)anError); }
1.29 +inline void TPBusCallBack::Isr(TInt anId)
1.30 + { if (iIntMask&(1<<anId)) (*iIsr)(iPtr,anId); }
1.31 +inline TInt TPBusCallBack::PowerUp()
1.32 + { return iSocket->PowerUp(); }
1.33 +inline TInt TPBusCallBack::PBusState()
1.34 + { return iSocket->State(); }
1.35 +inline TDfcQue* TPBusCallBack::DfcQ()
1.36 + { return iSocket->DfcQ(); }
1.37 +inline void TPBusCallBack::Add()
1.38 + { iSocket->Add(this); }
1.39 +
1.40 +// Class DPBusPsuBase
1.41 +/**
1.42 +Checks whether the PSU is off.
1.43 +
1.44 +The PSU is off when it is in the EPsuOff state.
1.45 +
1.46 +@see EPsuOff
1.47 +
1.48 +@return ETrue PSU state is EPsuOff, EFalse otherwise
1.49 +*/
1.50 +inline TBool DPBusPsuBase::IsOff()
1.51 + {return(iState==EPsuOff);}
1.52 +
1.53 +/**
1.54 +Limits the PSU current to a safe level.
1.55 +*/
1.56 +inline void DPBusPsuBase::SetCurrLimited()
1.57 + {iCurrLimited=ETrue;}
1.58 +
1.59 +/**
1.60 +Resets inactivity and not-locked counts.
1.61 +*/
1.62 +inline void DPBusPsuBase::ResetInactivityTimer()
1.63 + {iInactivityCount=0; iNotLockedCount=0;}
1.64 +
1.65 +/**
1.66 +Gets the voltage level, or range of supported voltage levels.
1.67 +
1.68 +@return The voltage level, or range of voltages supported.
1.69 +
1.70 +@see TPBusPsuInfo::iVoltageSupported
1.71 +*/
1.72 +inline TUint DPBusPsuBase::VoltageSupported()
1.73 + {return(iVoltageSupported);}
1.74 +
1.75 +/**
1.76 +Gets the maximum current (in microAmps) that the PSU is able to supply.
1.77 +
1.78 +@return Maximum current (in microAmps).
1.79 +
1.80 +@see TPBusPsuInfo::iMaxCurrentInMicroAmps
1.81 +*/
1.82 +inline TInt DPBusPsuBase::MaxCurrentInMicroAmps()
1.83 + {return(iMaxCurrentInMicroAmps);}
1.84 +
1.85 +
1.86 +// class DPBusSocket
1.87 +
1.88 +/**
1.89 + Gets the current PBUS state.
1.90 + @return Current PBus state.
1.91 + @see TPBusState
1.92 + */
1.93 +inline TInt DPBusSocket::State()
1.94 + { return iState; }
1.95 +/**
1.96 + This function returns the address of DPBusSocket::iDfcQ queue.
1.97 + @return Address of DPBusSocket::iDfcQ
1.98 + @see TDfcQue
1.99 + */
1.100 +inline TDfcQue* DPBusSocket::DfcQ()
1.101 + { return &iDfcQ; }
1.102 +
1.103 +/**
1.104 + Gets media state as EDoorOpen if the media door is open, EDoorClosed if the media door is closed.
1.105 + @return TMediaState enumeration describing the state of door (EDoorOpen, EDoorClosed)
1.106 + @see TMediaState
1.107 + */
1.108 +inline TMediaState DPBusSocket::MediaState()
1.109 + { return iMediaChange->MediaState(); }
1.110 +
1.111 +