sl@0
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32\drivers\pbus\pccard\epoc\pccd_vcc.cpp
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <pccd_vcc.h>
|
sl@0
|
19 |
|
sl@0
|
20 |
DPlatPcCardVcc::DPlatPcCardVcc(TInt aPsuNum, TInt aMediaChangeNum)
|
sl@0
|
21 |
//
|
sl@0
|
22 |
// Constructor.
|
sl@0
|
23 |
//
|
sl@0
|
24 |
: DPcCardVcc(aPsuNum,aMediaChangeNum)
|
sl@0
|
25 |
{}
|
sl@0
|
26 |
|
sl@0
|
27 |
DPlatPcCardVcc::~DPlatPcCardVcc()
|
sl@0
|
28 |
//
|
sl@0
|
29 |
// Destructor
|
sl@0
|
30 |
//
|
sl@0
|
31 |
{}
|
sl@0
|
32 |
|
sl@0
|
33 |
void DPlatPcCardVcc::PsuInfo(TPBusPsuInfo &anInfo)
|
sl@0
|
34 |
//
|
sl@0
|
35 |
// Return machine info relating to the Pc Card Vcc supply
|
sl@0
|
36 |
//
|
sl@0
|
37 |
{
|
sl@0
|
38 |
|
sl@0
|
39 |
ThePccdCntrlInterface->VccInfo(iPsuNum,anInfo);
|
sl@0
|
40 |
}
|
sl@0
|
41 |
|
sl@0
|
42 |
void DPlatPcCardVcc::DoSetState(TPBusPsuState aState)
|
sl@0
|
43 |
//
|
sl@0
|
44 |
// Turn on/off the PSU.
|
sl@0
|
45 |
//
|
sl@0
|
46 |
{
|
sl@0
|
47 |
|
sl@0
|
48 |
switch (aState)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
case EPsuOff:
|
sl@0
|
51 |
ThePccdCntrlInterface->VccOff(iPsuNum);
|
sl@0
|
52 |
__KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-Off"));
|
sl@0
|
53 |
break;
|
sl@0
|
54 |
case EPsuOnFull:
|
sl@0
|
55 |
ThePccdCntrlInterface->VccOnFull(iPsuNum,iVoltageSetting);
|
sl@0
|
56 |
__KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-On"));
|
sl@0
|
57 |
break;
|
sl@0
|
58 |
case EPsuOnCurLimit:
|
sl@0
|
59 |
ThePccdCntrlInterface->VccOnCurrentLimit(iPsuNum,iVoltageSetting);
|
sl@0
|
60 |
__KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-OnL"));
|
sl@0
|
61 |
break;
|
sl@0
|
62 |
}
|
sl@0
|
63 |
}
|
sl@0
|
64 |
|
sl@0
|
65 |
void DPlatPcCardVcc::DoCheckVoltage()
|
sl@0
|
66 |
//
|
sl@0
|
67 |
// Check the voltage level of the PSU is as expected. Returns either KErrNone, KErrGeneral
|
sl@0
|
68 |
// to indicate the pass/fail state or KErrNotReady if the voltage check isn't complete.
|
sl@0
|
69 |
//
|
sl@0
|
70 |
{
|
sl@0
|
71 |
|
sl@0
|
72 |
TInt err=KErrGeneral;
|
sl@0
|
73 |
if (iVoltCheckMethod==EPsuChkComparator)
|
sl@0
|
74 |
err=ThePccdCntrlInterface->VccVoltCheck(iPsuNum);
|
sl@0
|
75 |
ReceiveVoltageCheckResult(err);
|
sl@0
|
76 |
}
|
sl@0
|
77 |
|