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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
28 The signature for accessor functions for derived attributes
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.
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.
48 - KErrArgument aInOut was invalid (may occur for aSet true or false)
50 typedef TInt (*THalImplementation)(TInt aDeviceNumber, TInt aAttrib, TBool aSet, TAny* aInOut);
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;
71 EWriteOffsetInvalid=1,
72 EInitialAllocFailed1=2,
73 EInitialAllocFailed2=3,
74 EInitialWriteFailed=4,
75 EInitialWriteFailed2=5,
82 static void Panic(THalPanic aPanic);
83 static void InitialiseData();
84 static TInt ReadWord(TInt anOffset);
85 static TInt WriteWord(TInt anOffset, TInt aValue);