author | will.long |
Tue, 21 Sep 2010 13:48:52 +0800 | |
changeset 76 | 0d34a4aa948d |
parent 34 | 161f6b2f6990 |
permissions | -rwxr-xr-x |
0 | 1 |
// Copyright (c) 2004-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 "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
12 |
// iwanj@users.sourceforge.net added NGA support based on Syborg display PDD |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
13 |
|
0 | 14 |
// Description: |
15 |
// omap3530/beagle_drivers/lcd/lcd.cpp |
|
16 |
// Implementation of an LCD driver. |
|
17 |
// This file is part of the Beagle Base port |
|
18 |
// N.B. This sample code assumes that the display supports setting the backlight on or off, |
|
19 |
// as well as adjusting the contrast and the brightness. |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
20 |
//// |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
21 |
|
0 | 22 |
|
23 |
#include <videodriver.h> |
|
24 |
#include <platform.h> |
|
25 |
#include <nkern.h> |
|
26 |
#include <kernel.h> |
|
27 |
#include <kern_priv.h> |
|
28 |
#include <kpower.h> |
|
29 |
#include <assp/omap3530_assp/omap3530_assp_priv.h> |
|
30 |
#include <assp/omap3530_assp/omap3530_hardware_base.h> |
|
31 |
#include <assp/omap3530_assp/omap3530_prcm.h> |
|
32 |
||
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
33 |
//#undef __KTRACE_OPT |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
34 |
//#define __KTRACE_OPT(c,p) p |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
35 |
|
0 | 36 |
#define DSS_SYSCONFIG 0x48050010 |
37 |
#define DISPC_SYSSTATUS 0x48050414 |
|
38 |
||
39 |
#define DISPC_SYSCONFIG 0x48050410 |
|
40 |
#define DISPC_CONFIG 0x48050444 |
|
41 |
#define DISPC_DEFAULT_COLOR0 0x4805044c |
|
42 |
#define DISPC_TRANS_COLOR0 0x48050454 |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
43 |
#define DISPC_LINE_STATUS 0x4805045C |
0 | 44 |
|
45 |
#define DISPC_TIMING_H 0x48050464 |
|
46 |
#define DISPC_TIMING_V 0x48050468 |
|
47 |
#define DISPC_POL_FREQ 0x4805046c |
|
48 |
#define DISPC_DIVISOR 0x48050470 |
|
49 |
#define DISPC_SIZE_LCD 0x4805047c |
|
50 |
||
51 |
#define DISPC_GFX_BA1 0x48050480 |
|
52 |
#define DISPC_GFX_BA2 0x48050484 |
|
53 |
#define DISPC_GFX_POSITION 0x48050488 |
|
54 |
#define DISPC_GFX_SIZE 0x4805048c |
|
55 |
#define DISPC_GFX_ATTRIBUTES 0x480504a0 |
|
56 |
||
57 |
#define DISPC_GFX_FIFO_THRESHOLD 0x480504a4 |
|
58 |
#define DISPC_GFX_FIFO_SIZE_STATUS 0x480504a8 |
|
59 |
#define DISPC_GFX_ROW_INC 0x480504ac |
|
60 |
#define DISPC_GFX_PIXEL_INC 0x480504b0 |
|
61 |
#define DISPC_GFX_WINDOW_SKIP 0x480504b4 |
|
62 |
#define DISPC_GFX_TABLE_BA 0x480504b8 |
|
63 |
||
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
64 |
#define VENC_F_CONTROL 0x48050C08 |
0 | 65 |
#define DISPC_CONTROL 0x48050440 |
66 |
||
67 |
#define GET_REGISTER(Reg) *( (TUint *) Omap3530HwBase::TVirtual<Reg>::Value ) |
|
68 |
#define SET_REGISTER(Reg,Val) *( (TUint *) Omap3530HwBase::TVirtual<Reg>::Value ) = Val |
|
69 |
||
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
70 |
#define GPIO3_OE 0x49052034 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
71 |
#define GPIO3_CLEARDATAOUT 0x49052090 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
72 |
#define GPIO3_SETDATAOUT 0x49052094 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
73 |
#define CONTROL_PADCONF_DSS_DATA18 0x48002100 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
74 |
#define CONTROL_PADCONF_DSS_DATA20 0x48002104 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
75 |
#define CONTROL_PADCONF_DSS_DATA22 0x48002108 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
76 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
77 |
//const TUint32 SPICLK=0x01000000,SPISDAO=0x02000000,SPISDAI=0x04000000,SPICS0=0x08000000,SPIRESET=0x10000000; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
78 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
79 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
80 |
#define GPIO5_OE 0x49056034 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
81 |
#define GPIO5_CLEARDATAOUT 0x49056090 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
82 |
#define GPIO5_SETDATAOUT 0x49056094 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
83 |
#define GPIO5_DATADRAIN 0x49056038 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
84 |
#define CONTROL_PADCONF_MMC2_CLK 0x48002158 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
85 |
#define CONTROL_PADCONF_MMC2_DAT0 0x4800215C |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
86 |
#define CONTROL_PADCONF_MMC2_DAT2 0x48002160 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
87 |
#define CONTROL_PADCONF_MMC2_DAT4 0x48002164 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
88 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
89 |
#define KEXTENSION KALWAYS |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
90 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
91 |
//const TUint32 SPICLK=0x00000004,SPISDAO=0x00000008,SPISDAI=0x00000010,SPICS0=0x00000040/*GPIO134*/,SPIRESET=0x00000080; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
92 |
const TUint32 SPICS0=0x00000040/*GPIO134*/,SPICLK=0x01000000,SPISDAO=0x02000000, |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
93 |
SPISDAI=0x04000000,SPIRESET=0x20000000; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
94 |
/** |
0 | 95 |
#define _MODE_1280x1024_ |
96 |
//#define _MODE_1024x768_ |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
97 |
|
0 | 98 |
#ifdef _MODE_800x600_ |
99 |
// ModeLine "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync |
|
100 |
// Decoded by: http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html |
|
101 |
# define PIXEL_CLK 40000 |
|
102 |
# define H_DISP 800 |
|
103 |
# define H_FPORCH 40 |
|
104 |
# define H_SYNC 128 |
|
105 |
# define H_BPORCH 88 |
|
106 |
# define H_SYNC_POL 1 |
|
107 |
# define V_DISP 600 |
|
108 |
# define V_FPORCH 1 |
|
109 |
# define V_SYNC 4 |
|
110 |
# define V_BPORCH 23 |
|
111 |
# define V_SYNC_POL 1 |
|
112 |
# define INTERLACE_ENABLE 0 |
|
113 |
#endif |
|
114 |
#ifdef _MODE_1024x768_ |
|
115 |
// ModeLine "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync |
|
116 |
// Decoded by: http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html |
|
117 |
# define PIXEL_CLK 65000 |
|
118 |
# define H_DISP 1024 |
|
119 |
# define H_FPORCH 24 |
|
120 |
# define H_SYNC 136 |
|
121 |
# define H_BPORCH 160 |
|
122 |
# define H_SYNC_POL 0 |
|
123 |
# define V_DISP 768 |
|
124 |
# define V_FPORCH 3 |
|
125 |
# define V_SYNC 6 |
|
126 |
# define V_BPORCH 29 |
|
127 |
# define V_SYNC_POL 0 |
|
128 |
# define INTERLACE_ENABLE 0 |
|
129 |
#endif |
|
130 |
#ifdef _MODE_1280x1024_ |
|
131 |
// ModeLine "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync |
|
132 |
// Decoded by: http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html |
|
133 |
# define PIXEL_CLK 108000 |
|
134 |
# define H_DISP 1280 |
|
135 |
# define H_FPORCH 48 |
|
136 |
# define H_SYNC 112 |
|
137 |
# define H_BPORCH 248 |
|
138 |
# define H_SYNC_POL 1 |
|
139 |
# define V_DISP 1024 |
|
140 |
# define V_FPORCH 1 |
|
141 |
# define V_SYNC 3 |
|
142 |
# define V_BPORCH 38 |
|
143 |
# define V_SYNC_POL 1 |
|
144 |
# define INTERLACE_ENABLE 0 |
|
145 |
#endif |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
146 |
*/ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
147 |
# define PIXEL_CLK 25000 //this value is just the RGB's clk |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
148 |
# define H_DISP 480 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
149 |
# define H_FPORCH 20 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
150 |
# define H_SYNC 20 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
151 |
# define H_BPORCH 20 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
152 |
# define H_SYNC_POL 1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
153 |
# define V_DISP 800 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
154 |
# define V_FPORCH 500 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
155 |
# define V_SYNC 250 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
156 |
# define V_BPORCH 500 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
157 |
# define V_SYNC_POL 1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
158 |
# define INTERLACE_ENABLE 0 |
0 | 159 |
|
160 |
||
161 |
// TO DO: (mandatory) |
|
162 |
// If the display supports Contrast and/or Brightness control then supply the following defines: |
|
163 |
// This is only example code... you may need to modify it for your hardware |
|
164 |
const TInt KConfigInitialDisplayContrast = 128; |
|
165 |
const TInt KConfigLcdMinDisplayContrast = 1; |
|
166 |
const TInt KConfigLcdMaxDisplayContrast = 255; |
|
167 |
const TInt KConfigInitialDisplayBrightness = 128; |
|
168 |
const TInt KConfigLcdMinDisplayBrightness = 1; |
|
169 |
const TInt KConfigLcdMaxDisplayBrightness = 255; |
|
170 |
||
171 |
// TO DO: (mandatory) |
|
172 |
// define a macro to calculate the screen buffer size |
|
173 |
// This is only example code... you may need to modify it for your hardware |
|
174 |
// aBpp is the number of bits-per-pixel, aPpl is the number of pixels per line and |
|
175 |
// aLpp number of lines per panel |
|
176 |
#define FRAME_BUFFER_SIZE(aBpp,aPpl,aLpp) (aBpp*aPpl*aLpp)/8 |
|
177 |
||
178 |
||
179 |
// TO DO: (mandatory) |
|
180 |
// define the physical screen dimensions |
|
181 |
// This is only example code... you need to modify it for your hardware |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
182 |
//const TUint KConfigLcdWidth = 480;//360;//640; // 640 pixels per line |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
183 |
//const TUint KConfigLcdHeight = 800;//640;//480; // 480 lines per panel |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
184 |
const TUint KConfigLcdWidth = 360;//360;//640; // 640 pixels per line |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
185 |
const TUint KConfigLcdHeight = 640;//640;//480; // 480 lines per panel |
0 | 186 |
// TO DO: (mandatory) |
187 |
// define the characteristics of the LCD display |
|
188 |
// This is only example code... you need to modify it for your hardware |
|
189 |
const TBool KConfigLcdIsMono = EFalse; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
190 |
const TBool KConfigLcdPixelOrderLandscape = EFalse;//ETrue; |
0 | 191 |
const TBool KConfigLcdPixelOrderRGB = ETrue; |
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
192 |
//const TInt KConfigLcdMaxDisplayColors = 262144;//16777216;//65536; //24bit: 16777216; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
193 |
const TInt KConfigLcdMaxDisplayColors = 16777216;//262144;//16777216;//65536; //24bit: 16777216; |
0 | 194 |
|
195 |
||
196 |
// TO DO: (mandatory) |
|
197 |
// define the display dimensions in TWIPs |
|
198 |
// A TWIP is a 20th of a point. A point is a 72nd of an inch |
|
199 |
// Therefore a TWIP is a 1440th of an inch |
|
200 |
// This is only example code... you need to modify it for your hardware |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
201 |
const TInt KConfigLcdWidthInTwips = 2670;//2670; // = 6.69 inches //15*1440; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
202 |
const TInt KConfigLcdHeightInTwips = 3550;//3550; //5616; // = 5.11 inches //12*1440; |
0 | 203 |
|
204 |
// TO DO: (mandatory) |
|
205 |
// define the available display modes |
|
206 |
// This is only example code... you need to modify it for your hardware |
|
207 |
const TInt KConfigLcdNumberOfDisplayModes = 1; |
|
208 |
const TInt KConfigLcdInitialDisplayMode = 0; |
|
209 |
struct SLcdConfig |
|
210 |
{ |
|
211 |
TInt iMode; |
|
212 |
TInt iOffsetToFirstVideoBuffer; |
|
213 |
TInt iLenghtOfVideoBufferInBytes; |
|
214 |
TInt iOffsetBetweenLines; |
|
215 |
TBool iIsPalettized; |
|
216 |
TInt iBitsPerPixel; |
|
217 |
}; |
|
218 |
static const SLcdConfig Lcd_Mode_Config[KConfigLcdNumberOfDisplayModes]= |
|
219 |
{ |
|
220 |
{ |
|
221 |
0, // iMode |
|
222 |
0, // iOffsetToFirstVideoBuffer |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
223 |
// FRAME_BUFFER_SIZE(16/*32*//*16*/, KConfigLcdWidth, KConfigLcdHeight), // iLenghtOfVideoBufferInBytes |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
224 |
// KConfigLcdWidth*2/*4*/,//2, // iOffsetBetweenLines |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
225 |
// EFalse, // iIsPalettized |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
226 |
// 16/*32,*///16 // iBitsPerPixel |
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
227 |
FRAME_BUFFER_SIZE(32/*16*/, KConfigLcdWidth, KConfigLcdHeight), // iLenghtOfVideoBufferInBytes |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
228 |
KConfigLcdWidth*4,//2, // iOffsetBetweenLines |
0 | 229 |
EFalse, // iIsPalettized |
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
230 |
32,//16 // iBitsPerPixel |
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
231 |
|
0 | 232 |
} |
233 |
}; |
|
234 |
||
235 |
||
236 |
||
237 |
_LIT(KLitLcd,"LCD"); |
|
238 |
||
239 |
// |
|
240 |
// TO DO: (optional) |
|
241 |
// |
|
242 |
// Add any private functions and data you require |
|
243 |
// |
|
244 |
NONSHARABLE_CLASS(DLcdPowerHandler) : public DPowerHandler |
|
245 |
{ |
|
246 |
public: |
|
247 |
DLcdPowerHandler(); |
|
248 |
||
249 |
// from DPowerHandler |
|
250 |
void PowerDown(TPowerState); |
|
251 |
void PowerUp(); |
|
252 |
||
253 |
void PowerUpDfc(); |
|
254 |
void PowerDownDfc(); |
|
255 |
||
256 |
TInt Create(); |
|
257 |
void DisplayOn(); |
|
258 |
void DisplayOff(); |
|
259 |
TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2); |
|
260 |
||
261 |
void PowerUpLcd(TBool aSecure); |
|
262 |
void PowerDownLcd(); |
|
263 |
||
264 |
void ScreenInfo(TScreenInfoV01& aInfo); |
|
265 |
void WsSwitchOnScreen(); |
|
266 |
void WsSwitchOffScreen(); |
|
267 |
void HandleMsg(); |
|
268 |
void SwitchDisplay(TBool aSecure); |
|
269 |
||
270 |
void SetBacklightState(TBool aState); |
|
271 |
void BacklightOn(); |
|
272 |
void BacklightOff(); |
|
273 |
TInt SetContrast(TInt aContrast); |
|
274 |
TInt SetBrightness(TInt aBrightness); |
|
275 |
||
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
276 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
277 |
void ChangeFrameBufferAddress(TUint32 aFbAddr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
278 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
279 |
|
0 | 280 |
private: |
281 |
TInt SetPaletteEntry(TInt aEntry, TInt aColor); |
|
282 |
TInt GetPaletteEntry(TInt aEntry, TInt* aColor); |
|
283 |
TInt NumberOfPaletteEntries(); |
|
284 |
TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure); |
|
285 |
TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo); |
|
286 |
TInt SetDisplayMode(TInt aMode); |
|
287 |
void SplashScreen(); |
|
288 |
TInt GetDisplayColors(TInt* aColors); |
|
289 |
||
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
290 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
291 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
292 |
static DLcdPowerHandler* pLcd; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
293 |
TInt iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
294 |
TPhysAddr iCompositionPhysical; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
295 |
TVideoInfoV01 iVideoInfo; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
296 |
TDfcQue* iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
297 |
TPhysAddr ivRamPhys; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
298 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
299 |
|
0 | 300 |
private: |
301 |
TBool iIsPalettized; |
|
302 |
TBool iDisplayOn; // to prevent a race condition with WServer trying to power up/down at the same time |
|
303 |
DPlatChunkHw* iChunk; |
|
304 |
DPlatChunkHw* iSecureChunk; |
|
305 |
TBool iWsSwitchOnScreen; |
|
306 |
TBool iSecureDisplay; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
307 |
// TDfcQue* iDfcQ; |
0 | 308 |
TMessageQue iMsgQ; |
309 |
TDfc iPowerUpDfc; |
|
310 |
TDfc iPowerDownDfc; |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
311 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
312 |
#ifndef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
313 |
TDfcQue* iDfcQ; |
0 | 314 |
TVideoInfoV01 iVideoInfo; |
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
315 |
TPhysAddr ivRamPhys; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
316 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
317 |
|
0 | 318 |
TVideoInfoV01 iSecureVideoInfo; |
319 |
NFastMutex iLock; // protects against being preempted whilst manipulating iVideoInfo/iSecureVideoInfo |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
320 |
// TPhysAddr ivRamPhys; |
0 | 321 |
TPhysAddr iSecurevRamPhys; |
322 |
||
323 |
TBool iBacklightOn; |
|
324 |
TInt iContrast; |
|
325 |
TInt iBrightness; |
|
326 |
}; |
|
327 |
||
328 |
||
329 |
/** |
|
330 |
HAL handler function |
|
331 |
||
332 |
@param aPtr a pointer to an instance of DLcdPowerHandler |
|
333 |
@param aFunction the function number |
|
334 |
@param a1 an arbitrary parameter |
|
335 |
@param a2 an arbitrary parameter |
|
336 |
*/ |
|
337 |
LOCAL_C TInt halFunction(TAny* aPtr, TInt aFunction, TAny* a1, TAny* a2) |
|
338 |
{ |
|
339 |
DLcdPowerHandler* pH=(DLcdPowerHandler*)aPtr; |
|
340 |
return pH->HalFunction(aFunction,a1,a2); |
|
341 |
} |
|
342 |
||
343 |
/** |
|
344 |
DFC for receiving messages from the power handler |
|
345 |
@param aPtr a pointer to an instance of DLcdPowerHandler |
|
346 |
*/ |
|
347 |
void rxMsg(TAny* aPtr) |
|
348 |
{ |
|
349 |
DLcdPowerHandler& h=*(DLcdPowerHandler*)aPtr; |
|
350 |
h.HandleMsg(); |
|
351 |
} |
|
352 |
||
353 |
/** |
|
354 |
DFC for powering up the device |
|
355 |
||
356 |
@param aPtr aPtr a pointer to an instance of DLcdPowerHandler |
|
357 |
*/ |
|
358 |
void power_up_dfc(TAny* aPtr) |
|
359 |
{ |
|
360 |
((DLcdPowerHandler*)aPtr)->PowerUpDfc(); |
|
361 |
} |
|
362 |
||
363 |
/** |
|
364 |
DFC for powering down the device |
|
365 |
||
366 |
@param aPtr aPtr a pointer to an instance of DLcdPowerHandler |
|
367 |
*/ |
|
368 |
void power_down_dfc(TAny* aPtr) |
|
369 |
{ |
|
370 |
((DLcdPowerHandler*)aPtr)->PowerDownDfc(); |
|
371 |
} |
|
372 |
||
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
373 |
void Wait_(void) //Wait_() nearly =1ms |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
374 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
375 |
Kern::NanoWait(7000000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
376 |
// Kern::NanoWait(10000000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
377 |
// Kern::NanoWait(10000000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
378 |
// Kern::NanoWait(10000000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
379 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
380 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
381 |
void Wait_1(void) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
382 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
383 |
Kern::NanoWait(700000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
384 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
385 |
void Wait(int ms) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
386 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
387 |
for(int i=0;i<ms;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
388 |
Wait_(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
389 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
390 |
void Wait2(int ms) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
391 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
392 |
for(int i=0;i<ms;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
393 |
Wait_(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
394 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
395 |
void Wait3(int ms) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
396 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
397 |
for(int i=0;i<ms;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
398 |
Wait_1(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
399 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
400 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
401 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
402 |
/** |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
403 |
set the mux mode to GPIO, used to simulate GPIO function |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
404 |
SCL--GPIO88,--output |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
405 |
SDO--GPIO89,--output |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
406 |
SDI--GPIO90--input |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
407 |
CSa--GPIO91--output |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
408 |
CSb--GPIO92--output |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
409 |
RESET--GPIO93--output |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
410 |
CS0--GPIO134--output, LCD's chip select |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
411 |
*/ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
412 |
void SET_GPIOTOSPI(void) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
413 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
414 |
TUint32 l=0x00; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
415 |
TInt8 n=0x01,n1=0x04; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
416 |
TInt8 muxmode=0x04;//set mode4(GPIO) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
417 |
// l=GET_REGISTER(CONTROL_PADCONF_MMC2_CLK)&0xFFF8FFF8|muxmode|muxmode<<16; //set as GPIO130.131 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
418 |
// SET_REGISTER(CONTROL_PADCONF_MMC2_CLK,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
419 |
l=GET_REGISTER(CONTROL_PADCONF_MMC2_DAT0)&0xFFFFFFF8|muxmode; //set as GPIO132 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
420 |
SET_REGISTER(CONTROL_PADCONF_MMC2_DAT0,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
421 |
l=GET_REGISTER(CONTROL_PADCONF_MMC2_DAT2)&0xFFFFFFF8|muxmode; //set as GPIO134.135 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
422 |
SET_REGISTER(CONTROL_PADCONF_MMC2_DAT2,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
423 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
424 |
l=GET_REGISTER(GPIO5_OE)&0xFFFFFF23|n<<4|n<<5;//set GPIO130.131.134.135 as output, 132 as input |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
425 |
SET_REGISTER(GPIO5_OE,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
426 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
427 |
l=GET_REGISTER(CONTROL_PADCONF_DSS_DATA18)&0xFFF8FFF8|muxmode|muxmode<<16; //set as GPIO88,89 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
428 |
SET_REGISTER(CONTROL_PADCONF_DSS_DATA18,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
429 |
l=GET_REGISTER(CONTROL_PADCONF_DSS_DATA20)&0xFFF8FFF8|muxmode|muxmode<<16; //set as GPIO90,91 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
430 |
SET_REGISTER(CONTROL_PADCONF_DSS_DATA20,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
431 |
l=GET_REGISTER(CONTROL_PADCONF_DSS_DATA22)&0xFFFFFFF8|muxmode|muxmode<<16; //set as GPIO92,93 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
432 |
SET_REGISTER(CONTROL_PADCONF_DSS_DATA22,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
433 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
434 |
l=GET_REGISTER(GPIO3_OE)&0xC0FFFFFF|n1<<24;//SPI's input and output |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
435 |
SET_REGISTER(GPIO3_OE,l); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
436 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
437 |
/////////set the init state |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
438 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0);// |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
439 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO);// |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
440 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPICLK);// |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
441 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
442 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
443 |
void SCLRISING(void) //create a rising edge |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
444 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
445 |
SET_REGISTER(GPIO3_SETDATAOUT,SPICLK); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
446 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
447 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPICLK); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
448 |
//Wait(10); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
449 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
450 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
451 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
452 |
/** |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
453 |
Write_Reg_NT35582() is the function used to initialize LCD with the SPI, it follows the instruction |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
454 |
from NT35582 spec page.21 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
455 |
*/ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
456 |
void Write_Reg_NT35582(TUint8 highcmd, TUint8 lowcmd, TUint8 lowpara) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
457 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
458 |
int i=0; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
459 |
//Write 1st command |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
460 |
SET_REGISTER(GPIO5_CLEARDATAOUT,SPICS0); //set cs0 low |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
461 |
//Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
462 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set R/W=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
463 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
464 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
465 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set D/CX=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
466 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
467 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
468 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set H/L=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
469 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
470 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
471 |
for(i=0;i<5;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
472 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
473 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set data=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
474 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
475 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
476 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
477 |
for(i=7;i>=0;i--) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
478 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
479 |
if(highcmd>>i&1) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
480 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
481 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
482 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
483 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
484 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
485 |
else |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
486 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
487 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
488 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
489 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
490 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
491 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
492 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0); //set cs0 high |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
493 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
494 |
//Write 2nd command |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
495 |
SET_REGISTER(GPIO5_CLEARDATAOUT,SPICS0); //set cs0 low |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
496 |
//Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
497 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set R/W=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
498 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
499 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
500 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set D/CX=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
501 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
502 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
503 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set H/L=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
504 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
505 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
506 |
for(i=0;i<5;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
507 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
508 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set data=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
509 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
510 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
511 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
512 |
for(i=7;i>=0;i--) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
513 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
514 |
if(lowcmd>>i&1) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
515 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
516 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
517 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
518 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
519 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
520 |
else |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
521 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
522 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
523 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
524 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
525 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
526 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
527 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
528 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0); //set cs0 high |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
529 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
530 |
//Write parameter |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
531 |
SET_REGISTER(GPIO5_CLEARDATAOUT,SPICS0); //set cs0 low |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
532 |
//Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
533 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set R/W=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
534 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
535 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
536 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set D/CX=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
537 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
538 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
539 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set H/L=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
540 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
541 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
542 |
for(i=0;i<5;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
543 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
544 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set data=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
545 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
546 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
547 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
548 |
for(i=7;i>=0;i--) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
549 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
550 |
if(lowpara>>i&1) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
551 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
552 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
553 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
554 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
555 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
556 |
else |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
557 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
558 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
559 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
560 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
561 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
562 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
563 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0); //set cs0 high |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
564 |
Wait3(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
565 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
566 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
567 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
568 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
569 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
570 |
void Read_Reg_NT35582(TUint8 highcmd, TUint8 lowcmd) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
571 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
572 |
int i=0; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
573 |
TUint8 lowpara=0; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
574 |
//Write 1st command |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
575 |
SET_REGISTER(GPIO5_CLEARDATAOUT,SPICS0); //set cs0 low |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
576 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
577 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set R/W=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
578 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
579 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
580 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set D/CX=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
581 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
582 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
583 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set H/L=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
584 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
585 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
586 |
for(i=0;i<5;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
587 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
588 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set data=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
589 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
590 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
591 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
592 |
for(i=7;i>=0;i--) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
593 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
594 |
if(highcmd>>i&1) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
595 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
596 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
597 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
598 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
599 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
600 |
else |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
601 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
602 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
603 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
604 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
605 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
606 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
607 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0); //set cs0 high |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
608 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
609 |
//Write 2nd command |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
610 |
SET_REGISTER(GPIO5_CLEARDATAOUT,SPICS0); //set cs0 low |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
611 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
612 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set R/W=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
613 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
614 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
615 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set D/CX=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
616 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
617 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
618 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set H/L=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
619 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
620 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
621 |
for(i=0;i<5;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
622 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
623 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set data=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
624 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
625 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
626 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
627 |
for(i=7;i>=0;i--) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
628 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
629 |
if(lowcmd>>i&1) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
630 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
631 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
632 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
633 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
634 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
635 |
else |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
636 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
637 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set bit=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
638 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
639 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
640 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
641 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
642 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
643 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0); //set cs0 high |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
644 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
645 |
//Read parameter |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
646 |
SET_REGISTER(GPIO5_CLEARDATAOUT,SPICS0); //set cs0 low |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
647 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
648 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set R/W=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
649 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
650 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
651 |
SET_REGISTER(GPIO3_SETDATAOUT,SPISDAO); //set D/CX=1 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
652 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
653 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
654 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set H/L=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
655 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
656 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
657 |
for(i=0;i<5;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
658 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
659 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPISDAO); //set data=0 |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
660 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
661 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
662 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
663 |
for(i=7;i>=0;i--) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
664 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
665 |
SCLRISING(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
666 |
if(GET_REGISTER(GPIO5_DATADRAIN)&SPISDAI) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
667 |
lowpara|=1<<i; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
668 |
else |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
669 |
lowpara|=0<<i; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
670 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
671 |
SET_REGISTER(GPIO5_SETDATAOUT,SPICS0); //set cs0 high |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
672 |
Wait(1); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
673 |
Kern::Printf("Get para from Reg %x %x is %x",highcmd,lowcmd,lowpara); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
674 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
675 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
676 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
677 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
678 |
void BYDLCD_INIT(void) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
679 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
680 |
Kern::Printf("Start LCD driver IC NT35582 Init"); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
681 |
SET_GPIOTOSPI(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
682 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
683 |
SET_REGISTER(GPIO3_SETDATAOUT,SPIRESET); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
684 |
Wait(100); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
685 |
SET_REGISTER(GPIO3_CLEARDATAOUT,SPIRESET); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
686 |
Wait(100); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
687 |
SET_REGISTER(GPIO3_SETDATAOUT,SPIRESET); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
688 |
Wait(100); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
689 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
690 |
for(int i=0;i<1;i++) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
691 |
{ |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
692 |
Kern::Printf("init"); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
693 |
Write_Reg_NT35582(0x01,0x00,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
694 |
//Wait(100); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
695 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
696 |
Write_Reg_NT35582(0xC0,0x00,0x86); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
697 |
Write_Reg_NT35582(0xC0,0x01,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
698 |
Write_Reg_NT35582(0xC0,0x02,0x86); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
699 |
Write_Reg_NT35582(0xC0,0x03,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
700 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
701 |
Write_Reg_NT35582(0xC1,0x00,0x60); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
702 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
703 |
Write_Reg_NT35582(0xC2,0x00,0x21); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
704 |
Write_Reg_NT35582(0xC2,0x02,0x70); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
705 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
706 |
Write_Reg_NT35582(0xB6,0x00,0x10); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
707 |
Write_Reg_NT35582(0xB6,0x02,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
708 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
709 |
Write_Reg_NT35582(0xC7,0x00,0x8F);// here change the VCOM voltage |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
710 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
711 |
Write_Reg_NT35582(0x36,0x00,0x41); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
712 |
Write_Reg_NT35582(0x3A,0x00,0x66); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
713 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
714 |
Write_Reg_NT35582(0xE0,0x00,0x0E); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
715 |
Write_Reg_NT35582(0xE0,0x01,0x14); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
716 |
Write_Reg_NT35582(0xE0,0x02,0x29); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
717 |
Write_Reg_NT35582(0xE0,0x03,0x3A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
718 |
Write_Reg_NT35582(0xE0,0x04,0x1D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
719 |
Write_Reg_NT35582(0xE0,0x05,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
720 |
Write_Reg_NT35582(0xE0,0x06,0x61); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
721 |
Write_Reg_NT35582(0xE0,0x07,0x3D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
722 |
Write_Reg_NT35582(0xE0,0x08,0x22); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
723 |
Write_Reg_NT35582(0xE0,0x09,0x2A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
724 |
Write_Reg_NT35582(0xE0,0x0A,0x87); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
725 |
Write_Reg_NT35582(0xE0,0x0B,0x16); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
726 |
Write_Reg_NT35582(0xE0,0x0C,0x3B); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
727 |
Write_Reg_NT35582(0xE0,0x0D,0x4C); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
728 |
Write_Reg_NT35582(0xE0,0x0E,0x78); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
729 |
Write_Reg_NT35582(0xE0,0x0F,0x96); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
730 |
Write_Reg_NT35582(0xE0,0x10,0x4A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
731 |
Write_Reg_NT35582(0xE0,0x11,0x4D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
732 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
733 |
Write_Reg_NT35582(0xE1,0x00,0x0E); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
734 |
Write_Reg_NT35582(0xE1,0x01,0x14); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
735 |
Write_Reg_NT35582(0xE1,0x02,0x29); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
736 |
Write_Reg_NT35582(0xE1,0x03,0x3A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
737 |
Write_Reg_NT35582(0xE1,0x04,0x1D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
738 |
Write_Reg_NT35582(0xE1,0x05,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
739 |
Write_Reg_NT35582(0xE1,0x06,0x61); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
740 |
Write_Reg_NT35582(0xE1,0x07,0x3F); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
741 |
Write_Reg_NT35582(0xE1,0x08,0x20); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
742 |
Write_Reg_NT35582(0xE1,0x09,0x26); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
743 |
Write_Reg_NT35582(0xE1,0x0A,0x83); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
744 |
Write_Reg_NT35582(0xE1,0x0B,0x16); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
745 |
Write_Reg_NT35582(0xE1,0x0C,0x3B); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
746 |
Write_Reg_NT35582(0xE1,0x0D,0x4C); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
747 |
Write_Reg_NT35582(0xE1,0x0E,0x78); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
748 |
Write_Reg_NT35582(0xE1,0x0F,0x96); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
749 |
Write_Reg_NT35582(0xE1,0x10,0x4A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
750 |
Write_Reg_NT35582(0xE1,0x11,0x4D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
751 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
752 |
Write_Reg_NT35582(0xE2,0x00,0x0E); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
753 |
Write_Reg_NT35582(0xE2,0x01,0x14); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
754 |
Write_Reg_NT35582(0xE2,0x02,0x29); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
755 |
Write_Reg_NT35582(0xE2,0x03,0x3A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
756 |
Write_Reg_NT35582(0xE2,0x04,0x1D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
757 |
Write_Reg_NT35582(0xE2,0x05,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
758 |
Write_Reg_NT35582(0xE2,0x06,0x61); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
759 |
Write_Reg_NT35582(0xE2,0x07,0x3D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
760 |
Write_Reg_NT35582(0xE2,0x08,0x22); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
761 |
Write_Reg_NT35582(0xE2,0x09,0x2A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
762 |
Write_Reg_NT35582(0xE2,0x0A,0x87); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
763 |
Write_Reg_NT35582(0xE2,0x0B,0x16); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
764 |
Write_Reg_NT35582(0xE2,0x0C,0x3B); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
765 |
Write_Reg_NT35582(0xE2,0x0D,0x4C); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
766 |
Write_Reg_NT35582(0xE2,0x0E,0x78); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
767 |
Write_Reg_NT35582(0xE2,0x0F,0x96); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
768 |
Write_Reg_NT35582(0xE2,0x10,0x4A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
769 |
Write_Reg_NT35582(0xE2,0x11,0x4D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
770 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
771 |
Write_Reg_NT35582(0xE3,0x00,0x0E); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
772 |
Write_Reg_NT35582(0xE3,0x01,0x14); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
773 |
Write_Reg_NT35582(0xE3,0x02,0x29); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
774 |
Write_Reg_NT35582(0xE3,0x03,0x3A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
775 |
Write_Reg_NT35582(0xE3,0x04,0x1D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
776 |
Write_Reg_NT35582(0xE3,0x05,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
777 |
Write_Reg_NT35582(0xE3,0x06,0x61); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
778 |
Write_Reg_NT35582(0xE3,0x07,0x3F); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
779 |
Write_Reg_NT35582(0xE3,0x08,0x20); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
780 |
Write_Reg_NT35582(0xE3,0x09,0x26); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
781 |
Write_Reg_NT35582(0xE3,0x0A,0x83); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
782 |
Write_Reg_NT35582(0xE3,0x0B,0x16); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
783 |
Write_Reg_NT35582(0xE3,0x0C,0x3B); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
784 |
Write_Reg_NT35582(0xE3,0x0D,0x4C); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
785 |
Write_Reg_NT35582(0xE3,0x0E,0x78); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
786 |
Write_Reg_NT35582(0xE3,0x0F,0x96); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
787 |
Write_Reg_NT35582(0xE3,0x10,0x4A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
788 |
Write_Reg_NT35582(0xE3,0x11,0x4D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
789 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
790 |
Write_Reg_NT35582(0xE4,0x00,0x0E); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
791 |
Write_Reg_NT35582(0xE4,0x01,0x14); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
792 |
Write_Reg_NT35582(0xE4,0x02,0x29); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
793 |
Write_Reg_NT35582(0xE4,0x03,0x3A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
794 |
Write_Reg_NT35582(0xE4,0x04,0x1D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
795 |
Write_Reg_NT35582(0xE4,0x05,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
796 |
Write_Reg_NT35582(0xE4,0x06,0x61); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
797 |
Write_Reg_NT35582(0xE4,0x07,0x3D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
798 |
Write_Reg_NT35582(0xE4,0x08,0x22); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
799 |
Write_Reg_NT35582(0xE4,0x09,0x2A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
800 |
Write_Reg_NT35582(0xE4,0x0A,0x87); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
801 |
Write_Reg_NT35582(0xE4,0x0B,0x16); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
802 |
Write_Reg_NT35582(0xE4,0x0C,0x3B); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
803 |
Write_Reg_NT35582(0xE4,0x0D,0x4C); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
804 |
Write_Reg_NT35582(0xE4,0x0E,0x78); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
805 |
Write_Reg_NT35582(0xE4,0x0F,0x96); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
806 |
Write_Reg_NT35582(0xE4,0x10,0x4A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
807 |
Write_Reg_NT35582(0xE4,0x11,0x4D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
808 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
809 |
Write_Reg_NT35582(0xE5,0x00,0x0E); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
810 |
Write_Reg_NT35582(0xE5,0x01,0x14); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
811 |
Write_Reg_NT35582(0xE5,0x02,0x29); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
812 |
Write_Reg_NT35582(0xE5,0x03,0x3A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
813 |
Write_Reg_NT35582(0xE5,0x04,0x1D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
814 |
Write_Reg_NT35582(0xE5,0x05,0x30); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
815 |
Write_Reg_NT35582(0xE5,0x06,0x61); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
816 |
Write_Reg_NT35582(0xE5,0x07,0x3F); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
817 |
Write_Reg_NT35582(0xE5,0x08,0x20); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
818 |
Write_Reg_NT35582(0xE5,0x09,0x26); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
819 |
Write_Reg_NT35582(0xE5,0x0A,0x83); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
820 |
Write_Reg_NT35582(0xE5,0x0B,0x16); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
821 |
Write_Reg_NT35582(0xE5,0x0C,0x3B); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
822 |
Write_Reg_NT35582(0xE5,0x0D,0x4C); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
823 |
Write_Reg_NT35582(0xE5,0x0E,0x78); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
824 |
Write_Reg_NT35582(0xE5,0x0F,0x96); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
825 |
Write_Reg_NT35582(0xE5,0x10,0x4A); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
826 |
Write_Reg_NT35582(0xE5,0x11,0x4D); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
827 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
828 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
829 |
Write_Reg_NT35582(0x11,0x00,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
830 |
Wait(150); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
831 |
Write_Reg_NT35582(0x29,0x00,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
832 |
Wait(100); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
833 |
} |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
834 |
//Kern::Printf("SW RESET"); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
835 |
//Write_Reg_NT35582a(0x01,0x00,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
836 |
//Wait(2000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
837 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
838 |
//Kern::Printf("SLP Out"); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
839 |
//Write_Reg_NT35582a(0x11,0x00,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
840 |
//Wait(2000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
841 |
//Kern::Printf("DISPON"); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
842 |
//Write_Reg_NT35582a(0x29,0x00,0x00); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
843 |
//Wait(2000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
844 |
|
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
845 |
Kern::Printf("END driver IC NT35582 Init"); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
846 |
//Wait(2000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
847 |
} |
0 | 848 |
|
849 |
/** |
|
850 |
Default constructor |
|
851 |
*/ |
|
852 |
DLcdPowerHandler::DLcdPowerHandler() : |
|
853 |
DPowerHandler(KLitLcd), |
|
854 |
iMsgQ(rxMsg,this,NULL,1), |
|
855 |
iPowerUpDfc(&power_up_dfc,this,6), |
|
856 |
iPowerDownDfc(&power_down_dfc,this,7), |
|
857 |
iBacklightOn(EFalse), |
|
858 |
iContrast(KConfigInitialDisplayContrast), |
|
859 |
iBrightness(KConfigInitialDisplayBrightness) |
|
860 |
{ |
|
861 |
} |
|
862 |
||
863 |
||
864 |
/** |
|
865 |
Second-phase constructor |
|
866 |
||
867 |
Called by factory function at ordinal 0 |
|
868 |
*/ |
|
869 |
TInt DLcdPowerHandler::Create() |
|
870 |
{ |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
871 |
BYDLCD_INIT(); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
872 |
Wait2(1000); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
873 |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
874 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
875 |
pLcd = this; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
876 |
#endif |
0 | 877 |
iDfcQ=Kern::DfcQue0(); // use low priority DFC queue for this driver |
878 |
||
879 |
// map the video RAM |
|
880 |
||
881 |
//TPhysAddr videoRamPhys; |
|
882 |
TInt vSize = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iLenghtOfVideoBufferInBytes; //KConfigLcdWidth*KConfigLcdHeight*3; //VideoRamSize(); |
|
883 |
TInt r = Epoc::AllocPhysicalRam( 2*vSize, ivRamPhys ); |
|
884 |
if ( r!=KErrNone ) |
|
885 |
{ |
|
886 |
Kern::Fault( "AllocVRam", r ); |
|
887 |
} |
|
888 |
||
889 |
//TInt vSize = ((Omap3530BoardAssp*)Arch::TheAsic())->VideoRamSize(); |
|
890 |
//ivRamPhys = TOmap3530Assp::VideoRamPhys(); // EXAMPLE ONLY: assume TOmap3530Assp interface class |
|
891 |
r = DPlatChunkHw::New(iChunk,ivRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC); |
|
892 |
if (r != KErrNone) |
|
893 |
return r; |
|
894 |
||
895 |
//create "secure" screen immediately after normal one |
|
896 |
iSecurevRamPhys = ivRamPhys + vSize; |
|
897 |
TInt r2 = DPlatChunkHw::New(iSecureChunk,iSecurevRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC); |
|
898 |
if (r2 != KErrNone) |
|
899 |
return r2; |
|
900 |
||
901 |
TUint* pV=(TUint*)iChunk->LinearAddress(); |
|
902 |
||
903 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("DLcdPowerHandler::Create: VideoRamSize=%x, VideoRamPhys=%08x, VideoRamLin=%08x",vSize,ivRamPhys,pV)); |
|
904 |
||
905 |
// TO DO: (mandatory) |
|
906 |
// initialise the palette for the initial display mode |
|
907 |
// NOTE: the palette could either be a buffer allocated in system RAM (usually contiguous to Video buffer) |
|
908 |
// or could be offered as part of the hardware block that implemenst the lcd control |
|
909 |
// |
|
910 |
||
911 |
TUint* pV2=(TUint*)iSecureChunk->LinearAddress(); |
|
912 |
||
913 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("DLcdPowerHandler::Create: Secure display VideoRamSize=%x, VideoRamPhys=%08x, VideoRamLin=%08x",vSize,iSecurevRamPhys,pV2)); |
|
914 |
||
915 |
// TO DO: (mandatory) |
|
916 |
// initialise the secure screen's palette for the initial display mode |
|
917 |
// |
|
918 |
||
919 |
// setup the video info structure, this'll be used to remember the video settings |
|
920 |
iVideoInfo.iDisplayMode = KConfigLcdInitialDisplayMode; |
|
921 |
iVideoInfo.iOffsetToFirstPixel = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iOffsetToFirstVideoBuffer; |
|
922 |
iVideoInfo.iIsPalettized = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iIsPalettized; |
|
923 |
iVideoInfo.iOffsetBetweenLines = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iOffsetBetweenLines; |
|
924 |
iVideoInfo.iBitsPerPixel = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iBitsPerPixel; |
|
925 |
||
926 |
iVideoInfo.iSizeInPixels.iWidth = KConfigLcdWidth; |
|
927 |
iVideoInfo.iSizeInPixels.iHeight = KConfigLcdHeight; |
|
928 |
iVideoInfo.iSizeInTwips.iWidth = KConfigLcdWidthInTwips; |
|
929 |
iVideoInfo.iSizeInTwips.iHeight = KConfigLcdHeightInTwips; |
|
930 |
iVideoInfo.iIsMono = KConfigLcdIsMono; |
|
931 |
iVideoInfo.iVideoAddress=(TInt)pV; |
|
932 |
iVideoInfo.iIsPixelOrderLandscape = KConfigLcdPixelOrderLandscape; |
|
933 |
iVideoInfo.iIsPixelOrderRGB = KConfigLcdPixelOrderRGB; |
|
934 |
||
935 |
iSecureVideoInfo = iVideoInfo; |
|
936 |
iSecureVideoInfo.iVideoAddress = (TInt)pV2; |
|
937 |
||
938 |
iDisplayOn = EFalse; |
|
939 |
iSecureDisplay = EFalse; |
|
940 |
||
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
941 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
942 |
// Alloc Physical RAM for the Composition Buffers used by the GCE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
943 |
iSize = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iLenghtOfVideoBufferInBytes; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
944 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DLcdPowerHandler.iSize = %d", iSize)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
945 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
946 |
// double and round the page size |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
947 |
TUint round = 2*Kern::RoundToPageSize(iSize); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
948 |
r = Epoc::AllocPhysicalRam(round , iCompositionPhysical); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
949 |
if(r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
950 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
951 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to allocate physical RAM for composition buffer %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
952 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
953 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
954 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
955 |
|
0 | 956 |
// install the HAL function |
957 |
r=Kern::AddHalEntry(EHalGroupDisplay, halFunction, this); |
|
958 |
if (r!=KErrNone) |
|
959 |
return r; |
|
960 |
||
961 |
iPowerUpDfc.SetDfcQ(iDfcQ); |
|
962 |
iPowerDownDfc.SetDfcQ(iDfcQ); |
|
963 |
iMsgQ.SetDfcQ(iDfcQ); |
|
964 |
iMsgQ.Receive(); |
|
965 |
||
966 |
// install the power handler |
|
967 |
// power up the screen |
|
968 |
Add(); |
|
969 |
DisplayOn(); |
|
970 |
||
971 |
SplashScreen(); |
|
972 |
||
973 |
return KErrNone; |
|
974 |
} |
|
975 |
||
976 |
/** |
|
977 |
Turn the display on |
|
978 |
May be called as a result of a power transition or from the HAL |
|
979 |
If called from HAL, then the display may be already be on (iDisplayOn == ETrue) |
|
980 |
*/ |
|
981 |
void DLcdPowerHandler::DisplayOn() |
|
982 |
{ |
|
983 |
__KTRACE_OPT(KBOOT, Kern::Printf("DisplayOn %d", iDisplayOn)); |
|
984 |
if (!iDisplayOn) // may have been powered up already |
|
985 |
{ |
|
986 |
iDisplayOn = ETrue; |
|
987 |
PowerUpLcd(iSecureDisplay); |
|
988 |
SetContrast(iContrast); |
|
989 |
SetBrightness(iBrightness); |
|
990 |
} |
|
991 |
} |
|
992 |
||
993 |
/** |
|
994 |
Turn the display off |
|
995 |
May be called as a result of a power transition or from the HAL |
|
996 |
If called from Power Manager, then the display may be already be off (iDisplayOn == EFalse) |
|
997 |
if the platform is in silent running mode |
|
998 |
*/ |
|
999 |
void DLcdPowerHandler::DisplayOff() |
|
1000 |
{ |
|
1001 |
__KTRACE_OPT(KBOOT, Kern::Printf("DisplayOff %d", iDisplayOn)); |
|
1002 |
if (iDisplayOn) |
|
1003 |
{ |
|
1004 |
iDisplayOn = EFalse; |
|
1005 |
PowerDownLcd(); |
|
1006 |
} |
|
1007 |
} |
|
1008 |
||
1009 |
/** |
|
1010 |
Switch between secure and non-secure displays |
|
1011 |
||
1012 |
@param aSecure ETrue if switching to secure display |
|
1013 |
*/ |
|
1014 |
void DLcdPowerHandler::SwitchDisplay(TBool aSecure) |
|
1015 |
{ |
|
1016 |
if (aSecure) |
|
1017 |
{ |
|
1018 |
if (!iSecureDisplay) |
|
1019 |
{ |
|
1020 |
//switch to secure display |
|
1021 |
DisplayOff(); |
|
1022 |
iSecureDisplay = ETrue; |
|
1023 |
DisplayOn(); |
|
1024 |
} |
|
1025 |
} |
|
1026 |
else |
|
1027 |
{ |
|
1028 |
if (iSecureDisplay) |
|
1029 |
{ |
|
1030 |
//switch from secure display |
|
1031 |
DisplayOff(); |
|
1032 |
iSecureDisplay = EFalse; |
|
1033 |
DisplayOn(); |
|
1034 |
} |
|
1035 |
} |
|
1036 |
} |
|
1037 |
||
1038 |
/** |
|
1039 |
DFC to power up the display |
|
1040 |
*/ |
|
1041 |
void DLcdPowerHandler::PowerUpDfc() |
|
1042 |
{ |
|
1043 |
__KTRACE_OPT(KPOWER, Kern::Printf("PowerUpDfc")); |
|
1044 |
DisplayOn(); |
|
1045 |
||
1046 |
PowerUpDone(); // must be called from a different thread than PowerUp() |
|
1047 |
} |
|
1048 |
||
1049 |
/** |
|
1050 |
DFC to power down the display |
|
1051 |
*/ |
|
1052 |
void DLcdPowerHandler::PowerDownDfc() |
|
1053 |
{ |
|
1054 |
__KTRACE_OPT(KPOWER, Kern::Printf("PowerDownDfc")); |
|
1055 |
DisplayOff(); |
|
1056 |
PowerDownDone(); // must be called from a different thread than PowerUp() |
|
1057 |
} |
|
1058 |
||
1059 |
/** |
|
1060 |
Schedule the power-down DFC |
|
1061 |
*/ |
|
1062 |
void DLcdPowerHandler::PowerDown(TPowerState) |
|
1063 |
{ |
|
1064 |
iPowerDownDfc.Enque(); // schedules DFC to execute on this driver's thread |
|
1065 |
} |
|
1066 |
||
1067 |
/** |
|
1068 |
Schedule the power-up DFC |
|
1069 |
*/ |
|
1070 |
void DLcdPowerHandler::PowerUp() |
|
1071 |
{ |
|
1072 |
iPowerUpDfc.Enque(); // schedules DFC to execute on this driver's thread |
|
1073 |
} |
|
1074 |
||
1075 |
/** |
|
1076 |
Power up the display |
|
1077 |
||
1078 |
@param aSecure ETrue if powering up the secure display |
|
1079 |
*/ |
|
1080 |
void DLcdPowerHandler::PowerUpLcd(TBool aSecure) |
|
1081 |
{ |
|
1082 |
||
1083 |
TUint32 l = 0x0; |
|
1084 |
||
1085 |
// Set up the Display Subsystem to control a DVI monitor |
|
1086 |
||
1087 |
// The following four lines need to be replaced by a call to the GPIO driver which should call the PowerClock driver |
|
1088 |
// PowerClock::GpioActive(0, PowerClock::E1s, PowerClock::ECpu10, PowerClock::EBus10); |
|
1089 |
// PowerClock::GpioAccess(0, PowerClock::EAuto); |
|
1090 |
Prcm::SetClockState( Prcm::EClkGpio1_F, Prcm::EClkOn ); |
|
1091 |
Prcm::SetClockState( Prcm::EClkGpio1_I, Prcm::EClkAuto ); |
|
1092 |
*( (TUint *) Omap3530HwBase::TVirtual<0x48310034>::Value ) = 0xfefffedf; //GPIO1 output enable p3336 |
|
1093 |
*( (TUint *) Omap3530HwBase::TVirtual<0x48310094>::Value ) = 0x01000120; //GPIO1 set data out p3336 |
|
1094 |
// const TUint KCM_CLKSEL_DSS = Omap3530HwBase::TVirtual<0x48004E40>::Value; |
|
1095 |
// Prcm::Set(KCM_CLKSEL_DSS, 0xffffffffu, 0x00001006); |
|
1096 |
||
1097 |
Prcm::SetDivider( Prcm::EClkDss1_F, 2 ); |
|
1098 |
Prcm::SetDivider( Prcm::EClkTv_F, 1 ); |
|
1099 |
||
1100 |
||
1101 |
SET_REGISTER( DSS_SYSCONFIG, 0x00000010 ); // Display Subsystem reset |
|
1102 |
while ( !( GET_REGISTER( DISPC_SYSSTATUS ) & 1 ) ); // Spin until reset complete |
|
1103 |
||
1104 |
TInt8 MIDLEMODE = 0x2; // Smart Standby. MStandby is asserted based on the internal activity of the module. |
|
1105 |
TInt8 CLOCKACTIVITY = 0x0; // interface and functional clocks can be switched off. |
|
1106 |
TInt8 SIDLEMODE = 0x2; // Smart idle. Idle request is acknowledged based on the internal activity of the module |
|
1107 |
TInt8 ENWAKEUP = 0x1; // Wakeup is enabled. |
|
1108 |
TInt8 SOFTRESET = 0x0; // Normal mode |
|
1109 |
TInt8 AUTOIDLE = 0x1; // Automatic L3 and L4 interface clock gating strategy is applied based on interface activity |
|
1110 |
l = MIDLEMODE<<12 | CLOCKACTIVITY<<8 | SIDLEMODE<<3 | ENWAKEUP<<2 | SOFTRESET<<1 | AUTOIDLE; |
|
1111 |
SET_REGISTER( DISPC_SYSCONFIG, l ); |
|
1112 |
||
1113 |
TInt8 LOADMOAD = 0x2; //Frame data only loaded every frame |
|
1114 |
l = LOADMOAD<<1; |
|
1115 |
SET_REGISTER( DISPC_CONFIG, l ); |
|
1116 |
||
1117 |
SET_REGISTER( DISPC_DEFAULT_COLOR0, 0xFFFFFFFF ); |
|
1118 |
SET_REGISTER( DISPC_TRANS_COLOR0, 0x00000000 ); |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1119 |
TUint16 LINENUMBER=799; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1120 |
l=LINENUMBER; |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1121 |
SET_REGISTER(DISPC_LINE_STATUS, l); |
0 | 1122 |
|
1123 |
TUint8 hbp = H_BPORCH - 1; // Horizontal Back Porch |
|
1124 |
TUint8 hfp = H_FPORCH - 1; // Horizontal front porch |
|
1125 |
TUint8 hsw = H_SYNC - 1; // Horizontal synchronization pulse width |
|
1126 |
if ( hsw > 63 ) |
|
1127 |
{ |
|
1128 |
hsw = 63; |
|
1129 |
Kern::Printf("[LCD] H_SYNC too big"); |
|
1130 |
} |
|
1131 |
l = hbp<<20 | hfp<<8 | hsw; |
|
1132 |
SET_REGISTER( DISPC_TIMING_H, l ); |
|
1133 |
||
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1134 |
TUint16 vbp = V_BPORCH; // Vertical back porch |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1135 |
TUint16 vfp = V_FPORCH; // Vertical front porch |
0 | 1136 |
TUint8 vsw = V_SYNC; // Vertical synchronization pulse width |
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1137 |
// __ASSERT_ALWAYS( vbp<=255, Kern::Fault("LCD", 1) ); |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1138 |
// __ASSERT_ALWAYS( vfp<=255, Kern::Fault("LCD", 1) ); |
0 | 1139 |
__ASSERT_ALWAYS( vsw>=1 && vsw<=255, Kern::Fault("LCD", 1) ); |
1140 |
l = vbp<<20 | vfp<<8 | vsw; |
|
1141 |
SET_REGISTER( DISPC_TIMING_V, l ); |
|
1142 |
||
1143 |
TUint8 onoff= 0; |
|
1144 |
TUint8 rf = 0; |
|
1145 |
TUint8 ieo = 0; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1146 |
TUint8 ipc = 0; // Invert Pixel Clock |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1147 |
TUint8 ihs = H_SYNC_POL ;//? 0 : 1; // Invert HSYNC (0: Positive Sync polarity, 1: Negative Sync polarity) |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1148 |
TUint8 ivs = V_SYNC_POL ;//? 0 : 1; // Invert VSYNC (0: Positive Sync polarity, 1: Negative Sync polarity) |
0 | 1149 |
TUint8 acbi = 0; |
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1150 |
TUint8 acb = 0x28; // AC-bias pin frequency |
0 | 1151 |
l = onoff<<17 | rf<<16 | ieo<<15 | ipc<<14 | ihs<<13 | ivs<<12 | acbi<<8 | acb; |
1152 |
SET_REGISTER( DISPC_POL_FREQ, l ); |
|
1153 |
||
1154 |
TUint8 lcd = 1; // Display Controller Logic Clock Divisor |
|
1155 |
TUint8 pcd = ( 432000 + (PIXEL_CLK - 1) ) / PIXEL_CLK; // Pixel Clock Divisor - add (PIXEL_CLK - 1) to avoid rounding error |
|
1156 |
__ASSERT_ALWAYS( lcd>=1 && lcd<=255, Kern::Fault("LCD", 1) ); |
|
1157 |
__ASSERT_ALWAYS( pcd>=2 && pcd<=255, Kern::Fault("LCD", 1) ); |
|
1158 |
l = lcd<<16 | pcd; |
|
1159 |
SET_REGISTER( DISPC_DIVISOR, l ); |
|
1160 |
||
1161 |
TUint16 ppl = H_DISP - 1; // Pixels per line |
|
1162 |
TUint16 llp = V_DISP - 1; // Lines per panel |
|
1163 |
__ASSERT_ALWAYS( ppl>=1 && ppl<=2048, Kern::Fault("LCD", 1) ); |
|
1164 |
__ASSERT_ALWAYS( llp>=1 && llp<=2048, Kern::Fault("LCD", 1) ); |
|
1165 |
l = llp<<16 | ppl; |
|
1166 |
SET_REGISTER( DISPC_SIZE_LCD, l ); |
|
1167 |
||
1168 |
||
1169 |
// Setup a graphics region (GFX) |
|
1170 |
||
1171 |
// Set GFX frame buffer |
|
1172 |
SET_REGISTER( DISPC_GFX_BA1, ivRamPhys ); |
|
1173 |
||
1174 |
// Center the GFX |
|
1175 |
TInt16 gfxposy = ( V_DISP - KConfigLcdHeight ) / 2; |
|
1176 |
TInt16 gfxposx = ( H_DISP - KConfigLcdWidth ) / 2; |
|
1177 |
l = ( gfxposy << 16 ) | gfxposx; |
|
1178 |
SET_REGISTER( DISPC_GFX_POSITION, l ); |
|
1179 |
||
1180 |
// Set the GFX dimensions |
|
1181 |
TInt16 gfxsizey = KConfigLcdHeight - 1; |
|
1182 |
TInt16 gfxsizex = KConfigLcdWidth - 1; |
|
1183 |
l = gfxsizey<<16 | gfxsizex; |
|
1184 |
SET_REGISTER( DISPC_GFX_SIZE, l ); |
|
1185 |
||
1186 |
TInt8 GFXSELFREFRESH = 0x0; |
|
1187 |
TInt8 GFXARBITRATION = 0x0; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1188 |
TInt8 GFXROTATION = 0x2; |
0 | 1189 |
TInt8 GFXFIFOPRELOAD = 0x0; |
1190 |
TInt8 GFXENDIANNESS = 0x0; |
|
1191 |
TInt8 GFXNIBBLEMODE = 0x0; |
|
1192 |
TInt8 GFXCHANNELOUT = 0x0; |
|
1193 |
TInt8 GFXBURSTSIZE = 0x2; // 16x32bit bursts |
|
1194 |
TInt8 GFXREPLICATIONENABLE = 0x0; // Disable Graphics replication logic |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1195 |
TInt8 GFXFORMAT = 0x8;//0x6;//0x6; // RGB16=0x6, RGB24-unpacked=0x8, RGB24-packed=0x9 |
0 | 1196 |
TInt8 GFXENABLE = 0x1; // Graphics enabled |
1197 |
l = GFXSELFREFRESH<<15 | GFXARBITRATION<<14 | GFXROTATION<<12 | GFXFIFOPRELOAD<<11 | GFXENDIANNESS<<10 | GFXNIBBLEMODE<<9 | GFXCHANNELOUT<8 | GFXBURSTSIZE<<6 | GFXREPLICATIONENABLE<<5 | GFXFORMAT<<1 | GFXENABLE; |
|
1198 |
SET_REGISTER( DISPC_GFX_ATTRIBUTES, l ); |
|
1199 |
||
1200 |
TInt16 GFXFIFOHIGHTHRESHOLD = 0x3fc; // Graphics FIFO High Threshold |
|
1201 |
TInt16 GFXFIFOLOWTHRESHOLD = 0x3BC; // Graphics FIFO Low Threshold |
|
1202 |
l = GFXFIFOHIGHTHRESHOLD<<16 | GFXFIFOLOWTHRESHOLD; |
|
1203 |
SET_REGISTER(DISPC_GFX_FIFO_THRESHOLD, l); |
|
1204 |
||
1205 |
TInt16 GFXFIFOSIZE = 0x400; // Number of bytes defining the FIFO value |
|
1206 |
l = GFXFIFOSIZE; |
|
1207 |
SET_REGISTER(DISPC_GFX_FIFO_SIZE_STATUS, l); |
|
1208 |
||
1209 |
TInt32 GFXROWINC = 0x1; |
|
1210 |
l = GFXROWINC; |
|
1211 |
SET_REGISTER(DISPC_GFX_ROW_INC, l); |
|
1212 |
||
1213 |
TInt16 GFXPIXELINC = 0x1; |
|
1214 |
l = GFXPIXELINC; |
|
1215 |
SET_REGISTER(DISPC_GFX_PIXEL_INC, l); |
|
1216 |
||
1217 |
TInt32 GFXWINDOWSKIP = 0x0; |
|
1218 |
l = GFXWINDOWSKIP; |
|
1219 |
SET_REGISTER(DISPC_GFX_WINDOW_SKIP, l); |
|
1220 |
||
1221 |
// TO DO: Sort out the Gamma table + pallets |
|
1222 |
TInt32 GFXTABLEBA = 0x807ff000; |
|
1223 |
l = GFXTABLEBA; |
|
1224 |
SET_REGISTER(DISPC_GFX_TABLE_BA, l); |
|
1225 |
||
1226 |
||
1227 |
// Propigate all the shadowed registers |
|
1228 |
||
1229 |
TInt8 SPATIALTEMPORALDITHERINGFRAMES = 0; |
|
1230 |
TInt8 LCDENABLEPOL = 0; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1231 |
TInt8 LCDENABLESIGNAL = 1; |
0 | 1232 |
TInt8 PCKFREEENABLE = 0; |
1233 |
TInt8 TDMUNUSEDBITS = 0; |
|
1234 |
TInt8 TDMCYCLEFORMAT = 0; |
|
1235 |
TInt8 TDMPARALLELMODE = 0; |
|
1236 |
TInt8 TDMENABLE = 0; |
|
1237 |
TInt8 HT = 0; |
|
1238 |
TInt8 GPOUT1 = 1; |
|
1239 |
TInt8 GPOUT0 = 1; |
|
1240 |
TInt8 GPIN1 = 0; |
|
1241 |
TInt8 GPIN0 = 0; |
|
1242 |
TInt8 OVERLAYOPTIMIZATION = 0; |
|
1243 |
TInt8 RFBIMODE = 0; |
|
1244 |
TInt8 SECURE = 0; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1245 |
TInt8 TFTDATALINES = 0x2;//0x3;//0x2; |
0 | 1246 |
TInt8 STDITHERENABLE = 0; |
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1247 |
TInt8 GODIGITAL = 0; |
0 | 1248 |
TInt8 GOLCD = 1; |
1249 |
TInt8 M8B = 0; |
|
1250 |
TInt8 STNTFT = 1; |
|
1251 |
TInt8 MONOCOLOR = 0; |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1252 |
TInt8 DIGITALENABLE = 0; |
0 | 1253 |
TInt8 LCDENABLE = 1; |
1254 |
l = SPATIALTEMPORALDITHERINGFRAMES<<30 | LCDENABLEPOL<<29 | LCDENABLESIGNAL<<28 | PCKFREEENABLE<<27 | |
|
1255 |
TDMUNUSEDBITS<<25 | TDMCYCLEFORMAT<<23 | TDMPARALLELMODE<<21 | TDMENABLE<<20 | HT<<17 | GPOUT1<<16 | |
|
1256 |
GPOUT0<<15 | GPIN1<<14 | GPIN0<<13 | OVERLAYOPTIMIZATION<<12 | RFBIMODE<<11 | SECURE<<10 | |
|
1257 |
TFTDATALINES<<8 | STDITHERENABLE<<7 | GODIGITAL<<6 | GOLCD<<5 | M8B<<4 | STNTFT<<3 | |
|
1258 |
MONOCOLOR<<2 | DIGITALENABLE<<1 | LCDENABLE; |
|
1259 |
NKern::Sleep(1); |
|
1260 |
SET_REGISTER(DISPC_CONTROL, l); |
|
1261 |
NKern::Sleep(1); |
|
1262 |
||
1263 |
} |
|
1264 |
||
1265 |
||
1266 |
/** |
|
1267 |
Power down the display and the backlight |
|
1268 |
*/ |
|
1269 |
void DLcdPowerHandler::PowerDownLcd() |
|
1270 |
{ |
|
1271 |
SetBacklightState(EFalse); |
|
1272 |
||
1273 |
// TO DO: (mandatory) |
|
1274 |
// Power down the display & disable LCD DMA. |
|
1275 |
// May need to wait until the current frame has been output |
|
1276 |
// |
|
1277 |
||
1278 |
SET_REGISTER(DISPC_CONTROL, 0); |
|
1279 |
||
1280 |
} |
|
1281 |
||
1282 |
/** |
|
1283 |
Set the Lcd contrast |
|
1284 |
||
1285 |
@param aValue the contrast setting |
|
1286 |
*/ |
|
1287 |
TInt DLcdPowerHandler::SetContrast(TInt aValue) |
|
1288 |
{ |
|
1289 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetContrast(%d)", aValue)); |
|
1290 |
||
1291 |
if (aValue >= KConfigLcdMinDisplayContrast && aValue <= KConfigLcdMaxDisplayContrast) |
|
1292 |
{ |
|
1293 |
iContrast=aValue; |
|
1294 |
||
1295 |
// TO DO: (mandatory) |
|
1296 |
// set the contrast |
|
1297 |
// |
|
1298 |
return KErrNone; |
|
1299 |
} |
|
1300 |
||
1301 |
return KErrArgument; |
|
1302 |
} |
|
1303 |
||
1304 |
/** |
|
1305 |
Set the Lcd brightness |
|
1306 |
||
1307 |
@param aValue the brightness setting |
|
1308 |
*/ |
|
1309 |
TInt DLcdPowerHandler::SetBrightness(TInt aValue) |
|
1310 |
{ |
|
1311 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetBrightness(%d)", aValue)); |
|
1312 |
||
1313 |
if (aValue >= KConfigLcdMinDisplayBrightness && aValue <= KConfigLcdMaxDisplayBrightness) |
|
1314 |
{ |
|
1315 |
iBrightness=aValue; |
|
1316 |
||
1317 |
// TO DO: (mandatory) |
|
1318 |
// set the brightness |
|
1319 |
// |
|
1320 |
return KErrNone; |
|
1321 |
} |
|
1322 |
return KErrArgument; |
|
1323 |
} |
|
1324 |
||
1325 |
/** |
|
1326 |
Turn the backlight on |
|
1327 |
*/ |
|
1328 |
void DLcdPowerHandler::BacklightOn() |
|
1329 |
{ |
|
1330 |
// TO DO: (mandatory) |
|
1331 |
// turn the backlight on |
|
1332 |
// |
|
1333 |
} |
|
1334 |
||
1335 |
/** |
|
1336 |
Turn the backlight off |
|
1337 |
*/ |
|
1338 |
void DLcdPowerHandler::BacklightOff() |
|
1339 |
{ |
|
1340 |
// TO DO: (mandatory) |
|
1341 |
// turn the backlight off |
|
1342 |
// |
|
1343 |
} |
|
1344 |
||
1345 |
/** |
|
1346 |
Set the state of the backlight |
|
1347 |
||
1348 |
@param aState ETrue if setting the backlight on |
|
1349 |
*/ |
|
1350 |
void DLcdPowerHandler::SetBacklightState(TBool aState) |
|
1351 |
{ |
|
1352 |
iBacklightOn=aState; |
|
1353 |
if (iBacklightOn) |
|
1354 |
BacklightOn(); |
|
1355 |
else |
|
1356 |
BacklightOff(); |
|
1357 |
} |
|
1358 |
||
1359 |
void DLcdPowerHandler::ScreenInfo(TScreenInfoV01& anInfo) |
|
1360 |
{ |
|
1361 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("DLcdPowerHandler::ScreenInfo")); |
|
1362 |
anInfo.iWindowHandleValid=EFalse; |
|
1363 |
anInfo.iWindowHandle=NULL; |
|
1364 |
anInfo.iScreenAddressValid=ETrue; |
|
1365 |
anInfo.iScreenAddress=(TAny *)(iChunk->LinearAddress()); |
|
1366 |
anInfo.iScreenSize.iWidth=KConfigLcdWidth; |
|
1367 |
anInfo.iScreenSize.iHeight=KConfigLcdHeight; |
|
1368 |
} |
|
1369 |
||
1370 |
/** |
|
1371 |
Handle a message from the power handler |
|
1372 |
*/ |
|
1373 |
void DLcdPowerHandler::HandleMsg(void) |
|
1374 |
{ |
|
1375 |
||
1376 |
TMessageBase* msg = iMsgQ.iMessage; |
|
1377 |
if (msg == NULL) |
|
1378 |
return; |
|
1379 |
||
1380 |
if (msg->iValue) |
|
1381 |
DisplayOn(); |
|
1382 |
else |
|
1383 |
DisplayOff(); |
|
1384 |
msg->Complete(KErrNone,ETrue); |
|
1385 |
} |
|
1386 |
||
1387 |
/** |
|
1388 |
Send a message to the power-handler message queue to turn the display on |
|
1389 |
*/ |
|
1390 |
void DLcdPowerHandler::WsSwitchOnScreen() |
|
1391 |
{ |
|
1392 |
TThreadMessage& m=Kern::Message(); |
|
1393 |
m.iValue = ETrue; |
|
1394 |
m.SendReceive(&iMsgQ); // send a message and block Client thread until keyboard has been powered up |
|
1395 |
} |
|
1396 |
||
1397 |
/** |
|
1398 |
Send a message to the power-handler message queue to turn the display off |
|
1399 |
*/ |
|
1400 |
void DLcdPowerHandler::WsSwitchOffScreen() |
|
1401 |
{ |
|
1402 |
TThreadMessage& m=Kern::Message(); |
|
1403 |
m.iValue = EFalse; |
|
1404 |
m.SendReceive(&iMsgQ); // send a message and block Client thread until keyboard has been powered down |
|
1405 |
} |
|
1406 |
||
1407 |
/** |
|
1408 |
Return information about the current display mode |
|
1409 |
||
1410 |
@param aInfo a structure supplied by the caller to be filled by this function. |
|
1411 |
@param aSecure ETrue if requesting information about the secure display |
|
1412 |
@return KErrNone if successful |
|
1413 |
*/ |
|
1414 |
TInt DLcdPowerHandler::GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure) |
|
1415 |
{ |
|
1416 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("GetCurrentDisplayModeInfo")); |
|
1417 |
NKern::FMWait(&iLock); |
|
1418 |
if (aSecure) |
|
1419 |
aInfo = iSecureVideoInfo; |
|
1420 |
else |
|
1421 |
aInfo = iVideoInfo; |
|
1422 |
NKern::FMSignal(&iLock); |
|
1423 |
return KErrNone; |
|
1424 |
} |
|
1425 |
||
1426 |
/** |
|
1427 |
Return information about the specified display mode |
|
1428 |
||
1429 |
@param aMode the display mode to query |
|
1430 |
@param aInfo a structure supplied by the caller to be filled by this function. |
|
1431 |
@return KErrNone if successful |
|
1432 |
*/ |
|
1433 |
TInt DLcdPowerHandler::GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo) |
|
1434 |
{ |
|
1435 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("GetSpecifiedDisplayModeInfo mode is %d",aMode)); |
|
1436 |
||
1437 |
if (aMode < 0 || aMode >= KConfigLcdNumberOfDisplayModes) |
|
1438 |
return KErrArgument; |
|
1439 |
||
1440 |
NKern::FMWait(&iLock); |
|
1441 |
aInfo = iVideoInfo; |
|
1442 |
NKern::FMSignal(&iLock); |
|
1443 |
||
1444 |
if (aMode != aInfo.iDisplayMode) |
|
1445 |
{ |
|
1446 |
aInfo.iOffsetToFirstPixel=Lcd_Mode_Config[aMode].iOffsetToFirstVideoBuffer; |
|
1447 |
aInfo.iIsPalettized = Lcd_Mode_Config[aMode].iIsPalettized; |
|
1448 |
aInfo.iOffsetBetweenLines=Lcd_Mode_Config[aMode].iOffsetBetweenLines; |
|
1449 |
aInfo.iBitsPerPixel = Lcd_Mode_Config[aMode].iBitsPerPixel; |
|
1450 |
} |
|
1451 |
return KErrNone; |
|
1452 |
} |
|
1453 |
||
1454 |
/** |
|
1455 |
Set the display mode |
|
1456 |
||
1457 |
@param aMode the display mode to set |
|
1458 |
*/ |
|
1459 |
TInt DLcdPowerHandler::SetDisplayMode(TInt aMode) |
|
1460 |
{ |
|
1461 |
||
1462 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetDisplayMode = %d", aMode)); |
|
1463 |
||
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1464 |
Kern::Printf("SetDisplayMode = %d", aMode); |
0 | 1465 |
if (aMode < 0 || aMode >= KConfigLcdNumberOfDisplayModes) |
1466 |
return KErrArgument; |
|
1467 |
||
1468 |
NKern::FMWait(&iLock); |
|
1469 |
||
1470 |
// store the current mode |
|
1471 |
iVideoInfo.iDisplayMode = aMode; |
|
1472 |
iVideoInfo.iOffsetToFirstPixel = Lcd_Mode_Config[aMode].iOffsetToFirstVideoBuffer; |
|
1473 |
iVideoInfo.iIsPalettized = Lcd_Mode_Config[aMode].iIsPalettized; |
|
1474 |
iVideoInfo.iOffsetBetweenLines = Lcd_Mode_Config[aMode].iOffsetBetweenLines; |
|
1475 |
iVideoInfo.iBitsPerPixel = Lcd_Mode_Config[aMode].iBitsPerPixel; |
|
1476 |
||
1477 |
// store the current mode for secure screen |
|
1478 |
iSecureVideoInfo.iDisplayMode = aMode; |
|
1479 |
iSecureVideoInfo.iOffsetToFirstPixel = Lcd_Mode_Config[aMode].iOffsetToFirstVideoBuffer; |
|
1480 |
iSecureVideoInfo.iIsPalettized = Lcd_Mode_Config[aMode].iIsPalettized; |
|
1481 |
iSecureVideoInfo.iOffsetBetweenLines = Lcd_Mode_Config[aMode].iOffsetBetweenLines; |
|
1482 |
iSecureVideoInfo.iBitsPerPixel = Lcd_Mode_Config[aMode].iBitsPerPixel; |
|
1483 |
||
1484 |
// TO DO: (mandatory) |
|
1485 |
// set bits per pixel on hardware |
|
1486 |
// May need to reconfigure DMA if video buffer size and location have changed |
|
1487 |
// |
|
1488 |
NKern::FMSignal(&iLock); |
|
1489 |
||
1490 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetDisplayMode mode = %d, otfp = %d, palettized = %d, bpp = %d, obl = %d", |
|
1491 |
aMode, iVideoInfo.iOffsetToFirstPixel, iVideoInfo.iIsPalettized, iVideoInfo.iBitsPerPixel, iVideoInfo.iOffsetBetweenLines)); |
|
76
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1492 |
Kern::Printf("SetDisplayMode mode = %d, otfp = %d, palettized = %d, bpp = %d, obl = %d", |
0d34a4aa948d
change display device from monitor to a LCD, SPI driver not ready yet, use GPIO to realize the LCD's initialization for this version
will.long
parents:
34
diff
changeset
|
1493 |
aMode, iVideoInfo.iOffsetToFirstPixel, iVideoInfo.iIsPalettized, iVideoInfo.iBitsPerPixel, iVideoInfo.iOffsetBetweenLines); |
0 | 1494 |
return KErrNone; |
1495 |
} |
|
1496 |
||
1497 |
/** |
|
1498 |
Fill the video memory with an initial pattern or image |
|
1499 |
This will be displayed on boot-up |
|
1500 |
*/ |
|
1501 |
void DLcdPowerHandler::SplashScreen() |
|
1502 |
{ |
|
1503 |
// TO DO: (optional) |
|
1504 |
// replace the example code below to display a different spash screen |
|
1505 |
||
1506 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("Splash SCreen +")); |
|
1507 |
TUint* pV=(TUint*)(iVideoInfo.iVideoAddress + iVideoInfo.iOffsetToFirstPixel); |
|
1508 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("Splash SCreen FB @ %x",pV)); |
|
1509 |
||
1510 |
//Fill the framebuffer with bars |
|
1511 |
||
1512 |
for (TInt y = 0; y<KConfigLcdHeight; ++y) |
|
1513 |
{ |
|
1514 |
for(TInt x = 0; x<KConfigLcdHeight; ++x) |
|
1515 |
{ |
|
1516 |
TUint8 r = 0x00; |
|
1517 |
TUint8 g = 0x00; |
|
1518 |
TUint8 b = 0x00; |
|
1519 |
TUint16 rgb = ((r&0xf8) << 8) | ((g&0xfc) << 3) | ((b&0xf8) >> 3); |
|
1520 |
||
1521 |
TUint16* px = reinterpret_cast<TUint16*>(pV) + y*KConfigLcdWidth + x; |
|
1522 |
*px = rgb; |
|
1523 |
} |
|
1524 |
} |
|
1525 |
||
1526 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("Splash SCreen -")); |
|
1527 |
} |
|
1528 |
||
1529 |
||
1530 |
/** |
|
1531 |
Get the size of the pallete |
|
1532 |
||
1533 |
@return the number of pallete entries |
|
1534 |
*/ |
|
1535 |
TInt DLcdPowerHandler::NumberOfPaletteEntries() //only call when holding mutex |
|
1536 |
{ |
|
1537 |
// TO DO: (mandatory) |
|
1538 |
// Calculate the number of Palette entries - this is normally |
|
1539 |
// calculated from the bits per-pixel. |
|
1540 |
// This is only example code... you may need to modify it for your hardware |
|
1541 |
// |
|
1542 |
TInt num = iVideoInfo.iIsPalettized ? 1<<iVideoInfo.iBitsPerPixel : 0; |
|
1543 |
||
1544 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("NumberOfPaletteEntries = %d", num)); |
|
1545 |
||
1546 |
return num; |
|
1547 |
} |
|
1548 |
||
1549 |
||
1550 |
/** |
|
1551 |
Retrieve the palette entry at a particular offset |
|
1552 |
||
1553 |
@param aEntry the palette index |
|
1554 |
@param aColor a caller-supplied pointer to a location where the returned RGB color is to be stored |
|
1555 |
@return KErrNone if successful |
|
1556 |
KErrNotSupported if the current vide mode does not support a palette |
|
1557 |
KErrArgument if aEntry is out of range |
|
1558 |
*/ |
|
1559 |
TInt DLcdPowerHandler::GetPaletteEntry(TInt aEntry, TInt* aColor) |
|
1560 |
{ |
|
1561 |
NKern::FMWait(&iLock); |
|
1562 |
if (!iVideoInfo.iIsPalettized) |
|
1563 |
{ |
|
1564 |
NKern::FMSignal(&iLock); |
|
1565 |
return KErrNotSupported; |
|
1566 |
} |
|
1567 |
||
1568 |
if ((aEntry < 0) || (aEntry >= NumberOfPaletteEntries())) |
|
1569 |
{ |
|
1570 |
NKern::FMSignal(&iLock); |
|
1571 |
return KErrArgument; |
|
1572 |
} |
|
1573 |
||
1574 |
// TO DO: (mandatory) |
|
1575 |
// read the RGB value of the palette entry into aColor |
|
1576 |
// NOTE: the palette could either be a buffer allocated in system RAM (usually contiguous to Video buffer) |
|
1577 |
// or could be offered as part of the hardware block that implemenst the lcd control |
|
1578 |
// |
|
1579 |
NKern::FMSignal(&iLock); |
|
1580 |
||
1581 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("GetPaletteEntry %d color 0x%x", aEntry, aColor)); |
|
1582 |
||
1583 |
return KErrNone; |
|
1584 |
} |
|
1585 |
||
1586 |
/** |
|
1587 |
Set the palette entry at a particular offset |
|
1588 |
||
1589 |
@param aEntry the palette index |
|
1590 |
@param aColor the RGB color to store |
|
1591 |
@return KErrNone if successful |
|
1592 |
KErrNotSupported if the current vide mode does not support a palette |
|
1593 |
KErrArgument if aEntry is out of range |
|
1594 |
*/ |
|
1595 |
TInt DLcdPowerHandler::SetPaletteEntry(TInt aEntry, TInt aColor) |
|
1596 |
{ |
|
1597 |
||
1598 |
NKern::FMWait(&iLock); |
|
1599 |
if (!iVideoInfo.iIsPalettized) |
|
1600 |
{ |
|
1601 |
NKern::FMSignal(&iLock); |
|
1602 |
return KErrNotSupported; |
|
1603 |
} |
|
1604 |
||
1605 |
if ((aEntry < 0) || (aEntry >= NumberOfPaletteEntries())) //check entry in range |
|
1606 |
{ |
|
1607 |
NKern::FMSignal(&iLock); |
|
1608 |
return KErrArgument; |
|
1609 |
} |
|
1610 |
||
1611 |
// TO DO: (mandatory) |
|
1612 |
// update the palette entry for the secure and non-secure screen |
|
1613 |
// NOTE: the palette could either be a buffer allocated in system RAM (usually contiguous to Video buffer) |
|
1614 |
// or could be offered as part of the hardware block that implemenst the lcd control |
|
1615 |
// |
|
1616 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetPaletteEntry %d to 0x%x", aEntry, aColor )); |
|
1617 |
||
1618 |
return KErrNone; |
|
1619 |
} |
|
1620 |
||
1621 |
/** |
|
1622 |
a HAL entry handling function for HAL group attribute EHalGroupDisplay |
|
1623 |
||
1624 |
@param a1 an arbitrary argument |
|
1625 |
@param a2 an arbitrary argument |
|
1626 |
@return KErrNone if successful |
|
1627 |
*/ |
|
1628 |
TInt DLcdPowerHandler::HalFunction(TInt aFunction, TAny* a1, TAny* a2) |
|
1629 |
{ |
|
1630 |
TInt r=KErrNone; |
|
1631 |
switch(aFunction) |
|
1632 |
{ |
|
1633 |
case EDisplayHalScreenInfo: |
|
1634 |
{ |
|
1635 |
TPckgBuf<TScreenInfoV01> vPckg; |
|
1636 |
ScreenInfo(vPckg()); |
|
1637 |
Kern::InfoCopy(*(TDes8*)a1,vPckg); |
|
1638 |
break; |
|
1639 |
} |
|
1640 |
||
1641 |
case EDisplayHalWsRegisterSwitchOnScreenHandling: |
|
1642 |
iWsSwitchOnScreen=(TBool)a1; |
|
1643 |
break; |
|
1644 |
||
1645 |
case EDisplayHalWsSwitchOnScreen: |
|
1646 |
WsSwitchOnScreen(); |
|
1647 |
break; |
|
1648 |
||
1649 |
case EDisplayHalMaxDisplayContrast: |
|
1650 |
{ |
|
1651 |
TInt mc=KConfigLcdMaxDisplayContrast; |
|
1652 |
kumemput32(a1,&mc,sizeof(mc)); |
|
1653 |
break; |
|
1654 |
} |
|
1655 |
case EDisplayHalSetDisplayContrast: |
|
1656 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("EDisplayHalSetDisplayContrast")); |
|
1657 |
if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetDisplayContrast"))) |
|
1658 |
return KErrPermissionDenied; |
|
1659 |
r=SetContrast(TInt(a1)); |
|
1660 |
break; |
|
1661 |
||
1662 |
case EDisplayHalDisplayContrast: |
|
1663 |
kumemput32(a1,&iContrast,sizeof(iContrast)); |
|
1664 |
break; |
|
1665 |
||
1666 |
case EDisplayHalMaxDisplayBrightness: |
|
1667 |
{ |
|
1668 |
TInt mc=KConfigLcdMaxDisplayBrightness; |
|
1669 |
kumemput32(a1,&mc,sizeof(mc)); |
|
1670 |
break; |
|
1671 |
} |
|
1672 |
||
1673 |
case EDisplayHalSetDisplayBrightness: |
|
1674 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("EDisplayHalSetDisplayBrightness")); |
|
1675 |
if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetDisplayBrightness"))) |
|
1676 |
return KErrPermissionDenied; |
|
1677 |
r=SetBrightness(TInt(a1)); |
|
1678 |
break; |
|
1679 |
||
1680 |
case EDisplayHalDisplayBrightness: |
|
1681 |
kumemput32(a1,&iBrightness,sizeof(iBrightness)); |
|
1682 |
break; |
|
1683 |
||
1684 |
case EDisplayHalSetBacklightOn: |
|
1685 |
if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetBacklightOn"))) |
|
1686 |
return KErrPermissionDenied; |
|
1687 |
if (Kern::MachinePowerStatus()<ELow) |
|
1688 |
r=KErrBadPower; |
|
1689 |
else |
|
1690 |
SetBacklightState(TBool(a1)); |
|
1691 |
break; |
|
1692 |
||
1693 |
case EDisplayHalBacklightOn: |
|
1694 |
kumemput32(a1,&iBacklightOn,sizeof(TInt)); |
|
1695 |
break; |
|
1696 |
||
1697 |
case EDisplayHalModeCount: |
|
1698 |
{ |
|
1699 |
TInt ndm = KConfigLcdNumberOfDisplayModes; |
|
1700 |
kumemput32(a1, &ndm, sizeof(ndm)); |
|
1701 |
break; |
|
1702 |
} |
|
1703 |
||
1704 |
case EDisplayHalSetMode: |
|
1705 |
if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetMode"))) |
|
1706 |
return KErrPermissionDenied; |
|
1707 |
r = SetDisplayMode((TInt)a1); |
|
1708 |
break; |
|
1709 |
||
1710 |
case EDisplayHalMode: |
|
1711 |
kumemput32(a1, &iVideoInfo.iDisplayMode, sizeof(iVideoInfo.iDisplayMode)); |
|
1712 |
break; |
|
1713 |
||
1714 |
case EDisplayHalSetPaletteEntry: |
|
1715 |
if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetPaletteEntry"))) |
|
1716 |
return KErrPermissionDenied; |
|
1717 |
r = SetPaletteEntry((TInt)a1, (TInt)a2); |
|
1718 |
break; |
|
1719 |
||
1720 |
case EDisplayHalPaletteEntry: |
|
1721 |
{ |
|
1722 |
TInt entry; |
|
1723 |
kumemget32(&entry, a1, sizeof(TInt)); |
|
1724 |
TInt x; |
|
1725 |
r = GetPaletteEntry(entry, &x); |
|
1726 |
if (r == KErrNone) |
|
1727 |
kumemput32(a2, &x, sizeof(x)); |
|
1728 |
break; |
|
1729 |
} |
|
1730 |
||
1731 |
case EDisplayHalSetState: |
|
1732 |
{ |
|
1733 |
if(!Kern::CurrentThreadHasCapability(ECapabilityPowerMgmt,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetState"))) |
|
1734 |
return KErrPermissionDenied; |
|
1735 |
if ((TBool)a1) |
|
1736 |
{ |
|
1737 |
WsSwitchOnScreen(); |
|
1738 |
} |
|
1739 |
else |
|
1740 |
{ |
|
1741 |
WsSwitchOffScreen(); |
|
1742 |
} |
|
1743 |
break; |
|
1744 |
} |
|
1745 |
||
1746 |
case EDisplayHalState: |
|
1747 |
kumemput32(a1, &iDisplayOn, sizeof(TBool)); |
|
1748 |
break; |
|
1749 |
||
1750 |
case EDisplayHalColors: |
|
1751 |
{ |
|
1752 |
TInt mdc = KConfigLcdMaxDisplayColors; |
|
1753 |
kumemput32(a1, &mdc, sizeof(mdc)); |
|
1754 |
break; |
|
1755 |
} |
|
1756 |
||
1757 |
case EDisplayHalCurrentModeInfo: |
|
1758 |
{ |
|
1759 |
TPckgBuf<TVideoInfoV01> vPckg; |
|
1760 |
r = GetCurrentDisplayModeInfo(vPckg(), (TBool)a2); |
|
1761 |
if (KErrNone == r) |
|
1762 |
Kern::InfoCopy(*(TDes8*)a1,vPckg); |
|
1763 |
} |
|
1764 |
break; |
|
1765 |
||
1766 |
case EDisplayHalSpecifiedModeInfo: |
|
1767 |
{ |
|
1768 |
TPckgBuf<TVideoInfoV01> vPckg; |
|
1769 |
TInt mode; |
|
1770 |
kumemget32(&mode, a1, sizeof(mode)); |
|
1771 |
r = GetSpecifiedDisplayModeInfo(mode, vPckg()); |
|
1772 |
if (KErrNone == r) |
|
1773 |
Kern::InfoCopy(*(TDes8*)a2,vPckg); |
|
1774 |
} |
|
1775 |
break; |
|
1776 |
||
1777 |
case EDisplayHalSecure: |
|
1778 |
kumemput32(a1, &iSecureDisplay, sizeof(TBool)); |
|
1779 |
break; |
|
1780 |
||
1781 |
case EDisplayHalSetSecure: |
|
1782 |
{ |
|
1783 |
if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetSecure"))) |
|
1784 |
return KErrPermissionDenied; |
|
1785 |
SwitchDisplay((TBool)a1); |
|
1786 |
} |
|
1787 |
break; |
|
1788 |
||
1789 |
default: |
|
1790 |
r=KErrNotSupported; |
|
1791 |
break; |
|
1792 |
} |
|
1793 |
return r; |
|
1794 |
} |
|
1795 |
||
1796 |
||
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1797 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1798 |
DLcdPowerHandler* DLcdPowerHandler::pLcd = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1799 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1800 |
void DLcdPowerHandler::ChangeFrameBufferAddress(TUint32 aFbAddr) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1801 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1802 |
//TODO: this is guess work |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1803 |
//find out the correct sequence to change LCD DMA address |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1804 |
// |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1805 |
const TInt8 DISPC_GODIGITAL_BITSHIFT = 6; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1806 |
const TInt8 DISPC_GOLCD_BITSHIFT = 5; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1807 |
const TUint32 goFlags = (1 << DISPC_GODIGITAL_BITSHIFT) | (1 << DISPC_GOLCD_BITSHIFT); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1808 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1809 |
const TUint32 ctl = GET_REGISTER(DISPC_CONTROL); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1810 |
SET_REGISTER(DISPC_GFX_BA1, aFbAddr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1811 |
SET_REGISTER(DISPC_CONTROL, ctl | goFlags); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1812 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1813 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1814 |
#include <display.h> |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1815 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1816 |
class DDisplayPddBeagle : public DDisplayPdd |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1817 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1818 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1819 |
DDisplayPddBeagle(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1820 |
~DDisplayPddBeagle(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1821 |
virtual TInt SetLegacyMode(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1822 |
virtual TInt SetGceMode(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1823 |
virtual TInt SetRotation(RDisplayChannel::TDisplayRotation aRotation); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1824 |
virtual TInt PostUserBuffer(TBufferNode* aNode); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1825 |
virtual TInt PostCompositionBuffer(TBufferNode* aNode); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1826 |
virtual TInt PostLegacyBuffer(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1827 |
virtual TInt CloseMsg(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1828 |
virtual TInt CreateChannelSetup(TInt aUnit); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1829 |
virtual TBool PostPending(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1830 |
virtual TDfcQue* DfcQ(TInt aUnit); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1831 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1832 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1833 |
static void VSyncDfcFn(TAny* aChannel); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1834 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1835 |
private: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1836 |
TDfcQue* iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1837 |
TVideoInfoV01 iScreenInfo; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1838 |
TBufferNode* iPendingBuffer; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1839 |
TBufferNode* iActiveBuffer; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1840 |
DChunk* iChunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1841 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1842 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1843 |
TDfc iVSyncDfc; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1844 |
}; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1845 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1846 |
class DDisplayPddFactory : public DPhysicalDevice |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1847 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1848 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1849 |
DDisplayPddFactory(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1850 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1851 |
virtual TInt Install(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1852 |
virtual void GetCaps(TDes8& aDes) const; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1853 |
virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1854 |
virtual TInt Validate(TInt aDeviceType, const TDesC8* anInfo, const TVersion& aVer); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1855 |
}; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1856 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1857 |
const TInt KVSyncDfcPriority = 7 ; //priority of DFC within the queue (0 to 7, where 7 is highest) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1858 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1859 |
DDisplayPddBeagle::DDisplayPddBeagle(): |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1860 |
iPendingBuffer(NULL), |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1861 |
iActiveBuffer(NULL), |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1862 |
iChunk(NULL), |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1863 |
iVSyncDfc(&VSyncDfcFn, this, KVSyncDfcPriority) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1864 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1865 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::DDisplayPddBeagle")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1866 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1867 |
iPostFlag = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1868 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1869 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1870 |
DDisplayPddBeagle::~DDisplayPddBeagle() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1871 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1872 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::~DDisplayPddBeagle()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1873 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1874 |
//The DFC Queue is owned by DLcdPowerHandler so we shouldn't call Destroy() at this point. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1875 |
if (iDfcQ) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1876 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1877 |
iDfcQ=NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1878 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1879 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1880 |
DChunk* chunk = (DChunk*) __e32_atomic_swp_ord_ptr(&iChunk, 0); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1881 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1882 |
if(chunk) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1883 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1884 |
Kern::ChunkClose(chunk); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1885 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1886 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1887 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1888 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1889 |
TInt DDisplayPddBeagle::SetLegacyMode() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1890 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1891 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetLegacyMode()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1892 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1893 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1894 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1895 |
TInt DDisplayPddBeagle::SetGceMode() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1896 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1897 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetGceMode()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1898 |
PostCompositionBuffer(&iLdd->iCompositionBuffer[0]); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1899 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1900 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1901 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1902 |
TInt DDisplayPddBeagle::SetRotation(RDisplayChannel::TDisplayRotation aDegOfRot) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1903 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1904 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetRotation()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1905 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1906 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1907 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1908 |
TInt DDisplayPddBeagle::PostUserBuffer(TBufferNode* aNode) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1909 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1910 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostUserBuffer : aNode->iAddress = %08x\n", aNode->iAddress)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1911 |
if(iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1912 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1913 |
iPendingBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1914 |
if (!(iPendingBuffer->iType == EBufferTypeUser) ) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1915 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1916 |
iPendingBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1917 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1918 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1919 |
aNode->iState = EBufferPending; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1920 |
iPendingBuffer = aNode; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1921 |
iPostFlag = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1922 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1923 |
// Activate the posted buffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1924 |
TUint32 physicalAddress = Epoc::LinearToPhysical( aNode->iAddress ); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1925 |
DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(physicalAddress); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1926 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1927 |
/* Queue a DFC to complete the request*/ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1928 |
iVSyncDfc.Enque(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1929 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1930 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1931 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1932 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1933 |
TInt DDisplayPddBeagle::PostCompositionBuffer(TBufferNode* aNode) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1934 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1935 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostCompositionBuffer : aNode->iAddress = %08x\n", aNode->iAddress)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1936 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1937 |
if(iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1938 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1939 |
iPendingBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1940 |
if (iPendingBuffer->iType == EBufferTypeUser) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1941 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1942 |
RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrCancel); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1943 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1944 |
else |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1945 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1946 |
iPendingBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1947 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1948 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1949 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1950 |
aNode->iState = EBufferPending; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1951 |
aNode->iFree = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1952 |
iPendingBuffer = aNode; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1953 |
iPostFlag = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1954 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1955 |
// Activate the posted buffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1956 |
TUint32 physicalAddress = Epoc::LinearToPhysical( aNode->iAddress ); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1957 |
DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(physicalAddress); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1958 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1959 |
/* Queue a DFC to complete the request*/ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1960 |
iVSyncDfc.Enque(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1961 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1962 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1963 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1964 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1965 |
TInt DDisplayPddBeagle::PostLegacyBuffer() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1966 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1967 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostLegacyBuffer()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1968 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1969 |
if(iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1970 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1971 |
iPendingBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1972 |
if (iPendingBuffer->iType == EBufferTypeUser) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1973 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1974 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1975 |
RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrCancel); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1976 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1977 |
else |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1978 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1979 |
iPendingBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1980 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1981 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1982 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1983 |
iLdd->iLegacyBuffer[0].iState = EBufferPending; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1984 |
iLdd->iLegacyBuffer[0].iFree = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1985 |
iPendingBuffer = &iLdd->iLegacyBuffer[0]; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1986 |
iPostFlag = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1987 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1988 |
// Activate the posted buffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1989 |
DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(DLcdPowerHandler::pLcd->ivRamPhys); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1990 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1991 |
/* Queue a DFC to complete the request*/ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1992 |
iVSyncDfc.Enque(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1993 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1994 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1995 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1996 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1997 |
TInt DDisplayPddBeagle::CloseMsg() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1998 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
1999 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CloseMsg()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2000 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2001 |
iPendingBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2002 |
iActiveBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2003 |
iVSyncDfc.Cancel(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2004 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2005 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2006 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2007 |
TInt DDisplayPddBeagle::CreateChannelSetup(TInt aUnit) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2008 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2009 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CreateChannelSetup()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2010 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2011 |
iScreenInfo = DLcdPowerHandler::pLcd->iVideoInfo; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2012 |
iLdd->iUnit = aUnit; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2013 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2014 |
iLdd->iDisplayInfo.iAvailableRotations = RDisplayChannel::ERotationNormal; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2015 |
iLdd->iDisplayInfo.iNormal.iOffsetBetweenLines = iScreenInfo.iOffsetBetweenLines; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2016 |
iLdd->iDisplayInfo.iNormal.iHeight = iScreenInfo.iSizeInPixels.iHeight; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2017 |
iLdd->iDisplayInfo.iNormal.iWidth = iScreenInfo.iSizeInPixels.iWidth; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2018 |
iLdd->iDisplayInfo.iNumCompositionBuffers = KDisplayCBMax; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2019 |
iLdd->iDisplayInfo.iBitsPerPixel = iScreenInfo.iBitsPerPixel; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2020 |
iLdd->iDisplayInfo.iRefreshRateHz = 60; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2021 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2022 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2023 |
switch (iScreenInfo.iBitsPerPixel) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2024 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2025 |
case 16: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2026 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatRGB_565; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2027 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2028 |
case 24: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2029 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatRGB_888; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2030 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2031 |
case 32: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2032 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatARGB_8888; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2033 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2034 |
default: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2035 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatUnknown; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2036 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2037 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2038 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2039 |
iLdd->iCurrentRotation = RDisplayChannel::ERotationNormal; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2040 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2041 |
// Open shared chunk to the composition framebuffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2042 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2043 |
DChunk* chunk = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2044 |
TLinAddr chunkKernelAddr = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2045 |
TUint32 chunkMapAttr = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2046 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2047 |
// round to twice the page size |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2048 |
TUint round = 2*Kern::RoundToPageSize(DLcdPowerHandler::pLcd->iSize); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2049 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2050 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CreateChannelSetup DLcdPowerHandler::pLcd->iSize = %d\n", DLcdPowerHandler::pLcd->iSize)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2051 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2052 |
TChunkCreateInfo info; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2053 |
info.iType = TChunkCreateInfo::ESharedKernelMultiple; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2054 |
info.iMaxSize = round; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2055 |
info.iMapAttr = EMapAttrFullyBlocking; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2056 |
info.iOwnsMemory = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2057 |
info.iDestroyedDfc = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2058 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2059 |
TInt r = Kern::ChunkCreate(info, chunk, chunkKernelAddr, chunkMapAttr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2060 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2061 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("CreateChannelSetup:ChunkCreate called for composition chunk. Set iChunkKernelAddr = %08x\n", chunkKernelAddr)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2062 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2063 |
if( r == KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2064 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2065 |
// map our chunk |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2066 |
r = Kern::ChunkCommitPhysical(chunk, 0,round , DLcdPowerHandler::pLcd->iCompositionPhysical); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2067 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Mapping chunk %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2068 |
if(r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2069 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2070 |
Kern::ChunkClose(chunk); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2071 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2072 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2073 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2074 |
if ( r!= KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2075 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2076 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2077 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2078 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2079 |
iChunk = chunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2080 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2081 |
// init CB 0 |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2082 |
iLdd->iCompositionBuffer[0].iType = EBufferTypeComposition; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2083 |
iLdd->iCompositionBuffer[0].iBufferId = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2084 |
iLdd->iCompositionBuffer[0].iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2085 |
iLdd->iCompositionBuffer[0].iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2086 |
iLdd->iCompositionBuffer[0].iAddress = chunkKernelAddr; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2087 |
iLdd->iCompositionBuffer[0].iPhysicalAddress = Epoc::LinearToPhysical(chunkKernelAddr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2088 |
iLdd->iCompositionBuffer[0].iChunk = chunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2089 |
iLdd->iCompositionBuffer[0].iHandle = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2090 |
iLdd->iCompositionBuffer[0].iOffset = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2091 |
iLdd->iCompositionBuffer[0].iSize = DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2092 |
iLdd->iCompositionBuffer[0].iPendingRequest = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2093 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2094 |
// init CB 1 |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2095 |
iLdd->iCompositionBuffer[1].iType = EBufferTypeComposition; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2096 |
iLdd->iCompositionBuffer[1].iBufferId = 1; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2097 |
iLdd->iCompositionBuffer[1].iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2098 |
iLdd->iCompositionBuffer[1].iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2099 |
iLdd->iCompositionBuffer[1].iAddress = chunkKernelAddr + DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2100 |
iLdd->iCompositionBuffer[1].iPhysicalAddress = Epoc::LinearToPhysical(chunkKernelAddr + DLcdPowerHandler::pLcd->iSize); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2101 |
iLdd->iCompositionBuffer[1].iChunk = chunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2102 |
iLdd->iCompositionBuffer[1].iHandle = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2103 |
iLdd->iCompositionBuffer[1].iOffset = DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2104 |
iLdd->iCompositionBuffer[1].iSize = DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2105 |
iLdd->iCompositionBuffer[1].iPendingRequest = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2106 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2107 |
iLdd->iCompositionBuffIdx = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2108 |
//Use the same DFC queue created by the DLcdPowerHandler so all hardware accesses are executed under the same DFC thread. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2109 |
iDfcQ= DLcdPowerHandler::pLcd->iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2110 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2111 |
// Set the Post DFC. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2112 |
iVSyncDfc.SetDfcQ(iDfcQ); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2113 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2114 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2115 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2116 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2117 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2118 |
TBool DDisplayPddBeagle::PostPending() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2119 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2120 |
return (iPendingBuffer != NULL); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2121 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2122 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2123 |
TDfcQue * DDisplayPddBeagle::DfcQ(TInt aUnit) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2124 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2125 |
return iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2126 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2127 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2128 |
void DDisplayPddBeagle::VSyncDfcFn(TAny* aChannel) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2129 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2130 |
DDisplayPddBeagle * channel =(DDisplayPddBeagle*)aChannel; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2131 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2132 |
if (channel->iPostFlag) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2133 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2134 |
channel->iPostFlag = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2135 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2136 |
if (channel->iActiveBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2137 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2138 |
//When a User buffer is registered its iFree member becomes EFalse and Deregister sets it |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2139 |
//back to ETrue. Composition and Legacy buffers are not free when they are in the pending or |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2140 |
//active state. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2141 |
if (channel->iActiveBuffer->iType == EBufferTypeUser) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2142 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2143 |
channel->RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrNone); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2144 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2145 |
else |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2146 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2147 |
channel->iActiveBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2148 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2149 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2150 |
channel->iActiveBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2151 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2152 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2153 |
//If no buffer was available during a call to GetCompositionBuffer the active buffer has |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2154 |
//been returned as the next available one, so we must set the buffer to the proper state before we |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2155 |
//send the notification. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2156 |
TInt pendingIndex = channel->iLdd->iPendingIndex[RDisplayChannel::EReqGetCompositionBuffer]; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2157 |
if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2158 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2159 |
if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq->IsReady()) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2160 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2161 |
channel->iActiveBuffer->iState = EBufferCompose; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2162 |
channel->RequestComplete(RDisplayChannel::EReqGetCompositionBuffer,KErrNone); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2163 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2164 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2165 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2166 |
channel->iActiveBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2167 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2168 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2169 |
if (channel->iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2170 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2171 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::VSyncDfcFn moving pending buffer at address %08x to the active state\n", channel->iPendingBuffer->iAddress)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2172 |
channel->iActiveBuffer = channel->iPendingBuffer; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2173 |
channel->iActiveBuffer->iState = EBufferActive; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2174 |
channel->iPendingBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2175 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2176 |
channel->RequestComplete(RDisplayChannel::EReqWaitForPost, KErrNone); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2177 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2178 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2179 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2180 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2181 |
DDisplayPddFactory::DDisplayPddFactory() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2182 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2183 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::DDisplayPddFactory()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2184 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2185 |
iVersion = TVersion(KDisplayChMajorVersionNumber, |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2186 |
KDisplayChMinorVersionNumber, |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2187 |
KDisplayChBuildVersionNumber); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2188 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2189 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2190 |
TInt DDisplayPddFactory::Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2191 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2192 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Create()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2193 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2194 |
DDisplayPddBeagle *device= new DDisplayPddBeagle() ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2195 |
aChannel=device; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2196 |
if (!device) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2197 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2198 |
return KErrNoMemory; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2199 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2200 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2201 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2202 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2203 |
TInt DDisplayPddFactory::Install() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2204 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2205 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Install()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2206 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2207 |
TBuf<32> name(RDisplayChannel::Name()); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2208 |
_LIT(KPddExtension,".pdd"); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2209 |
name.Append(KPddExtension); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2210 |
return SetName(&name); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2211 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2212 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2213 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2214 |
void DDisplayPddFactory::GetCaps(TDes8& /*aDes*/) const |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2215 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2216 |
//Not supported |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2217 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2218 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2219 |
TInt DDisplayPddFactory::Validate(TInt aUnit, const TDesC8* /*anInfo*/, const TVersion& aVer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2220 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2221 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Validate()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2222 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2223 |
if (!Kern::QueryVersionSupported(iVersion,aVer)) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2224 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2225 |
return KErrNotSupported; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2226 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2227 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2228 |
if (aUnit != 0) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2229 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2230 |
return KErrNotSupported; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2231 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2232 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2233 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2234 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2235 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2236 |
#endif //ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2237 |
|
0 | 2238 |
DECLARE_STANDARD_EXTENSION() |
2239 |
{ |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2240 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Creating DLcdPowerHandler")); |
0 | 2241 |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2242 |
TInt r = KErrNoMemory; |
0 | 2243 |
DLcdPowerHandler* pH=new DLcdPowerHandler; |
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2244 |
if (!pH) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2245 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2246 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2247 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2248 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2249 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2250 |
r = pH->Create(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2251 |
if (r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2252 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2253 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2254 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2255 |
} |
0 | 2256 |
|
34
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2257 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2258 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Creating DDisplayPddFactory")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2259 |
r = KErrNoMemory; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2260 |
DDisplayPddFactory * device = new DDisplayPddFactory; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2261 |
if (!device) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2262 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2263 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2264 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2265 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2266 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2267 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Installing DDisplayPddFactory")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2268 |
r = Kern::InstallPhysicalDevice(device); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2269 |
if (r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2270 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2271 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to install DDisplayPddFactory %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2272 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2273 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
25
diff
changeset
|
2274 |
|
0 | 2275 |
return r; |
2276 |
} |
|
2277 |