|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This API provides access to the display driver. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __DDC_ACCESS_H__ |
|
20 #define __DDC_ACCESS_H__ |
|
21 |
|
22 |
|
23 //- Include Files ---------------------------------------------------------- |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 //- Enumerations and consts ------------------------------------------------- |
|
28 |
|
29 /** API version number: |
|
30 1: First version */ |
|
31 const TUint KDdcAccessVersion = 1; |
|
32 |
|
33 ///One DDC segment size |
|
34 const TUint KSizeOfSegment = 256; |
|
35 |
|
36 /** One data block array, See that EDID block size is just 128 bytes, so one read contains one EDID extension (if exists) */ |
|
37 typedef TUint8 TDataBlock[ KSizeOfSegment ]; |
|
38 |
|
39 ///DDC port enumerations |
|
40 enum TDdcPort |
|
41 { |
|
42 EUndefinedPort = 0x00, //!<Initialisation value, don't use |
|
43 EMonitorPort = 0xA0, //!<0xA0/0xA1, DDC monitor port. Normally for EDID, but if EDID is not supported here is DisplayID |
|
44 EDisplayIdPort = 0xA4, //!<0xA4/0xA5, if EDID is supported, here may exists DisplayID |
|
45 }; |
|
46 |
|
47 //- Namespace --------------------------------------------------------------- |
|
48 |
|
49 |
|
50 //- Using ------------------------------------------------------------------- |
|
51 |
|
52 |
|
53 //- Data Types -------------------------------------------------------------- |
|
54 |
|
55 |
|
56 //- Constants --------------------------------------------------------------- |
|
57 |
|
58 |
|
59 //- Macros ------------------------------------------------------------------ |
|
60 |
|
61 |
|
62 //- External Data ----------------------------------------------------------- |
|
63 |
|
64 |
|
65 //- Variables --------------------------------------------------------------- |
|
66 |
|
67 |
|
68 //- Forward Declarations ---------------------------------------------------- |
|
69 |
|
70 |
|
71 //- Class Definitions ------------------------------------------------------- |
|
72 |
|
73 /** |
|
74 Adaptation API for VESA's E-DDC (Enhanced Display Data Channel) raw read |
|
75 */ |
|
76 class CDdcPortAccess : public CBase |
|
77 { |
|
78 public: |
|
79 /** Gets API version number. Compare this to KDdcAccessVersion, must match. |
|
80 @return KDdcAccessVersion which is used for implementation */ |
|
81 IMPORT_C static TUint ApiVersion(); |
|
82 |
|
83 /** Creates object. |
|
84 Method requires ECapabilityReadDeviceData capability. |
|
85 @return new CDdcPortAccess, NULL if there is error, otherwise CDdcPortAccess */ |
|
86 IMPORT_C static CDdcPortAccess* NewL(); |
|
87 ///Destructor |
|
88 virtual ~CDdcPortAccess(){}; |
|
89 |
|
90 /** Starts DDC read from wanted port. |
|
91 |
|
92 User should first read EMonitorPort, if there is EDID found, then read also EDisplayIdPort. |
|
93 If DisplayID is found from EMonitorPort, then it is not needed to read EDisplayIdPort. |
|
94 |
|
95 DisplayID is "second generation" of EDID, and it is proposed to be used. |
|
96 |
|
97 See the method reads one TDataBlock, and it size is double of one EDID block, |
|
98 so the first EDID read might get base-EDID and first extension, if exists. |
|
99 With variable size DisplayID, method reads anyway whole size of TDataBlock, |
|
100 even DisplayID section is smaller. |
|
101 |
|
102 @param aDdcPort DDC port which to be read |
|
103 @param aBlockNumber Datablock which to be read (parameter maps to segment-register 0x60) |
|
104 @param aDataBlock Method fills this with read values. Ensure that this data exists all the time, be careful if local variable. |
|
105 @param aCompletedWhenRead Will be completed when ready, if no errors, then aDataBlock contains read values |
|
106 @return KErrNone if success */ |
|
107 virtual TInt Read(TDdcPort aDdcPort, TUint aBlockNumber, TDataBlock& aDataBlock, TRequestStatus& aCompletedWhenRead) = 0; |
|
108 |
|
109 /** Cancels all TRequestStatuses. |
|
110 @return KErrNone if success */ |
|
111 virtual void CancelAll() = 0; |
|
112 |
|
113 protected: |
|
114 ///Constructor |
|
115 CDdcPortAccess(){}; |
|
116 ///Second phase constructor |
|
117 virtual void ConstructL() = 0; |
|
118 }; |
|
119 |
|
120 |
|
121 //- Global Function Prototypes ---------------------------------------------- |
|
122 |
|
123 |
|
124 //- Inline Functions -------------------------------------------------------- |
|
125 |
|
126 |
|
127 #endif //__DDC_ACCESS_H__ |
|
128 |
|
129 // End of File |
|
130 |