|
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32\include\drivers\pbus.inl |
|
15 // |
|
16 // WARNING: This file contains some APIs which are internal and are subject |
|
17 // to change without noticed. Such APIs should therefore not be used |
|
18 // outside the Kernel and Hardware Services package. |
|
19 // |
|
20 |
|
21 // Class TPBusCallBack |
|
22 inline void TPBusCallBack::NotifyPBusStateChange(TInt aState, TInt anError) |
|
23 { if (iFunction) (*iFunction)(iPtr,EPBusStateChange,(TAny*)aState,(TAny*)anError); } |
|
24 inline void TPBusCallBack::NotifyCustom(TInt aParam, TInt anError) |
|
25 { if (iFunction) (*iFunction)(iPtr,EPBusCustomNotification,(TAny*)aParam,(TAny*)anError); } |
|
26 inline void TPBusCallBack::Isr(TInt anId) |
|
27 { if (iIntMask&(1<<anId)) (*iIsr)(iPtr,anId); } |
|
28 inline TInt TPBusCallBack::PowerUp() |
|
29 { return iSocket->PowerUp(); } |
|
30 inline TInt TPBusCallBack::PBusState() |
|
31 { return iSocket->State(); } |
|
32 inline TDfcQue* TPBusCallBack::DfcQ() |
|
33 { return iSocket->DfcQ(); } |
|
34 inline void TPBusCallBack::Add() |
|
35 { iSocket->Add(this); } |
|
36 |
|
37 // Class DPBusPsuBase |
|
38 /** |
|
39 Checks whether the PSU is off. |
|
40 |
|
41 The PSU is off when it is in the EPsuOff state. |
|
42 |
|
43 @see EPsuOff |
|
44 |
|
45 @return ETrue PSU state is EPsuOff, EFalse otherwise |
|
46 */ |
|
47 inline TBool DPBusPsuBase::IsOff() |
|
48 {return(iState==EPsuOff);} |
|
49 |
|
50 /** |
|
51 Limits the PSU current to a safe level. |
|
52 */ |
|
53 inline void DPBusPsuBase::SetCurrLimited() |
|
54 {iCurrLimited=ETrue;} |
|
55 |
|
56 /** |
|
57 Resets inactivity and not-locked counts. |
|
58 */ |
|
59 inline void DPBusPsuBase::ResetInactivityTimer() |
|
60 {iInactivityCount=0; iNotLockedCount=0;} |
|
61 |
|
62 /** |
|
63 Gets the voltage level, or range of supported voltage levels. |
|
64 |
|
65 @return The voltage level, or range of voltages supported. |
|
66 |
|
67 @see TPBusPsuInfo::iVoltageSupported |
|
68 */ |
|
69 inline TUint DPBusPsuBase::VoltageSupported() |
|
70 {return(iVoltageSupported);} |
|
71 |
|
72 /** |
|
73 Gets the maximum current (in microAmps) that the PSU is able to supply. |
|
74 |
|
75 @return Maximum current (in microAmps). |
|
76 |
|
77 @see TPBusPsuInfo::iMaxCurrentInMicroAmps |
|
78 */ |
|
79 inline TInt DPBusPsuBase::MaxCurrentInMicroAmps() |
|
80 {return(iMaxCurrentInMicroAmps);} |
|
81 |
|
82 |
|
83 // class DPBusSocket |
|
84 |
|
85 /** |
|
86 Gets the current PBUS state. |
|
87 @return Current PBus state. |
|
88 @see TPBusState |
|
89 */ |
|
90 inline TInt DPBusSocket::State() |
|
91 { return iState; } |
|
92 /** |
|
93 This function returns the address of DPBusSocket::iDfcQ queue. |
|
94 @return Address of DPBusSocket::iDfcQ |
|
95 @see TDfcQue |
|
96 */ |
|
97 inline TDfcQue* DPBusSocket::DfcQ() |
|
98 { return &iDfcQ; } |
|
99 |
|
100 /** |
|
101 Gets media state as EDoorOpen if the media door is open, EDoorClosed if the media door is closed. |
|
102 @return TMediaState enumeration describing the state of door (EDoorOpen, EDoorClosed) |
|
103 @see TMediaState |
|
104 */ |
|
105 inline TMediaState DPBusSocket::MediaState() |
|
106 { return iMediaChange->MediaState(); } |
|
107 |
|
108 |