blob: bd03d03524f64aa51106afc267525ce32b6d12c7 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * MTCDEF.H
41 *
42 * Project:
43 * --------
44 * MAUI
45 *
46 * Description:
47 * ------------
48 * This file is intends for implementing custom commands for some customers
49 * which should not be released to other customers
50 *
51 * Author:
52 * -------
53 * -------
54 *
55 *============================================================================
56 * HISTORY
57 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
58 *------------------------------------------------------------------------------
59 * removed!
60 *
61 * removed!
62 * removed!
63 * removed!
64 *
65 * removed!
66 * removed!
67 * removed!
68 *
69 * removed!
70 * removed!
71 * removed!
72 *
73 * removed!
74 * removed!
75 * removed!
76 *
77 * removed!
78 * removed!
79 * removed!
80 *
81 *------------------------------------------------------------------------------
82 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
83 *============================================================================
84 ****************************************************************************/
85#ifdef __MTK_TARGET__ /* Only support ATS test on target , not support in simulator */
86#ifndef MTCDEF_H
87#define MTCDEF_H
88
89#include "lcd_sw_inc.h"
90#include "lcd_sw.h"
91
92/*===============================================================*/
93#define MTC_CMD_CODE 0xF0
94
95
96/******************************************************************************
97 * *
98 * Integrate RFWS library - ia_raw.h *
99 * *
100 ******************************************************************************/
101#define RGB565_REDMASK (0xf800)
102#define RGB565_REDSHIFT (11)
103#define RGB565_GREENMASK (0x07e0)
104#define RGB565_GREENSHIFT (5)
105#define RGB565_BLUEMASK (0x001f)
106#define RGB565_BLUESHIFT (0)
107
108#define RGB_PLANE_RED (1)
109#define RGB_PLANE_GREEN (2)
110#define RGB_PLANE_BLUE (3)
111
112
113/******************************************************************************
114 * *
115 * Integrate RFWS library - ia_simple_dpcm.h *
116 * *
117 ******************************************************************************/
118#define DPCM_MINIMAL_QUANTIZER (1)
119#define DPCM_MAXIMAL_QUANTIZER (7)
120
121#define DPCM_INITIAL_PREDICTION (128)
122
123
124typedef enum
125{
126 MTC_SCREEN_INFO_REQ_CMD = 0x00, /* Screen Info Request */
127 MTC_CAPTURE_REQ_CMD = 0x01, /* Screen Capture Request */
128 MTC_KEY_LOG_MASK_CMD = 0x07,
129 MTC_KEY_LOG_DATA_IND = 0x08,
130 MTC_PHONE_RESTART_REQ_CMD = 0x10, /* Phone Restart Request */
131 MTC_PHONE_FACTORY_RST_CMD = 0x11, /* Phone Factory Reset Request*/
132 MTC_PHONE_REPORT_REQ_CMD = 0x20, /* Phone Report request */
133 MTC_PHONE_STATE_REQ_CMD = 0x21, /* Phone status request*/
134 MTC_DATA_TRANSFER_SETUP_CMD = 0x22, /* Request to setup data transfer parameters*/
135 MTC_KEY_REPORT_EN_REQ_CMD = 0x30, /* Enable/Disable key press notification*/
136 MTC_KEY_EVENT_REQ_CMD = 0x33, /* Key Event notification or key press emulation */
137 MTC_FAST_KEY_EVENT_REQ_CMD = 0x35, /* Fast key event request cmd */
138 MTC_MEMORY_DUMP_REQ_CMD = 0x40, /* Memory Dump Request*/
139 MTC_BATTERY_LEVEL_REQ_CMD = 0x41, /* Battery Level Request*/
140 MTC_BACKLIGHT_REQ_CMD = 0x42, /* Backlight State Request*/
141 MTC_FLEX_DATA_REQ_CMD = 0x50,
142 MTC_ERROR_CMD = 0x7F,
143 MTC_CURRENT_CELL_REQ_CMD = 0x80 /*Current cell, codec and data transfer quality information*/
144}mtc_sub_cmd_type;
145
146typedef enum
147{
148 MTC_MAIN_LCD = 0,
149 MTC_SUB_LCD,
150 MTC_LCD_PADDING = 0x7F
151}mtc_scrn_id_type;
152
153
154typedef struct
155{
156 kal_uint8 sw_ver[45];
157 kal_uint8 hw_ver[16];
158 kal_uint8 sw_sub_ver;
159} mtcVersion_type;
160
161/*================================================================*/
162typedef __packed struct
163{
164 kal_uint8 cmd_code;
165 kal_uint8 sub_cmd;
166}mtc_req_hdr_type;
167
168typedef __packed struct
169{
170 mtc_req_hdr_type hdr;
171 mtc_scrn_id_type screen_id;
172}mtc_info_req_type;
173
174/*=================================================================*/
175typedef __packed struct
176{
177 mtc_req_hdr_type hdr;
178 mtc_scrn_id_type screen_id;
179 kal_uint16 left; /* Upper left X-Coord */
180 kal_uint16 top; /* Upper left Y-Coord */
181 kal_uint16 width; /* Width of the capture screen */
182 kal_uint16 height; /* Height of the capture screen */
183}mtc_capture_req_type;
184
185/*=================================================================*/
186
187typedef __packed struct
188{
189 kal_uint16 left; /* Upper left X-Coord */
190 kal_uint16 top; /* Upper left Y-Coord */
191 kal_uint16 width; /* Width of the area */
192 kal_uint16 height; /* Height of the area */
193} mtc_ats_capture_rect_type;
194
195
196typedef __packed struct
197{
198 kal_uint8 mask_type;
199 mtc_ats_capture_rect_type rect; /* masked area */
200}mtc_ats_capture_mask_req_type;
201
202#define MTC_ATS_NMASK_MAX (5)
203
204typedef __packed struct
205{
206 mtc_req_hdr_type hdr;
207 mtc_scrn_id_type screen_id;
208 mtc_ats_capture_rect_type base_area;
209 kal_uint8 refresh;
210 kal_uint8 data_type;
211 kal_uint8 pack_type;
212 kal_uint8 quantizer;
213 kal_uint8 threshold;
214 mtc_ats_capture_mask_req_type masks[MTC_ATS_NMASK_MAX];
215}mtc_ats_capture_req_type;
216
217typedef __packed struct
218{
219 mtc_req_hdr_type hdr;
220 kal_uint8 request_area;
221 kal_uint8 value;
222}mtc_ats_key_report_en_req_type;
223
224#if 1 /* LGE_L1_NUGUYU_20091119 */
225typedef __packed struct
226{
227 mtc_req_hdr_type hdr;
228 kal_uint32 log_mask;
229}mtc_ats_key_log_mask_req_type;
230#endif
231
232typedef __packed struct
233{
234 mtc_req_hdr_type hdr;
235 kal_uint32 address;
236 kal_uint32 reserved;
237 kal_uint8 size;
238}mtc_ats_memory_req_type;
239
240typedef __packed struct
241{
242 mtc_req_hdr_type hdr;
243}mtc_ats_battery_req_type;
244
245typedef __packed struct
246{
247 mtc_req_hdr_type hdr;
248 kal_uint8 request_area;
249}mtc_ats_backlight_req_type;
250
251typedef __packed struct
252{
253 mtc_req_hdr_type hdr;
254 kal_uint8 request_cell;
255}mtc_ats_cell_req_type;
256
257typedef __packed struct
258{
259 mtc_req_hdr_type hdr;
260 kal_uint16 packet_size;
261 kal_uint16 transfer_delay;
262}mtc_ats_transfer_setup_req_type;
263
264typedef __packed struct
265{
266 mtc_req_hdr_type hdr;
267 kal_uint8 KeyHoldType; /* Press or Depress */
268 kal_uint8 KeyCode; /* Virtual key Code */
269}mtc_key_event_req_type;
270
271typedef __packed struct
272{
273 mtc_req_hdr_type hdr;
274 kal_uint8 KeyCode; /* Virtual key Code */
275 kal_uint16 Delay; /* delay measured in 1\10 of a second */
276}mtc_fast_key_event_req_type;
277
278typedef __packed union
279{
280 mtc_info_req_type info;
281 mtc_capture_req_type capture;
282 mtc_ats_capture_req_type ats_capture;
283 mtc_ats_key_report_en_req_type ats_key_report_en;
284 mtc_ats_key_log_mask_req_type ats_key_log_mask;
285 mtc_ats_memory_req_type ats_dump;
286 mtc_ats_battery_req_type ats_battery;
287 mtc_ats_backlight_req_type ats_backlight;
288 mtc_ats_cell_req_type ats_cell_info;
289 mtc_ats_transfer_setup_req_type ats_setup;
290 mtc_key_event_req_type keyevent;
291 mtc_fast_key_event_req_type fastkeyevent;
292}mtc_req_type;
293
294typedef __packed union
295{
296 mtc_req_hdr_type hdr;
297 mtc_req_type mtc_req;
298}diag_mtc_req_type;
299
300/*==============================================================*/
301
302#define MTC_262K_CMASK_RED 0x0000FC00
303#define MTC_262K_CMASK_GREEN 0x000003F0
304#define MTC_262K_CMASK_BLUE 0xC000000F
305
306#define MTC_65K_CMASK_RED 0xF800
307#define MTC_65K_CMASK_GREEN 0x07E0
308#define MTC_65K_CMASK_BLUE 0x001F
309
310typedef enum
311{
312 MTC_BIT_UNDEF = 0,
313 MTC_BIT_MONO = 1,
314 MTC_BIT_4 = 2,
315 MTC_BIT_16 = 4,
316 MTC_BIT_256 = 8,
317 MTC_BIT_65K = 16,
318 MTC_BIT_262K = 18,
319 MTC_BIT_RGB24 = 24,
320 MTC_BIT_RGB_32 = 32,
321 MTC_BIT_PADDING = 0x7F
322}mtc_bits_pixel_type;
323
324typedef unsigned long mtc_pixel_18_type; /* 4 kal_uint8 */
325typedef unsigned short mtc_pixel_16_type; /* 2 kal_uint8 */
326
327/*
328 We have to make sure that MTC_SCRN_BUF_SIZE_MAX is set correctly in various project .
329 The only thing we can confirm is that bpp of MAIN_LCD_16BIT_MODE is displayed 2 bytes length,
330 the other cases MTC_SCRN_BUF_SIZE_MAX is set to maximum size
331 It may be revised in later projects
332*/
333#if defined (MAIN_LCD_16BIT_MODE)
334 #define MTC_SCRN_BUF_SIZE_MAX (LCD_WIDTH*LCD_HEIGHT*(sizeof(mtc_pixel_16_type)))
335#else
336 #define MTC_SCRN_BUF_SIZE_MAX (LCD_WIDTH*LCD_HEIGHT*(sizeof(mtc_pixel_18_type)))
337#endif
338
339
340/*=========================================================*/
341#if 0
342/* under construction !*/
343/* under construction !*/
344/* under construction !*/
345/* under construction !*/
346/* under construction !*/
347#endif
348
349typedef mtc_req_hdr_type mtc_rsp_hdr_type;
350
351typedef __packed struct
352{
353 mtc_rsp_hdr_type hdr;
354 mtc_scrn_id_type scrn_id;
355 kal_uint16 scrn_width; /* Screen Width in Pixels */
356 kal_uint16 scrn_height; /* Screen Height in Pixcels */
357 mtc_bits_pixel_type bits_pixel; /* Color bits for each Pixel */
358}mtc_screen_info_rsp_type;
359
360typedef __packed struct
361{
362 kal_uint32 blue;
363 kal_uint32 green;
364 kal_uint32 red;
365}mtc_mask_type;
366
367typedef __packed struct
368{
369 mtc_rsp_hdr_type hdr;
370 mtc_scrn_id_type scrn_id;
371 kal_uint16 bmp_width; /* Width of the BMP */
372 kal_uint16 bmp_height; /* Height of the BMP */
373 mtc_bits_pixel_type bits_pixel; /* Color bits for each pixel */
374 mtc_mask_type mask;
375//// kal_uint8 bmp_data[MTC_SCRN_BUF_SIZE_MAX];
376//mtk01616_091217: we output data directly ,without keeping all bmp_data in a buffer first.
377}mtc_capture_rsp_type;
378
379typedef __packed struct
380{
381 mtc_rsp_hdr_type hdr;
382 mtc_scrn_id_type scrn_id;
383 kal_uint16 bmp_width; /* Width of the BMP */
384 kal_uint16 bmp_height; /* Height of the BMP */
385 mtc_bits_pixel_type bits_pixel; /* must be zero */
386 kal_uint8 data_type;
387 kal_uint8 pack_type;
388 kal_uint8 quantizer;
389 kal_uint8 threshold;
390 kal_uint32 bmp_size;
391//// kal_uint8 bmp_data[ MTC_SCRN_BUF_SIZE_MAX ];
392//mtk01616_091217: we output data directly ,without keeping all bmp_data in a buffer first.
393}mtc_ats_capture_rsp_type;
394
395typedef __packed struct
396{
397 mtc_rsp_hdr_type hdr;
398 kal_uint8 keyState;
399 kal_uint8 keyCode;
400}mtc_ats_key_report_type;
401
402typedef __packed struct
403{
404 mtc_req_hdr_type hdr;
405 kal_uint8 model_name[10];
406 kal_uint32 release_date;
407 kal_uint8 software_ver[40];
408 kal_uint8 IMEI[15];
409 kal_uint8 phone_num[15];
410 kal_uint16 enabled_functions;
411}mtc_ats_phone_report_rsp_type;
412
413typedef __packed struct
414{
415 mtc_req_hdr_type hdr;
416 kal_uint16 phone_state;
417}mtc_ats_phone_state_rsp_type;
418
419typedef __packed struct
420{
421 mtc_req_hdr_type hdr;
422 kal_uint8 request_area;
423 kal_uint8 value;
424}mtc_ats_key_report_en_rsp_type;
425
426typedef __packed struct
427{
428 mtc_req_hdr_type hdr;
429 kal_uint32 log_mask;
430}mtc_ats_key_log_mask_rsp_type;
431
432typedef __packed struct
433{
434 mtc_req_hdr_type hdr;
435 kal_uint32 *reserved;
436 kal_uint32 *address;
437 kal_uint8 size;
438 kal_uint8 data[64];
439}mtc_ats_memory_rsp_type;
440
441typedef __packed struct
442{
443 mtc_req_hdr_type hdr;
444 kal_uint8 isCharging;
445 kal_uint8 capacity;
446}mtc_ats_battery_rsp_type;
447
448typedef __packed struct
449{
450 mtc_req_hdr_type hdr;
451 kal_uint8 value;
452}mtc_ats_backlight_rsp_type;
453
454typedef __packed struct
455{
456 mtc_req_hdr_type hdr;
457 kal_uint16 packet_size;
458 kal_uint16 transfer_delay;
459}mtc_ats_transfer_setup_rsp_type;
460
461
462/*==========================================================*/
463
464typedef __packed struct
465{
466 mtc_rsp_hdr_type hdr;
467 kal_uint8 KeyHoldType; /* Press or Release */
468 kal_uint8 KeyCode; /* Virtual key Code */
469}mtc_key_event_rsp_type;
470
471typedef mtc_key_event_rsp_type mtc_key_event_ind_type;
472
473typedef __packed struct
474{
475 mtc_rsp_hdr_type hdr;
476 kal_uint8 log_id; /* Press or Release */
477 kal_uint16 log_len; /* Virtual key Code */
478 kal_uint64 time;
479 kal_uint8 press;
480 kal_uint8 key_code;
481 kal_uint64 active_UIID;
482}mtc_ats_key_log_event_rsp_type;
483
484typedef mtc_ats_key_log_event_rsp_type mtc_ats_key_log_event_ind_type;
485
486typedef __packed struct
487{
488 mtc_rsp_hdr_type hdr;
489 kal_uint8 KeyCode; /* Virtual key Code */
490 short Delay; /* delay measured in 1\10 of a second */
491}mtc_fast_key_event_resp;
492
493/*==========================================================*/
494
495typedef __packed union
496{
497 mtc_screen_info_rsp_type info;
498 mtc_capture_rsp_type capture;
499 mtc_ats_capture_rsp_type ats_capture;
500 mtc_ats_memory_rsp_type ats_dump;
501 mtc_ats_battery_rsp_type ats_battery;
502 mtc_ats_backlight_rsp_type ats_backlight;
503 mtc_ats_transfer_setup_rsp_type ats_setup;
504 mtc_key_event_rsp_type keyevent;
505 mtc_ats_key_log_event_rsp_type ats_keylogevent;
506 mtc_fast_key_event_resp fastkeyevent;
507}mtc_rsp_type;
508
509typedef __packed union
510{
511 mtc_rsp_hdr_type hdr;
512 mtc_rsp_type mtc_rsp;
513}diag_mtc_rsp_type;
514
515/*============================================================*/
516
517typedef struct
518{
519 mtc_scrn_id_type id; /* lcd id: MAIN, SUB */
520 int width_max; /* max width in current rotation mode */
521 int height_max; /* max height in current rotation mode */
522 int degrees; /* LCD degrees of rotation: 0, 90, 180 */
523 mtc_bits_pixel_type bits_pixel; /* Color Bit: 16, 18 */
524 mtc_mask_type mask; /* Color mask: R, G, B */
525}mtc_lcd_info_type;
526
527typedef struct
528{
529 int start_x; /* Start X-Coord for capture area */
530 int start_y; /* Start Y- Coord for capture area */
531 int width; /* Width of the capture area */
532 int height; /* Height of the capture area */
533}mtc_capture_type;
534
535#if 0
536/* under construction !*/
537/* under construction !*/
538/* under construction !*/
539/* under construction !*/
540/* under construction !*/
541/* under construction !*/
542/* under construction !*/
543/* under construction !*/
544#endif
545/*=================================================*/
546
547#endif
548#endif /* __MTK_TARGET__ */
549