os/boardsupport/haitest/bspsvs/suite/bsp/mmc/src/T_MmcSDPsuBaseDriverData.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/bsp/mmc/src/T_MmcSDPsuBaseDriverData.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,623 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +#include "T_MmcSDPsuBaseDriverData.h"
    1.22 +
    1.23 +//MMCSD Commands index
    1.24 +/*@{*/
    1.25 +
    1.26 +_LIT(KCmdIsLocked,							"IsLocked");
    1.27 +_LIT(KCmdIsOff,								"IsOff");
    1.28 +_LIT(KCmdMaxCurrentInMicroAmps,				"MaxCurrentInMicroAmps");
    1.29 +_LIT(KCmdResetInactivityTimer,				"ResetInactivityTimer");
    1.30 +_LIT(KCmdVoltageSupported,					"VoltageSupported");
    1.31 +_LIT(KCmdInactivityCount,					"InactivityCount");
    1.32 +_LIT(KCmdNotLockedCount,					"NotLockedCount");
    1.33 +_LIT(KCmdInactivityTimeout,					"InactivityTimeout");
    1.34 +_LIT(KCmdNotLockedTimeout,					"NotLockedTimeout");
    1.35 +_LIT(KCmdMemVoltageSupported,				"MemVoltageSupported");
    1.36 +_LIT(KCmdMemMaxCurrentInMicroAmps,			"MemMaxCurrentInMicroAmps");
    1.37 +_LIT(KCmdVoltCheckInterval,					"VoltCheckInterval");
    1.38 +
    1.39 +
    1.40 +_LIT(KExpectedLockState,					"expectedlockstate");
    1.41 +_LIT(KExpectedPsuState,						"expectedpsustate");
    1.42 +_LIT(KExpectedCurrent,						"expectedcurrent");
    1.43 +_LIT(KExpectedVoltage,						"expectedvoltage");
    1.44 +_LIT(KExpectedInactivityCount,				"expectedinactivityCount");
    1.45 +_LIT(KExpectedNotLockedCount,				"expectednotLockedCount");
    1.46 +_LIT(KExpectedInactivityTimeout,			"expectedinactivityTimeout");
    1.47 +_LIT(KExpectedNotLockedTimeout,				"expectednotlockedtimeOut");
    1.48 +_LIT(KExpectedMemVoltageSupported,			"expectedmemVoltageSupported");
    1.49 +_LIT(KExpectedMemMaxCurrentInMicroAmps,		"expectedmemMaxCurrentInMicroAmps");
    1.50 +_LIT(KExpectedVoltageinterval,				"expectedvoltageinterval");
    1.51 +
    1.52 +/*@}*/
    1.53 +
    1.54 +//////////////////////////////////////////////////////////////////////
    1.55 +// Construction/Destruction
    1.56 +//////////////////////////////////////////////////////////////////////
    1.57 +
    1.58 +CT_MMCSDPsuBaseDriverData* CT_MMCSDPsuBaseDriverData::NewL()
    1.59 +	{
    1.60 +	CT_MMCSDPsuBaseDriverData*	ret=new (ELeave) CT_MMCSDPsuBaseDriverData();
    1.61 +	CleanupStack::PushL(ret);
    1.62 +	ret->ConstructL();
    1.63 +	CleanupStack::Pop(ret);
    1.64 +	return ret;
    1.65 +	}
    1.66 +
    1.67 +
    1.68 +CT_MMCSDPsuBaseDriverData::CT_MMCSDPsuBaseDriverData()
    1.69 +:	CT_MmcSDDriverData()
    1.70 +,	iAsyncErrorIndex(0)
    1.71 +	{
    1.72 +	}
    1.73 +
    1.74 +void CT_MMCSDPsuBaseDriverData::ConstructL()
    1.75 +/**
    1.76 + * Second phase construction
    1.77 + *
    1.78 + * @internalComponent
    1.79 + *
    1.80 + * @return	N/A
    1.81 + *
    1.82 + * @pre		None
    1.83 + * @post	None
    1.84 + *
    1.85 + * @leave	system wide error
    1.86 + */
    1.87 +	{
    1.88 +	CT_MmcSDDriverData::ConstructL();
    1.89 +	}
    1.90 +
    1.91 +CT_MMCSDPsuBaseDriverData::~CT_MMCSDPsuBaseDriverData()
    1.92 +/**
    1.93 + * Public destructor
    1.94 + */
    1.95 +	{
    1.96 +	}
    1.97 +
    1.98 +TBool CT_MMCSDPsuBaseDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
    1.99 +/**
   1.100 + * Process a command read from the ini file
   1.101 + *
   1.102 + * @param aCommand			The command to process
   1.103 + * @param aSection			The section in the ini containing data for the command
   1.104 + * @param aAsyncErrorIndex	Command index for async calls to return errors to
   1.105 + *
   1.106 + * @return					ETrue if the command is processed
   1.107 + *
   1.108 + * @leave					System wide error
   1.109 + */
   1.110 + 	{
   1.111 +	TBool	ret=ETrue;
   1.112 +
   1.113 +	if ( aCommand==KCmdIsLocked )
   1.114 +		{
   1.115 +		DoCmdIsLocked(aSection);
   1.116 +		}
   1.117 +	else if ( aCommand==KCmdIsOff )
   1.118 +		{
   1.119 +		DoCmdIsOff(aSection);
   1.120 +		}
   1.121 +	else if ( aCommand==KCmdMaxCurrentInMicroAmps )
   1.122 +		{
   1.123 +		DoCmdMaxCurrentInMicroAmps(aSection);
   1.124 +		}
   1.125 +	else if ( aCommand==KCmdResetInactivityTimer )
   1.126 +		{
   1.127 +		DoCmdResetInactivityTimer();
   1.128 +		}
   1.129 +	else if ( aCommand==KCmdVoltageSupported)
   1.130 +		{
   1.131 +		DoCmdVoltageSupported(aSection);
   1.132 +		}
   1.133 +	else if ( aCommand==KCmdInactivityCount)
   1.134 +		{
   1.135 +		DoCmdInactivityCount(aSection);
   1.136 +		}
   1.137 +	else if ( aCommand==KCmdNotLockedCount)
   1.138 +		{
   1.139 +		DoCmdNotLockedCount(aSection);
   1.140 +		}
   1.141 +	else if ( aCommand==KCmdInactivityTimeout)
   1.142 +		{
   1.143 +		DoCmdInactivityTimeout(aSection);
   1.144 +		}
   1.145 +	else if ( aCommand==KCmdNotLockedTimeout)
   1.146 +		{
   1.147 +		DoCmdNotLockedTimeout(aSection);
   1.148 +		}
   1.149 +	else if ( aCommand==KCmdMemVoltageSupported)
   1.150 +		{
   1.151 +		DoCmdMemVoltageSupported(aSection);
   1.152 +		}
   1.153 +	else if ( aCommand==KCmdMemMaxCurrentInMicroAmps)
   1.154 +		{
   1.155 +		DoCmdMemMaxCurrentInMicroAmps(aSection);
   1.156 +		}
   1.157 +	else if ( aCommand==KCmdVoltCheckInterval)
   1.158 +		{
   1.159 +		DoCmdVoltCheckInterval(aSection);
   1.160 +		}
   1.161 +	else
   1.162 +		{
   1.163 +		ret=CT_MmcSDDriverData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
   1.164 +		}
   1.165 +	return ret;
   1.166 +	}
   1.167 +
   1.168 +/**
   1.169 + * Checks whether this PSU is powering a bus containing a locked device
   1.170 + * i.e. one that is recognised and in use by a client
   1.171 + *
   1.172 + * @param aSection			The section in the ini containing data for the command
   1.173 + *
   1.174 + * @return					void
   1.175 + *
   1.176 + * @leave					System wide error
   1.177 + */
   1.178 +void CT_MMCSDPsuBaseDriverData::DoCmdIsLocked(const TDesC& aSection)
   1.179 +	{
   1.180 + 	TInt err;
   1.181 + 	TBool lockstate;
   1.182 + 	err = iMmcSDController->IsLocked(lockstate);
   1.183 +	if ( err!=KErrNone )
   1.184 +		{
   1.185 +		ERR_PRINTF2(_L("Getting Lock Information Error %d"), err);
   1.186 +		SetError(err);
   1.187 +		}
   1.188 +	else
   1.189 +		{
   1.190 +		//IsLocked?
   1.191 +		INFO_PRINTF2(_L("PSUBASE: IsLocked    = %d \n"),lockstate);
   1.192 +		TBool	expectedlockstate;
   1.193 +		if(GetBoolFromConfig(aSection, KExpectedLockState(), expectedlockstate))
   1.194 +			{
   1.195 +			if(lockstate != expectedlockstate)
   1.196 +				{
   1.197 +				SetBlockResult(EFail);
   1.198 +				ERR_PRINTF3(_L("lockstate(%d) != expectedlockstate(%d)"), lockstate, expectedlockstate);
   1.199 +				}
   1.200 +			}
   1.201 +		else
   1.202 +			{
   1.203 +			SetBlockResult(EFail);
   1.204 +			WARN_PRINTF1(_L("expectedlockstate Value Missing From INI File"));
   1.205 +			}
   1.206 +		}
   1.207 +	}
   1.208 +
   1.209 +/**
   1.210 + * Checks whether the PSU is off
   1.211 + *
   1.212 + * @param aSection			The section in the ini containing data for the command
   1.213 + *
   1.214 + * @return					void
   1.215 + *
   1.216 + * @leave					System wide error
   1.217 + */
   1.218 +void CT_MMCSDPsuBaseDriverData::DoCmdIsOff(const TDesC& aSection)
   1.219 +	{
   1.220 + 	TInt err;
   1.221 + 	TBool psustate;
   1.222 + 	err = iMmcSDController->IsOff(psustate);
   1.223 +	if ( err!=KErrNone )
   1.224 +		{
   1.225 +		ERR_PRINTF2(_L("Getting PSU State Information Error %d"), err);
   1.226 +		SetError(err);
   1.227 +		}
   1.228 +	else
   1.229 +		{
   1.230 +		//IsLocked?
   1.231 +		INFO_PRINTF2(_L("PSUBASE: IsOff    = %d \n"),psustate);
   1.232 +		TBool	expectedpsustate;
   1.233 +		if(GetBoolFromConfig(aSection, KExpectedPsuState(), expectedpsustate))
   1.234 +			{
   1.235 +			if(psustate != expectedpsustate)
   1.236 +				{
   1.237 +				SetBlockResult(EFail);
   1.238 +				ERR_PRINTF3(_L("psustate(%d) != expectedpsustate(%d)"), psustate, expectedpsustate);
   1.239 +				}
   1.240 +			}
   1.241 +		else
   1.242 +			{
   1.243 +			SetBlockResult(EFail);
   1.244 +			WARN_PRINTF1(_L("expectedpsustate Value Missing From INI File"));
   1.245 +			}
   1.246 +		}
   1.247 +	}
   1.248 +
   1.249 +/**
   1.250 + * Gets the maximum current (in microAmps) that the PSU is able to supply
   1.251 + *
   1.252 + * @param aSection			The section in the ini containing data for the command
   1.253 + *
   1.254 + * @return					void
   1.255 + *
   1.256 + * @leave					System wide error
   1.257 + */
   1.258 +void CT_MMCSDPsuBaseDriverData::DoCmdMaxCurrentInMicroAmps(const TDesC& aSection)
   1.259 +	{
   1.260 + 	TInt err;
   1.261 + 	TInt current;
   1.262 + 	err = iMmcSDController->MaxCurrentInMicroAmps(current);
   1.263 +	if ( err!=KErrNone )
   1.264 +		{
   1.265 +		ERR_PRINTF2(_L("Getting MaxCurrentInMicroAmps Error %d"), err);
   1.266 +		SetError(err);
   1.267 +		}
   1.268 +	else
   1.269 +		{
   1.270 +		//MaxCurrentInMicroAmps
   1.271 +		INFO_PRINTF2(_L("PSUBASE: MaxCurrentInMicroAmps   = %d \n"),current);
   1.272 +		TInt	expectedcurrent;
   1.273 +		if(GetIntFromConfig(aSection, KExpectedCurrent(), expectedcurrent))
   1.274 +			{
   1.275 +			if(current != expectedcurrent)
   1.276 +				{
   1.277 +				SetBlockResult(EFail);
   1.278 +				ERR_PRINTF3(_L("current(%d) != expectedcurrent(%d)"), current, expectedcurrent);
   1.279 +				}
   1.280 +			}
   1.281 +		else
   1.282 +			{
   1.283 +			SetBlockResult(EFail);
   1.284 +			WARN_PRINTF1(_L("expectedcurrent Value Missing From INI File"));
   1.285 +			}
   1.286 +		}
   1.287 +	}
   1.288 +
   1.289 +/**
   1.290 + * Resets inactivity and not-locked counts
   1.291 + *
   1.292 + * @return					void
   1.293 + *
   1.294 + * @leave					System wide error
   1.295 + */
   1.296 +void CT_MMCSDPsuBaseDriverData::DoCmdResetInactivityTimer()
   1.297 +	{
   1.298 + 	TInt err;
   1.299 + 	err = iMmcSDController->ResetInactivityTimer();
   1.300 +	if ( err!=KErrNone )
   1.301 +		{
   1.302 +		ERR_PRINTF2(_L("ResetInactivityTimer Error %d"), err);
   1.303 +		SetError(err);
   1.304 +		}
   1.305 +	}
   1.306 +
   1.307 +/**
   1.308 + * Gets the voltage level, or range of supported voltage levels
   1.309 + *
   1.310 + * @param aSection			The section in the ini containing data for the command
   1.311 + *
   1.312 + * @return					void
   1.313 + *
   1.314 + * @leave					System wide error
   1.315 + */
   1.316 +void CT_MMCSDPsuBaseDriverData::DoCmdVoltageSupported(const TDesC& aSection)
   1.317 +	{
   1.318 + 	TInt err;
   1.319 + 	TUint volt;
   1.320 + 	err = iMmcSDController->VoltageSupported(volt);
   1.321 +	if ( err!=KErrNone )
   1.322 +		{
   1.323 +		ERR_PRINTF2(_L("VoltageSupported Error %d"), err);
   1.324 +		SetError(err);
   1.325 +		}
   1.326 +	else
   1.327 +		{
   1.328 +		//VoltageSupported
   1.329 +		INFO_PRINTF2(_L("PSUBASE: VoltageSupported  = %x \n"),volt);
   1.330 +		TUint	expectedvolt;
   1.331 +		if(GetUintFromConfig(aSection, KExpectedVoltage(), expectedvolt))
   1.332 +			{
   1.333 +			if(volt != expectedvolt)
   1.334 +				{
   1.335 +				SetBlockResult(EFail);
   1.336 +				ERR_PRINTF3(_L("volt(%x) != expectedvolt(%x)"), volt, expectedvolt);
   1.337 +				}
   1.338 +			}
   1.339 +		else
   1.340 +			{
   1.341 +			SetBlockResult(EFail);
   1.342 +			WARN_PRINTF1(_L("expectedvolt Value Missing From INI File"));
   1.343 +			}
   1.344 +		}
   1.345 +	}
   1.346 +
   1.347 +/**
   1.348 + * Bus inactivity counter
   1.349 + *
   1.350 + * @param aSection			The section in the ini containing data for the command
   1.351 + *
   1.352 + * @return					void
   1.353 + *
   1.354 + * @leave					System wide error
   1.355 + */
   1.356 +void CT_MMCSDPsuBaseDriverData::DoCmdInactivityCount(const TDesC& aSection)
   1.357 +	{
   1.358 + 	TInt err;
   1.359 + 	TInt inactivityCount;
   1.360 + 	err = iMmcSDController->InactivityCount(inactivityCount);
   1.361 +	if ( err!=KErrNone )
   1.362 +		{
   1.363 +		ERR_PRINTF2(_L("InactivityCount Error %d"), err);
   1.364 +		SetError(err);
   1.365 +		}
   1.366 +	else
   1.367 +		{
   1.368 +		//InactivityCount
   1.369 +		INFO_PRINTF2(_L("PSUBASE: InactivityCount  = %d \n"),inactivityCount);
   1.370 +		TInt	expectedinactivityCount;
   1.371 +		if(GetIntFromConfig(aSection, KExpectedInactivityCount(), expectedinactivityCount))
   1.372 +			{
   1.373 +			if(inactivityCount != expectedinactivityCount)
   1.374 +				{
   1.375 +				SetBlockResult(EFail);
   1.376 +				ERR_PRINTF3(_L("inactivityCount(%d) != expectedinactivityCount(%d)"), inactivityCount, expectedinactivityCount);
   1.377 +				}
   1.378 +			}
   1.379 +		else
   1.380 +			{
   1.381 +			SetBlockResult(EFail);
   1.382 +			WARN_PRINTF1(_L("expectedinactivityCount Value Missing From INI File"));
   1.383 +			}
   1.384 +		}
   1.385 +	}
   1.386 +
   1.387 +/**
   1.388 + * Bus not locked counter
   1.389 + *
   1.390 + * @param aSection			The section in the ini containing data for the command
   1.391 + *
   1.392 + * @return					void
   1.393 + *
   1.394 + * @leave					System wide error
   1.395 + */
   1.396 +void CT_MMCSDPsuBaseDriverData::DoCmdNotLockedCount(const TDesC& aSection)
   1.397 +	{
   1.398 + 	TInt err;
   1.399 + 	TInt notLockedCount;
   1.400 + 	err = iMmcSDController->NotLockedCount(notLockedCount);
   1.401 +	if ( err!=KErrNone )
   1.402 +		{
   1.403 +		ERR_PRINTF2(_L("NotLockedCount Error %d"), err);
   1.404 +		SetError(err);
   1.405 +		}
   1.406 +	else
   1.407 +		{
   1.408 +		//NotLockedCount
   1.409 +		INFO_PRINTF2(_L("PSUBASE: NotLockedCount  = %d \n"),notLockedCount);
   1.410 +		TInt	expectednotLockedCount;
   1.411 +		if(GetIntFromConfig(aSection, KExpectedNotLockedCount(), expectednotLockedCount))
   1.412 +			{
   1.413 +			if(notLockedCount != expectednotLockedCount)
   1.414 +				{
   1.415 +				SetBlockResult(EFail);
   1.416 +				ERR_PRINTF3(_L("notLockedCount(%d) != expectednotLockedCount(%d)"), notLockedCount, expectednotLockedCount);
   1.417 +				}
   1.418 +			}
   1.419 +		else
   1.420 +			{
   1.421 +			SetBlockResult(EFail);
   1.422 +			WARN_PRINTF1(_L("expectednotLockedCount Value Missing From INI File"));
   1.423 +			}
   1.424 +		}
   1.425 +	}
   1.426 +
   1.427 +/**
   1.428 + * Bus inactivity timeout period, in seconds, when clients are registered
   1.429 + *
   1.430 + * @param aSection			The section in the ini containing data for the command
   1.431 + *
   1.432 + * @return					void
   1.433 + *
   1.434 + * @leave					System wide error
   1.435 + */
   1.436 +void CT_MMCSDPsuBaseDriverData::DoCmdInactivityTimeout(const TDesC& aSection)
   1.437 +	{
   1.438 + 	TInt err;
   1.439 + 	TInt inactivityTimeout;
   1.440 + 	err = iMmcSDController->InactivityTimeout(inactivityTimeout);
   1.441 +	if ( err!=KErrNone )
   1.442 +		{
   1.443 +		ERR_PRINTF2(_L("InactivityTimeout Error %d"), err);
   1.444 +		SetError(err);
   1.445 +		}
   1.446 +	else
   1.447 +		{
   1.448 +		//InactivityTimeout
   1.449 +		INFO_PRINTF2(_L("PSUBASE: InactivityTimeout  = %d \n"),inactivityTimeout);
   1.450 +		TInt	expectedinactivityTimeout;
   1.451 +		if(GetIntFromConfig(aSection, KExpectedInactivityTimeout(), expectedinactivityTimeout))
   1.452 +			{
   1.453 +			if(inactivityTimeout != expectedinactivityTimeout)
   1.454 +				{
   1.455 +				SetBlockResult(EFail);
   1.456 +				ERR_PRINTF3(_L("inactivityTimeout(%d) != expectedinactivityTimeout(%d)"), inactivityTimeout, expectedinactivityTimeout);
   1.457 +				}
   1.458 +			}
   1.459 +		else
   1.460 +			{
   1.461 +			SetBlockResult(EFail);
   1.462 +			WARN_PRINTF1(_L("expectedinactivityTimeout Value Missing From INI File"));
   1.463 +			}
   1.464 +		}
   1.465 +	}
   1.466 +
   1.467 +/**
   1.468 + * Bus not locked timeout period, in seconds, when no clients are registered
   1.469 + *
   1.470 + * @param aSection			The section in the ini containing data for the command
   1.471 + *
   1.472 + * @return					void
   1.473 + *
   1.474 + * @leave					System wide error
   1.475 + */
   1.476 +void CT_MMCSDPsuBaseDriverData::DoCmdNotLockedTimeout(const TDesC& aSection)
   1.477 +	{
   1.478 + 	TInt err;
   1.479 + 	TInt notLockedTimeout;
   1.480 + 	err = iMmcSDController->NotLockedTimeout(notLockedTimeout);
   1.481 +	if ( err!=KErrNone )
   1.482 +		{
   1.483 +		ERR_PRINTF2(_L("NotLockedTimeout Error %d"), err);
   1.484 +		SetError(err);
   1.485 +		}
   1.486 +	else
   1.487 +		{
   1.488 +		//NotLockedTimeout
   1.489 +		INFO_PRINTF2(_L("PSUBASE: NotLockedTimeout  = %d \n"),notLockedTimeout);
   1.490 +		TInt	expectednotLockedTimeout;
   1.491 +		if(GetIntFromConfig(aSection, KExpectedNotLockedTimeout(), expectednotLockedTimeout))
   1.492 +			{
   1.493 +			if(notLockedTimeout != expectednotLockedTimeout)
   1.494 +				{
   1.495 +				SetBlockResult(EFail);
   1.496 +				ERR_PRINTF3(_L("notLockedTimeout(%d) != expectednotLockedTimeout(%d)"), notLockedTimeout, expectednotLockedTimeout);
   1.497 +				}
   1.498 +			}
   1.499 +		else
   1.500 +			{
   1.501 +			SetBlockResult(EFail);
   1.502 +			WARN_PRINTF1(_L("expectednotLockedTimeout Value Missing From INI File"));
   1.503 +			}
   1.504 +		}
   1.505 +	}
   1.506 +
   1.507 +/**
   1.508 + * Indicates the voltage level, or range of voltages supported
   1.509 + *
   1.510 + * @param aSection			The section in the ini containing data for the command
   1.511 + *
   1.512 + * @return					void
   1.513 + *
   1.514 + * @leave					System wide error
   1.515 + */
   1.516 +void CT_MMCSDPsuBaseDriverData::DoCmdMemVoltageSupported(const TDesC& aSection)
   1.517 +	{
   1.518 + 	TInt err;
   1.519 + 	TUint memVoltageSupported;
   1.520 + 	err = iMmcSDController->MemVoltageSupported(memVoltageSupported);
   1.521 +	if ( err!=KErrNone )
   1.522 +		{
   1.523 +		ERR_PRINTF2(_L("MemVoltageSupported Error %u"), err);
   1.524 +		SetError(err);
   1.525 +		}
   1.526 +	else
   1.527 +		{
   1.528 +		//MemVoltageSupported
   1.529 +		INFO_PRINTF2(_L("PSUBASE: MemVoltageSupported  = %x \n"),memVoltageSupported);
   1.530 +		TUint	expectedmemVoltageSupported;
   1.531 +		if(GetUintFromConfig(aSection, KExpectedMemVoltageSupported(), expectedmemVoltageSupported))
   1.532 +			{
   1.533 +			if(memVoltageSupported != expectedmemVoltageSupported)
   1.534 +				{
   1.535 +				SetBlockResult(EFail);
   1.536 +				ERR_PRINTF3(_L("memVoltageSupported(%x) != expectedmemVoltageSupported(%x)"), memVoltageSupported, expectedmemVoltageSupported);
   1.537 +				}
   1.538 +			}
   1.539 +		else
   1.540 +			{
   1.541 +			SetBlockResult(EFail);
   1.542 +			WARN_PRINTF1(_L("expectedmemVoltageSupported Value Missing From INI File"));
   1.543 +			}
   1.544 +		}
   1.545 +	}
   1.546 +
   1.547 +/**
   1.548 + * The maximum current (in microAmps) that the PSU is able to supply
   1.549 + *
   1.550 + * @param aSection			The section in the ini containing data for the command
   1.551 + *
   1.552 + * @return					void
   1.553 + *
   1.554 + * @leave					System wide error
   1.555 + */
   1.556 +void CT_MMCSDPsuBaseDriverData::DoCmdMemMaxCurrentInMicroAmps(const TDesC& aSection)
   1.557 +	{
   1.558 + 	TInt err;
   1.559 + 	TInt memMaxCurrentInMicroAmps;
   1.560 + 	err = iMmcSDController->MemMaxCurrentInMicroAmps(memMaxCurrentInMicroAmps);
   1.561 +	if ( err!=KErrNone )
   1.562 +		{
   1.563 +		ERR_PRINTF2(_L("MemMaxCurrentInMicroAmps Error %d"), err);
   1.564 +		SetError(err);
   1.565 +		}
   1.566 +	else
   1.567 +		{
   1.568 +		//MemMaxCurrentInMicroAmps
   1.569 +		INFO_PRINTF2(_L("PSUBASE: MemMaxCurrentInMicroAmps  = %d \n"),memMaxCurrentInMicroAmps);
   1.570 +		TInt	expectedmemMaxCurrentInMicroAmps;
   1.571 +		if(GetIntFromConfig(aSection, KExpectedMemMaxCurrentInMicroAmps(), expectedmemMaxCurrentInMicroAmps))
   1.572 +			{
   1.573 +			if(memMaxCurrentInMicroAmps != expectedmemMaxCurrentInMicroAmps)
   1.574 +				{
   1.575 +				SetBlockResult(EFail);
   1.576 +				ERR_PRINTF3(_L("memMaxCurrentInMicroAmps(%d) != expectedmemMaxCurrentInMicroAmps(%d)"), memMaxCurrentInMicroAmps, expectedmemMaxCurrentInMicroAmps);
   1.577 +				}
   1.578 +			}
   1.579 +		else
   1.580 +			{
   1.581 +			SetBlockResult(EFail);
   1.582 +			WARN_PRINTF1(_L("expectedmemMaxCurrentInMicroAmps Value Missing From INI File"));
   1.583 +			}
   1.584 +		}
   1.585 +	}
   1.586 +
   1.587 +/**
   1.588 + * Indicates whether the platform hardware has support for checking whether the voltage level of the
   1.589 + * PSU is within its expected voltage limit while turned on
   1.590 + *
   1.591 + * @param aSection			The section in the ini containing data for the command
   1.592 + *
   1.593 + * @return					void
   1.594 + *
   1.595 + * @leave					System wide error
   1.596 + */
   1.597 +void CT_MMCSDPsuBaseDriverData::DoCmdVoltCheckInterval(const TDesC& aSection)
   1.598 +	{
   1.599 + 	TInt err;
   1.600 + 	TUint voltCheckInterval;
   1.601 + 	err = iMmcSDController->VoltCheckInterval(voltCheckInterval);
   1.602 +	if ( err!=KErrNone )
   1.603 +		{
   1.604 +		ERR_PRINTF2(_L("VoltCheckInterval Error %d"), err);
   1.605 +		SetError(err);
   1.606 +		}
   1.607 +	else
   1.608 +		{
   1.609 +		//VoltCheckInterval
   1.610 +		INFO_PRINTF2(_L("PSUBASE: VoltCheckInterval  = %u \n"),voltCheckInterval);
   1.611 +		TUint	expectedvoltCheckInterval;
   1.612 +		if(GetUintFromConfig(aSection, KExpectedVoltageinterval(), expectedvoltCheckInterval))
   1.613 +			{
   1.614 +			if(voltCheckInterval != expectedvoltCheckInterval)
   1.615 +				{
   1.616 +				SetBlockResult(EFail);
   1.617 +				ERR_PRINTF3(_L("voltCheckInterval(%u) != expectedvoltCheckInterval(%u)"), voltCheckInterval, expectedvoltCheckInterval);
   1.618 +				}
   1.619 +			}
   1.620 +		else
   1.621 +			{
   1.622 +			SetBlockResult(EFail);
   1.623 +			WARN_PRINTF1(_L("expectedvoltCheckInterval Value Missing From INI File"));
   1.624 +			}
   1.625 +		}
   1.626 +	}