1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/drivers/pbus/pccard/epoc/pccd_vcc.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,77 @@
1.4 +// Copyright (c) 1995-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\drivers\pbus\pccard\epoc\pccd_vcc.cpp
1.18 +//
1.19 +//
1.20 +
1.21 +#include <pccd_vcc.h>
1.22 +
1.23 +DPlatPcCardVcc::DPlatPcCardVcc(TInt aPsuNum, TInt aMediaChangeNum)
1.24 +//
1.25 +// Constructor.
1.26 +//
1.27 + : DPcCardVcc(aPsuNum,aMediaChangeNum)
1.28 + {}
1.29 +
1.30 +DPlatPcCardVcc::~DPlatPcCardVcc()
1.31 +//
1.32 +// Destructor
1.33 +//
1.34 + {}
1.35 +
1.36 +void DPlatPcCardVcc::PsuInfo(TPBusPsuInfo &anInfo)
1.37 +//
1.38 +// Return machine info relating to the Pc Card Vcc supply
1.39 +//
1.40 + {
1.41 +
1.42 + ThePccdCntrlInterface->VccInfo(iPsuNum,anInfo);
1.43 + }
1.44 +
1.45 +void DPlatPcCardVcc::DoSetState(TPBusPsuState aState)
1.46 +//
1.47 +// Turn on/off the PSU.
1.48 +//
1.49 + {
1.50 +
1.51 + switch (aState)
1.52 + {
1.53 + case EPsuOff:
1.54 + ThePccdCntrlInterface->VccOff(iPsuNum);
1.55 + __KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-Off"));
1.56 + break;
1.57 + case EPsuOnFull:
1.58 + ThePccdCntrlInterface->VccOnFull(iPsuNum,iVoltageSetting);
1.59 + __KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-On"));
1.60 + break;
1.61 + case EPsuOnCurLimit:
1.62 + ThePccdCntrlInterface->VccOnCurrentLimit(iPsuNum,iVoltageSetting);
1.63 + __KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-OnL"));
1.64 + break;
1.65 + }
1.66 + }
1.67 +
1.68 +void DPlatPcCardVcc::DoCheckVoltage()
1.69 +//
1.70 +// Check the voltage level of the PSU is as expected. Returns either KErrNone, KErrGeneral
1.71 +// to indicate the pass/fail state or KErrNotReady if the voltage check isn't complete.
1.72 +//
1.73 + {
1.74 +
1.75 + TInt err=KErrGeneral;
1.76 + if (iVoltCheckMethod==EPsuChkComparator)
1.77 + err=ThePccdCntrlInterface->VccVoltCheck(iPsuNum);
1.78 + ReceiveVoltageCheckResult(err);
1.79 + }
1.80 +