hostlib.h
9.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/*----------------------------------------------------------------------------*
* No Warranty *
* Except as may be otherwise agreed to in writing, no warranties of any *
* kind, whether express or implied, are given by MTK with respect to any MTK *
* Deliverables or any use thereof, and MTK Deliverables are provided on an *
* "AS IS" basis. MTK hereby expressly disclaims all such warranties, *
* including any implied warranties of merchantability, non-infringement and *
* fitness for a particular purpose and any warranties arising out of course *
* of performance, course of dealing or usage of trade. Parties further *
* acknowledge that Company may, either presently and/or in the future, *
* instruct MTK to assist it in the development and the implementation, in *
* accordance with Company's designs, of certain softwares relating to *
* Company's product(s) (the "Services"). Except as may be otherwise agreed *
* to in writing, no warranties of any kind, whether express or implied, are *
* given by MTK with respect to the Services provided, and the Services are *
* provided on an "AS IS" basis. Company further acknowledges that the *
* Services may contain errors, that testing is important and Company is *
* solely responsible for fully testing the Services and/or derivatives *
* thereof before they are used, sublicensed or distributed. Should there be *
* any third party action brought against MTK, arising out of or relating to *
* the Services, Company agree to fully indemnify and hold MTK harmless. *
* If the parties mutually agree to enter into or continue a business *
* relationship or other arrangement, the terms and conditions set forth *
* hereunder shall remain effective and, unless explicitly stated otherwise, *
* shall prevail in the event of a conflict in the terms in any agreements *
* entered into between the parties. *
*---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
* Copyright(c) 2009, MediaTek, Inc.
* All rights reserved.
*
* Unauthorized use, practice, perform, copy, distribution, reproduction,
* or disclosure of this information in whole or in part is prohibited.
*-----------------------------------------------------------------------------
* $File: //DTV/MAIN_BR/mATV/tool/mATVctrl_VC6/mATVctrl/mATVdrv_chtable.h $
* removed!
* removed!
* removed!
* removed!
* removed!
* HISTORY
* removed!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*---------------------------------------------------------------------------*/
/**
* @file hostlib.h
*
* @author lh.hsiao
*/
#ifndef __HOSTLIB_H__
#define __HOSTLIB_H__
#if defined(__MTK_TARGET__)
#include "kal_release.h"
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/////////////////////////////////////////////////////////////////////////////
//power on/off/suspend
/////////////////////////////////////////////////////////////////////////////
kal_uint32 ATVChipID(void);
kal_bool bChipInit(kal_uint8 tvmode);
kal_bool bChipSuspend(kal_bool on);
kal_bool bChipShutdown(void);
void vMainloop(kal_uint32 delay_in_10ms); //chip main loop service running by task
/////////////////////////////////////////////////////////////////////////////
//ch scan/control
/////////////////////////////////////////////////////////////////////////////
#define Freq2DR(freqkhz) (kal_uint16)((freqkhz*2)/125) //(freqkhz*16)/1000
#define DR2Freq(freqDR) (((kal_uint32)freqDR*125)/2)
extern kal_uint16 Freq2DR_Fn(kal_uint32 freqkhz);
extern kal_uint32 DR2Freq_Fn(kal_uint16 freqDR);
enum
{
CHINS_AUTO=0,
CHINS_FULLSCAN=1,
CHINS_1CH=2
};
extern void vChSearchInit(kal_uint16 freqDR, kal_uint8 scantype);
extern void vChSearchStop(void);
extern void vChQuickInstall(void);
extern void vChChg(kal_uint8 ch);
extern void vChNext(kal_uint8 inc);
extern void vChSetCountryID(kal_uint8 id);
struct ChRec
{
kal_uint16 freqDR;
kal_uint8 sndsys; /* reference sv_const.h, TV_AUD_SYS_T ...*/
kal_uint8 colsys; /* reference sv_const.h, SV_CS_PAL_N, SV_CS_PAL,SV_CS_NTSC358...*/
kal_uint8 flag;
};
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
extern kal_bool bChTab_Get(kal_uint8 n,struct ChRec * rec);//return 1:success 0:fail
extern kal_bool bChTab_Set(kal_uint8 n,struct ChRec * rec);//return 1:success 0:fail
extern kal_bool bChTab_Clear(kal_uint8 n);//return 1:success 0:fail
extern kal_bool bChTab_ClearAll(void);//return 1:success 0:fail
typedef void (*AutoScanProgCB_t)(kal_uint8 precent,kal_uint8 ch,kal_uint8 chnum);
typedef void (*FullScanProgCB_t)(kal_uint8 precent,kal_uint32 freq,kal_uint32 freq_start,kal_uint32 freq_end);
typedef void (*ScanFinishCB_t)(kal_uint8 chnum);
void RegisterChScanCB(AutoScanProgCB_t auto_cb,FullScanProgCB_t full_cb,ScanFinishCB_t finish_cb);
/////////////////////////////////////////////////////////////////////////////
//AUDIO
/////////////////////////////////////////////////////////////////////////////
void vApiAudioPlay(kal_uint8 fgWaitPlay);
void vApiAudioStop(void);
void vApiAudioSetMasterVolume(kal_uint8 bValue);
kal_uint32 dwApiAudioGetFormatSrc(void);
void vApiAudioSetAtvOutputMode(kal_uint32 eSoundMode);
//meta
kal_uint8 bApiAudioGetFmRdoDetectStatus (kal_uint32 *info);
kal_uint8 bApiAudioGetSoundSystem(kal_uint32 *info);
typedef void (*AudNotifyCB_t)(kal_uint32 format);
void RegisterAudNotifyCB(AudNotifyCB_t aud_notify_cb);
/////////////////////////////////////////////////////////////////////////////
//TVD
/////////////////////////////////////////////////////////////////////////////
enum TVD_BLOCK{
TVD_BLOCK_IS443=0,
TVD_BLOCK_IS358,
TVD_BLOCK_UNKNOW
};
extern kal_uint8 bTvd3dGetColorSystem(void);
extern void vDrvTvd3dSetColorSystem(kal_uint8 bColSys);
extern void vTvd3dReset(void);
extern kal_uint8 fgDrvTvdCheckTVDLock(void);
extern kal_uint8 bDrvTvdCheckBurstFreq(void);
extern kal_uint8 bTvd3dGetNRLevel(void);
extern void vApiVideoPosBrightness(kal_uint8 polarity, kal_uint8 bValue);
extern void vApiVideoPreBrightness(kal_uint8 polarity, kal_uint8 bValue);
extern void vApiVideoContrast(kal_uint8 bValue);
extern void vApiVideoSaturation(kal_uint8 bValue);
#ifdef __CLASSK_CP_SUPPORT__
extern kal_bool mATV_Class_K_Implementation(void);
#endif
/////////////////////////////////////////////////////////////////////////////
//Chip/Vendor dependent
/////////////////////////////////////////////////////////////////////////////
typedef enum
{
eOFF=0,
eON=1
} eOnOff;
typedef enum
{
FPS15=15, /*if PAL mode 12.5 fps*/
FPS20=20, /*if PAL mode 16.67 fps*/
FPS30=30 /*if PAL mode 25 fps*/
} eTVDMaxFramerate;
typedef enum
{
CAMIF_Normal_Mode = 0,
CAMIF_Direct_Mode = 3, /*240*320=4.33Mhz 15fps, 176x220 PCLK=6.5MHz 30fps*/
CAMIF_Direct_L_Mode = 4 /*240*320=4.33Mhz 15fps, 176x220 PCLK=3.25MHz 15fps*/
} eTVDCamIFMode;
typedef enum
{
NR_Normal_Mode = 0,
Force_On_Mode,
Force_Off_Mode
} eTVDNR;
typedef enum
{
I2S_Master_PWM = 0,
I2S_Master,
I2S_Slave,
PWM,
I2S_Slave_PWM
} eAUDOutputMode;
enum
{
//export to standard enum (mandatory)
EXPORT_SIG_RSSI=0,
EXPORT_SIG_SNR,
EXPORT_SIG_STRENGTH,
EXPORT_TVD_MaxFrameRate, /* ref. eTVDMaxFramerate */
EXPORT_AUD_OutputMode,
EXPORT_AUD_SWMute,
/* item >= 100, variant info, not fixed
* example
* MTK_GAIN0=100,
* MTK_GAIN1=101
*/
MTK_TVD_MaxFrameRate=180, /* ref. eTVDMaxFramerate */
MTK_TVD_CamIFRefMCLK, /* ref. eOnOff */
MTK_TVD_CamIFMode, /* ref. eTVDCamIFMode */
MTK_TVD_CamIFCaptureMode, /* ref. eOnOff */
MTK_TVD_CamIFResolution, /* (width<<16)|height */
MTK_TVD_SMOOTHER, /* ref. (eTVDSMOOTHER<<4)|Thr */
MTK_TVD_PCLK_INV, /* ref. eOnOff */
MTK_TVD_FrameRate,
MTK_TVD_FRDIV2_WA, /* 1~5, 0xff*/
MTK_TVD_ScanLockPara, /*VOFST_TH Recheck_TH CHECKTVD_ROUND, */
MTK_AUD_OutputMode=190, /* ref. eAUDOutputMode */
MTK_AUD_SWMute,
MTK_CLI_PORT=200,
MTK_DRV_VERSION_ID=202,
MTK_DRV_VERSION_SUB_ID,
MTK_LCM_WRITECYCLE=210,
MTK_PAD_DRIVING, /* (pin<<4)|driving ; pin:0~7, H, V, PCLK*/
MTK_ATD_EQ,
MTK_TVD_AdapC,
MTK_AUD_AVC,
MTK_AUD_SmartToggling,
MTK_TVD_DropFrameRate,
MTK_TVD_EnableSharpness,
MTK_TVD_Enable1DNR,
MTK_TVD_MN_DropFrameRate,
MTK_TVD_RealTimeMode,
MTK_TVD_MN_RealTimeMode,
MTK_TVD_RecoverDropFrameRate,
MTK_TVD_DelayMode,
MTK_TVD_AdjustNR,
MTK_TVD_Bypass,
MTK_TVD_Color
};
kal_uint32 DrvGetChipDep(kal_uint8 item);
kal_bool DrvSetChipDep(kal_uint8 item,kal_uint32 val);
#endif /* __MTK_TARGET__ */
#endif /* __HOSTLIB_H__ */