sGUI  V1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
lcd_conf_template.h
Go to the documentation of this file.
1 #ifndef __LCD_CONF_H__
2 #define __LCD_CONF_H__
3 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif /* __cplusplus */
75 
76 #define TFT320x240
77 /* #define TFT800x480 */
78 /* #define TFT640x480 */
79 /* #define TFTCUSTOM */
80 
81 #define TFT_FPS 50ULL
82 
83 #ifdef TFTCUSTOM
84 #define TFT_WIDTH 0ULL
85 #define TFT_HSYNC_BACK_PORCH 0ULL
86 #define TFT_HSYNC_FRONT_PORCH 0ULL
87 #define TFT_HSYNC_PULSE 0ULL
88 
89 #define TFT_HEIGHT 0ULL
90 #define TFT_VSYNC_BACK_PORCH 0ULL
91 #define TFT_VSYNC_FRONT_PORCH 0ULL
92 #define TFT_VSYNC_PULSE 0ULL
93 #endif
94 
95 #ifdef TFT320x240
96 #define TFT_WIDTH 320ULL
97 #define TFT_HSYNC_BACK_PORCH 40ULL
98 #define TFT_HSYNC_FRONT_PORCH 20ULL
99 #define TFT_HSYNC_PULSE 28ULL
100 
101 #define TFT_HEIGHT 240ULL
102 #define TFT_VSYNC_BACK_PORCH 17ULL
103 #define TFT_VSYNC_FRONT_PORCH 4ULL
104 #define TFT_VSYNC_PULSE 3ULL
105 #endif
106 
107 #ifdef TFT800x480
108 #define TFT_WIDTH 800ULL
109 #define TFT_HSYNC_BACK_PORCH 30LL
110 #define TFT_HSYNC_FRONT_PORCH 0ULL
111 #define TFT_HSYNC_PULSE 0ULL
112 
113 #define TFT_HEIGHT 480ULL
114 #define TFT_VSYNC_BACK_PORCH 10ULL
115 #define TFT_VSYNC_FRONT_PORCH 0ULL
116 #define TFT_VSYNC_PULSE 0ULL
117 #endif
118 
119 #ifdef TFT640x480
120 
121 #define TFT_WIDTH 640ULL
122 #define TFT_HSYNC_BACK_PORCH 56ULL
123 #define TFT_HSYNC_FRONT_PORCH 8ULL
124 #define TFT_HSYNC_PULSE 96ULL
125 
126 #define TFT_HEIGHT 480ULL
127 #define TFT_VSYNC_BACK_PORCH 41ULL
128 #define TFT_VSYNC_FRONT_PORCH 2ULL
129 #define TFT_VSYNC_PULSE 2ULL
130 #endif
131 
132 #define TFT_HSYNC_PERIOD (TFT_HSYNC_PULSE + TFT_HSYNC_BACK_PORCH + \
133  TFT_WIDTH + TFT_HSYNC_FRONT_PORCH)
134 #define TFT_VSYNC_PERIOD (TFT_VSYNC_PULSE + TFT_VSYNC_BACK_PORCH + \
135  TFT_HEIGHT + TFT_VSYNC_FRONT_PORCH)
136 #define TFT_PCLK (TFT_HSYNC_PERIOD * TFT_VSYNC_PERIOD * \
137  TFT_FPS)
138 #define LCD_FPR ((TFT_PCLK * 1048576)/100000000)
139 
140 #define WR_HIGH_BYTE(x) (x >> 8)
141 #define WR_LOW_BYTE(x) (x & 0xFF)
142 
143 #define USE_16BIT_PMP
144 
149 #define LCD_HOR_RESOLUTION 320ULL
150 #define LCD_VER_RESOLUTION 240ULL
151 
156 #define LCD_HOR_PULSE_WIDTH 64ULL /* 64 */
157 #define LCD_HOR_BACK_PORCH 96ULL /* 96 */
158 #define LCD_HOR_FRONT_PORCH 48ULL /* 48 */
159 
164 #define LCD_VER_PULSE_WIDTH 2ULL /* 2 */
165 #define LCD_VER_BACK_PORCH 34ULL /* 34 */
166 #define LCD_VER_FRONT_PORCH 11ULL /* 11 */
167 
175 #define HT (LCD_HOR_RESOLUTION + LCD_HOR_PULSE_WIDTH + LCD_HOR_BACK_PORCH + LCD_HOR_FRONT_PORCH)
176 #define HPS (LCD_HOR_PULSE_WIDTH + LCD_HOR_BACK_PORCH)
177 
185 #define VT (LCD_VER_PULSE_WIDTH + LCD_VER_BACK_PORCH + LCD_VER_FRONT_PORCH + LCD_VER_RESOLUTION)
186 #define VSP (LCD_VER_PULSE_WIDTH + LCD_VER_BACK_PORCH)
187 
188 /* LCD screen and bitmap image array constants */
189 #define X_BYTES 40
190 #define Y_BYTES 30
191 #define SCRN_LEFT 0
192 #define SCRN_TOP 0
193 #define SCRN_RIGHT LCD_HOR_RESOLUTION-1
194 #define SCRN_BOTTOM LCD_VER_RESOLUTION-1
195 
196 #define CCW -1
197 #define CW 1
198 
199 #define DOTS_PER_CM_X 64
200 #define DOTS_PER_CM_Y 60
201 
202 #define INCR 1
203 #define DECR -1
204 #define PREDX 1
205 #define PREDY 0
206 
211 #define COEFF_PIXELS_MM 1.5
212 
213 #ifdef __cplusplus
214 }
215 #endif /* __cplusplus */
216 
225 #endif /* __LCD_CONF_H__ */