sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\drivers\pbus\pccard\epoc\pccd_vcc.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: sl@0: DPlatPcCardVcc::DPlatPcCardVcc(TInt aPsuNum, TInt aMediaChangeNum) sl@0: // sl@0: // Constructor. sl@0: // sl@0: : DPcCardVcc(aPsuNum,aMediaChangeNum) sl@0: {} sl@0: sl@0: DPlatPcCardVcc::~DPlatPcCardVcc() sl@0: // sl@0: // Destructor sl@0: // sl@0: {} sl@0: sl@0: void DPlatPcCardVcc::PsuInfo(TPBusPsuInfo &anInfo) sl@0: // sl@0: // Return machine info relating to the Pc Card Vcc supply sl@0: // sl@0: { sl@0: sl@0: ThePccdCntrlInterface->VccInfo(iPsuNum,anInfo); sl@0: } sl@0: sl@0: void DPlatPcCardVcc::DoSetState(TPBusPsuState aState) sl@0: // sl@0: // Turn on/off the PSU. sl@0: // sl@0: { sl@0: sl@0: switch (aState) sl@0: { sl@0: case EPsuOff: sl@0: ThePccdCntrlInterface->VccOff(iPsuNum); sl@0: __KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-Off")); sl@0: break; sl@0: case EPsuOnFull: sl@0: ThePccdCntrlInterface->VccOnFull(iPsuNum,iVoltageSetting); sl@0: __KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-On")); sl@0: break; sl@0: case EPsuOnCurLimit: sl@0: ThePccdCntrlInterface->VccOnCurrentLimit(iPsuNum,iVoltageSetting); sl@0: __KTRACE_OPT(KPBUS2,Kern::Printf("PlatPsu-OnL")); sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void DPlatPcCardVcc::DoCheckVoltage() sl@0: // sl@0: // Check the voltage level of the PSU is as expected. Returns either KErrNone, KErrGeneral sl@0: // to indicate the pass/fail state or KErrNotReady if the voltage check isn't complete. sl@0: // sl@0: { sl@0: sl@0: TInt err=KErrGeneral; sl@0: if (iVoltCheckMethod==EPsuChkComparator) sl@0: err=ThePccdCntrlInterface->VccVoltCheck(iPsuNum); sl@0: ReceiveVoltageCheckResult(err); sl@0: } sl@0: