epoc32/include/kernel/hal_int.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 1995-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // hal\inc\hal_int.h
    15 // 
    16 //
    17 
    18 #ifndef __HAL_INT_H__
    19 #define __HAL_INT_H__
    20 
    21 #include <hal.h>
    22 #include <e32svr.h>
    23 
    24 /**
    25 @publishedPartner
    26 @released
    27 
    28 The signature for accessor functions for derived attributes
    29 
    30 @param aDeviceNumber A device number is applicable when a system has
    31 multiple instances of a device. The parameter specifies which one to
    32 interrogate. Eg. a phone may have 2 displays, so it's HAL accessor functions
    33 would access different information depending on whether aDeviceNumber was 0 or 1.
    34 
    35 @param aAttrib The HAL attribute to access.
    36 @param aSet ETrue if the specified attribute should be modified; EFalse for a read.
    37 @param aInOut A pointer to a TInt. If aSet is:
    38 	- ETrue it points to the new value to be written.
    39 	- EFalse it is used to return the value read.
    40 	  It may also be used to pass an argument in,
    41 	  in order to select one of multiple values to retreive.
    42 	  If it is equal to -1 then the function must
    43 	  return KErrArgument so that callers can identify that
    44 	  the function uses aInOut as an input even when aSet is false.
    45 
    46 @return An error code
    47 	- KErrNone
    48 	- KErrArgument aInOut was invalid (may occur for aSet true or false)
    49 */
    50 typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
    51 
    52 /**
    53 @internalComponent
    54 */
    55 class HalInternal
    56 	{
    57 public:
    58 	static const TUint8 Properties[HAL::ENumHalAttributes];
    59 	static const TInt Offset[HAL::ENumHalAttributes];
    60 	// InitialValue[] is only exported for patchdata purposes (other executables
    61 	// must not import this array; all access should be through the published Hal
    62 	// APIs).  EXPORT_C needs to be on the declaration here so that it has external
    63 	// linkage (class data is treated differently to non-class data).
    64 	EXPORT_C static const TInt InitialValue[HAL::ENumHalAttributes];
    65 	static const THalImplementation Implementation[HAL::ENumHalAttributes];
    66 	static const TInt HalDataSize;
    67 
    68 	enum THalPanic
    69 		{
    70 		EReadOffsetInvalid=0,
    71 		EWriteOffsetInvalid=1,
    72 		EInitialAllocFailed1=2,
    73 		EInitialAllocFailed2=3,
    74 		EInitialWriteFailed=4,
    75 		EInitialWriteFailed2=5,
    76 		ETlsSizeInvalid=6,
    77 		ENoSuchHalProp=7,
    78 		EGetPropFailed=8,
    79 		ESetPropFailed=9
    80 		};
    81 
    82 	static void Panic(THalPanic aPanic);
    83 	static void InitialiseData();
    84 	static TInt ReadWord(TInt anOffset);
    85 	static TInt WriteWord(TInt anOffset, TInt aValue);
    86 	};
    87 
    88 #endif