1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/drivers/pbus.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,103 @@
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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +//
1.20 +
1.21 +// Class TPBusCallBack
1.22 +inline void TPBusCallBack::NotifyPBusStateChange(TInt aState, TInt anError)
1.23 + { if (iFunction) (*iFunction)(iPtr,EPBusStateChange,(TAny*)aState,(TAny*)anError); }
1.24 +inline void TPBusCallBack::NotifyCustom(TInt aParam, TInt anError)
1.25 + { if (iFunction) (*iFunction)(iPtr,EPBusCustomNotification,(TAny*)aParam,(TAny*)anError); }
1.26 +inline void TPBusCallBack::Isr(TInt anId)
1.27 + { if (iIntMask&(1<<anId)) (*iIsr)(iPtr,anId); }
1.28 +inline TInt TPBusCallBack::PowerUp()
1.29 + { return iSocket->PowerUp(); }
1.30 +inline TInt TPBusCallBack::PBusState()
1.31 + { return iSocket->State(); }
1.32 +inline TDfcQue* TPBusCallBack::DfcQ()
1.33 + { return iSocket->DfcQ(); }
1.34 +inline void TPBusCallBack::Add()
1.35 + { iSocket->Add(this); }
1.36 +
1.37 +// Class DPBusPsuBase
1.38 +/**
1.39 +Checks whether the PSU is off.
1.40 +
1.41 +The PSU is off when it is in the EPsuOff state.
1.42 +
1.43 +@see EPsuOff
1.44 +
1.45 +@return ETrue PSU state is EPsuOff, EFalse otherwise
1.46 +*/
1.47 +inline TBool DPBusPsuBase::IsOff()
1.48 + {return(iState==EPsuOff);}
1.49 +
1.50 +/**
1.51 +Limits the PSU current to a safe level.
1.52 +*/
1.53 +inline void DPBusPsuBase::SetCurrLimited()
1.54 + {iCurrLimited=ETrue;}
1.55 +
1.56 +/**
1.57 +Resets inactivity and not-locked counts.
1.58 +*/
1.59 +inline void DPBusPsuBase::ResetInactivityTimer()
1.60 + {iInactivityCount=0; iNotLockedCount=0;}
1.61 +
1.62 +/**
1.63 +Gets the voltage level, or range of supported voltage levels.
1.64 +
1.65 +@return The voltage level, or range of voltages supported.
1.66 +
1.67 +@see TPBusPsuInfo::iVoltageSupported
1.68 +*/
1.69 +inline TUint DPBusPsuBase::VoltageSupported()
1.70 + {return(iVoltageSupported);}
1.71 +
1.72 +/**
1.73 +Gets the maximum current (in microAmps) that the PSU is able to supply.
1.74 +
1.75 +@return Maximum current (in microAmps).
1.76 +
1.77 +@see TPBusPsuInfo::iMaxCurrentInMicroAmps
1.78 +*/
1.79 +inline TInt DPBusPsuBase::MaxCurrentInMicroAmps()
1.80 + {return(iMaxCurrentInMicroAmps);}
1.81 +
1.82 +
1.83 +// class DPBusSocket
1.84 +
1.85 +/**
1.86 + Gets the current PBUS state.
1.87 + @return Current PBus state.
1.88 + @see TPBusState
1.89 + */
1.90 +inline TInt DPBusSocket::State()
1.91 + { return iState; }
1.92 +/**
1.93 + This function returns the address of DPBusSocket::iDfcQ queue.
1.94 + @return Address of DPBusSocket::iDfcQ
1.95 + @see TDfcQue
1.96 + */
1.97 +inline TDfcQue* DPBusSocket::DfcQ()
1.98 + { return &iDfcQ; }
1.99 +
1.100 +/**
1.101 + Gets media state as EDoorOpen if the media door is open, EDoorClosed if the media door is closed.
1.102 + @return TMediaState enumeration describing the state of door (EDoorOpen, EDoorClosed)
1.103 + @see TMediaState
1.104 + */
1.105 +inline TMediaState DPBusSocket::MediaState()
1.106 + { return iMediaChange->MediaState(); }