xref: /utopia/UTPA2-700.0.x/mxlib/include/drvDMD_ISDBT.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file   drvDMD_ISDBT.h
98 /// @brief  ISDBT Driver Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 #ifndef _DRV_ISDBT_H_
103 #define _DRV_ISDBT_H_
104 
105 //-------------------------------------------------------------------------------------------------
106 //  Driver Capability
107 //-------------------------------------------------------------------------------------------------
108 
109 #if !defined UTPA2
110 #define DMD_ISDBT_UTOPIA_EN                  1
111 #define DMD_ISDBT_UTOPIA2_EN                 0
112 #else
113 #define DMD_ISDBT_UTOPIA_EN                  0
114 #define DMD_ISDBT_UTOPIA2_EN                 1
115 #endif
116 
117 #define DMD_ISDBT_STR_EN                     1
118 #define DMD_ISDBT_MULTI_THREAD_SAFE          0
119 #define DMD_ISDBT_MULTI_DMD_EN               1
120 #define DMD_ISDBT_EXTDMD_EN                  1
121 //-------------------------------------------------------------------------------------------------
122 //  Include Files
123 //-------------------------------------------------------------------------------------------------
124 
125 #include "MsTypes.h"
126 #if DMD_ISDBT_UTOPIA_EN || DMD_ISDBT_UTOPIA2_EN
127 #ifndef MSIF_TAG
128 #include "MsVersion.h"
129 #endif
130 #include "MsCommon.h"
131 #endif
132 #if DMD_ISDBT_UTOPIA2_EN || DMD_ISDBT_STR_EN
133 #include "utopia.h"
134 #endif
135 
136 //-------------------------------------------------------------------------------------------------
137 //  Driver Capability
138 //-------------------------------------------------------------------------------------------------
139 
140 
141 //-------------------------------------------------------------------------------------------------
142 //  Macro and Define
143 //-------------------------------------------------------------------------------------------------
144 
145 #ifndef DLL_PUBLIC
146 #define DLL_PUBLIC
147 #endif
148 
149 #if DMD_ISDBT_MULTI_DMD_EN
150 #define DMD_ISDBT_MAX_DEMOD_NUM          2
151 #else
152 #define DMD_ISDBT_MAX_DEMOD_NUM          1
153 #endif
154 
155 #if DMD_ISDBT_UTOPIA_EN || DMD_ISDBT_UTOPIA2_EN
156 #define MSIF_DMD_ISDBT_LIB_CODE          {'D','M','D','_','I','S','D','B','T','_'} //Lib code
157 #define MSIF_DMD_ISDBT_LIBVER            {'0','0'}                                 //LIB version
158 #define MSIF_DMD_ISDBT_BUILDNUM          {'0','0'}                                 //Build Number
159 #define MSIF_DMD_ISDBT_CHANGELIST        {'0','0','0','0','0','0','0','0'}         //P4 ChangeList Number
160 
161 #define DMD_ISDBT_VER                    /* Character String for DRV/API version             */  \
162     MSIF_TAG,                            /* 'MSIF'                                           */  \
163     MSIF_CLASS,                          /* '00'                                             */  \
164     MSIF_CUS,                            /* 0x0000                                           */  \
165     MSIF_MOD,                            /* 0x0000                                           */  \
166     MSIF_CHIP,                                                                                   \
167     MSIF_CPU,                                                                                    \
168     MSIF_DMD_ISDBT_LIB_CODE,             /* IP__                                             */  \
169     MSIF_DMD_ISDBT_LIBVER,               /* 0.0 ~ Z.Z                                        */  \
170     MSIF_DMD_ISDBT_BUILDNUM,             /* 00 ~ 99                                          */  \
171     MSIF_DMD_ISDBT_CHANGELIST,           /* CL#                                              */  \
172     MSIF_OS
173 #endif // #if DMD_ISDBT_UTOPIA_EN || DMD_ISDBT_UTOPIA2_EN
174 
175 #ifndef BIT_
176 #define BIT_(n)                             (1 << (n))
177 #endif
178 
179 #define DMD_ISDBT_LOCK_FSA_TRACK_LOCK       BIT_(0)
180 #define DMD_ISDBT_LOCK_PSYNC_LOCK           BIT_(1)
181 #define DMD_ISDBT_LOCK_ICFO_CH_EXIST_LOCK   BIT_(2)
182 #define DMD_ISDBT_LOCK_FEC_LOCK             BIT_(3)
183 
184 //-------------------------------------------------------------------------------------------------
185 //  Type and Structure
186 //-------------------------------------------------------------------------------------------------
187 
188 typedef enum
189 {
190     DMD_ISDBT_HAL_CMD_Exit = 0,
191     DMD_ISDBT_HAL_CMD_InitClk,
192     DMD_ISDBT_HAL_CMD_Download,
193     DMD_ISDBT_HAL_CMD_FWVERSION,
194     DMD_ISDBT_HAL_CMD_SoftReset,
195     DMD_ISDBT_HAL_CMD_SetACICoef,
196     DMD_ISDBT_HAL_CMD_SetISDBTMode,
197     DMD_ISDBT_HAL_CMD_SetModeClean,
198     DMD_ISDBT_HAL_CMD_Active,
199     DMD_ISDBT_HAL_CMD_Check_FEC_Lock,
200     DMD_ISDBT_HAL_CMD_Check_FSA_TRACK_Lock,
201     DMD_ISDBT_HAL_CMD_Check_PSYNC_Lock,
202     DMD_ISDBT_HAL_CMD_Check_ICFO_CH_EXIST_Lock,
203     DMD_ISDBT_HAL_CMD_GetSignalCodeRate,
204     DMD_ISDBT_HAL_CMD_GetSignalGuardInterval,
205     DMD_ISDBT_HAL_CMD_GetSignalTimeInterleaving,
206     DMD_ISDBT_HAL_CMD_GetSignalFFTValue,
207     DMD_ISDBT_HAL_CMD_GetSignalModulation,
208     DMD_ISDBT_HAL_CMD_ReadIFAGC,
209     DMD_ISDBT_HAL_CMD_GetFreqOffset,
210     DMD_ISDBT_HAL_CMD_GetSignalQuality,
211     DMD_ISDBT_HAL_CMD_GetSignalQualityOfLayerA,
212     DMD_ISDBT_HAL_CMD_GetSignalQualityOfLayerB,
213     DMD_ISDBT_HAL_CMD_GetSignalQualityOfLayerC,
214     DMD_ISDBT_HAL_CMD_GetSignalQualityCombine,
215     DMD_ISDBT_HAL_CMD_GetSNR,
216     DMD_ISDBT_HAL_CMD_GetPreViterbiBer,
217     DMD_ISDBT_HAL_CMD_GetPostViterbiBer,
218     DMD_ISDBT_HAL_CMD_Read_PKT_ERR,
219     DMD_ISDBT_HAL_CMD_TS_INTERFACE_CONFIG,
220     DMD_ISDBT_HAL_CMD_IIC_Bypass_Mode,
221     DMD_ISDBT_HAL_CMD_SSPI_TO_GPIO,
222     DMD_ISDBT_HAL_CMD_GPIO_GET_LEVEL,
223     DMD_ISDBT_HAL_CMD_GPIO_SET_LEVEL,
224     DMD_ISDBT_HAL_CMD_GPIO_OUT_ENABLE,
225     DMD_ISDBT_HAL_CMD_DoIQSwap,
226     DMD_ISDBT_HAL_CMD_GET_REG,
227     DMD_ISDBT_HAL_CMD_SET_REG
228 } DMD_ISDBT_HAL_COMMAND;
229 
230 typedef enum
231 {
232     E_ISDBT_Layer_A = 0x00,
233     E_ISDBT_Layer_B = 0x01,
234     E_ISDBT_Layer_C = 0x02,
235     E_ISDBT_Layer_INVALID,
236 } EN_ISDBT_Layer;
237 
238 typedef enum
239 {
240     E_ISDBT_FFT_2K = 0x00,  /// 2K
241     E_ISDBT_FFT_4K = 0x01,  /// 4k
242     E_ISDBT_FFT_8K = 0x02,  /// 8k
243     E_ISDBT_FFT_INVALID,    /// invalid indicator
244 } EN_ISDBT_FFT_VAL;
245 
246 typedef enum
247 {
248     E_ISDBT_DQPSK   = 0,   /// DQPSK
249     E_ISDBT_QPSK    = 1,   /// QPSK
250     E_ISDBT_16QAM   = 2,   /// 16QAM
251     E_ISDBT_64QAM   = 3,   /// 64QAM
252     E_ISDBT_QAM_INVALID,   /// invalid indicator
253 } EN_ISDBT_CONSTEL_TYPE;
254 
255 typedef enum
256 {
257     E_ISDBT_CODERATE_1_2 = 0,   /// 1/2
258     E_ISDBT_CODERATE_2_3 = 1,   /// 2/3
259     E_ISDBT_CODERATE_3_4 = 2,   /// 3/4
260     E_ISDBT_CODERATE_5_6 = 3,   /// 5/6
261     E_ISDBT_CODERATE_7_8 = 4,   /// 7/8
262     E_ISDBT_CODERATE_INVALID,   /// invalid indicator
263 } EN_ISDBT_CODE_RATE;
264 
265 typedef enum
266 {
267     E_ISDBT_GUARD_INTERVAL_1_4  = 0,   /// 1/4
268     E_ISDBT_GUARD_INTERVAL_1_8  = 1,   /// 1/8
269     E_ISDBT_GUARD_INTERVAL_1_16 = 2,   /// 1/16
270     E_ISDBT_GUARD_INTERVAL_1_32 = 3,   /// 1/32
271     E_ISDBT_GUARD_INTERVAL_INVALID,    /// invalid indicator
272 } EN_ISDBT_GUARD_INTERVAL;
273 
274 typedef enum
275 {
276     // 2K mode
277     E_ISDBT_2K_TDI_0 = 0,   /// Tdi = 0
278     E_ISDBT_2K_TDI_4 = 1,   /// Tdi = 4
279     E_ISDBT_2K_TDI_8 = 2,   /// Tdi = 8
280     E_ISDBT_2K_TDI_16 = 3,  /// Tdi = 16
281     // 4K mode
282     E_ISDBT_4K_TDI_0 = 4,   /// Tdi = 0
283     E_ISDBT_4K_TDI_2 = 5,   /// Tdi = 2
284     E_ISDBT_4K_TDI_4 = 6,   /// Tdi = 4
285     E_ISDBT_4K_TDI_8 = 7,   /// Tdi = 8
286     // 8K mode
287     E_ISDBT_8K_TDI_0 = 8,   /// Tdi = 0
288     E_ISDBT_8K_TDI_1 = 9,   /// Tdi = 1
289     E_ISDBT_8K_TDI_2 = 10,  /// Tdi = 2
290     E_ISDBT_8K_TDI_4 = 11,  /// Tdi = 4
291     E_ISDBT_TDI_INVALID,    /// invalid indicator
292 } EN_ISDBT_TIME_INTERLEAVING;
293 
294 typedef struct DLL_PACKED _ISDBT_MODULATION_MODE
295 {
296     EN_ISDBT_CODE_RATE         eIsdbtCodeRate;
297     EN_ISDBT_GUARD_INTERVAL    eIsdbtGI;
298     EN_ISDBT_TIME_INTERLEAVING eIsdbtTDI;
299     EN_ISDBT_FFT_VAL           eIsdbtFFT;
300     EN_ISDBT_CONSTEL_TYPE      eIsdbtConstellation;
301 } sISDBT_MODULATION_MODE;
302 
303 typedef struct DLL_PACKED _DMD_ISDBT_GET_MODULATION
304 {
305     EN_ISDBT_Layer        eIsdbtLayer;
306     EN_ISDBT_CONSTEL_TYPE eConstellation;
307 } DMD_ISDBT_GET_MODULATION;
308 
309 typedef struct DLL_PACKED _DMD_ISDBT_GET_CodeRate
310 {
311     EN_ISDBT_Layer     eIsdbtLayer;
312     EN_ISDBT_CODE_RATE eCodeRate;
313 } DMD_ISDBT_GET_CodeRate;
314 
315 typedef struct DLL_PACKED _DMD_ISDBT_GET_TimeInterleaving
316 {
317     EN_ISDBT_Layer             eIsdbtLayer;
318     EN_ISDBT_TIME_INTERLEAVING eTimeInterleaving;
319 } DMD_ISDBT_GET_TimeInterleaving;
320 
321 typedef struct DLL_PACKED _DMD_ISDBT_GET_BER_VALUE
322 {
323     EN_ISDBT_Layer eIsdbtLayer;
324     #ifdef UTPA2
325     MS_U32 BerValue;
326     MS_U16 BerPeriod;
327     #else
328     float  fBerValue;
329     #endif
330 } DMD_ISDBT_GET_BER_VALUE;
331 
332 typedef struct DLL_PACKED _DMD_ISDBT_GET_PKT_ERR
333 {
334     EN_ISDBT_Layer eIsdbtLayer;
335     MS_U16         u16PacketErr;
336 } DMD_ISDBT_GET_PKT_ERR;
337 
338 #ifdef UTPA2
339 typedef struct DLL_PACKED
340 {
341     MS_U8  FFT_Mode;
342     MS_S32 TdCfoRegValue;
343     MS_S32 FdCfoRegValue;
344     MS_S16 IcfoRegValue;
345 } DMD_ISDBT_CFO_DATA;
346 
347 typedef struct DLL_PACKED
348 {
349     MS_U32 RegSNR;
350     MS_U16 RegSnrObsNum;
351 } DMD_ISDBT_SNR_DATA;
352 #endif
353 
354 typedef struct DLL_PACKED
355 {
356     MS_U8 u8Pin;
357     union
358     {
359         MS_BOOL bLevel;
360         MS_BOOL bIsOut;
361     };
362 } DMD_ISDBT_GPIO_PIN_DATA;
363 
364 typedef struct DLL_PACKED
365 {
366     MS_U16 u16Addr;
367     MS_U8  u8Data;
368 } DMD_ISDBT_REG_DATA;
369 
370 typedef enum
371 {
372     DMD_ISDBT_DBGLV_NONE,    // disable all the debug message
373     DMD_ISDBT_DBGLV_INFO,    // information
374     DMD_ISDBT_DBGLV_NOTICE,  // normal but significant condition
375     DMD_ISDBT_DBGLV_WARNING, // warning conditions
376     DMD_ISDBT_DBGLV_ERR,     // error conditions
377     DMD_ISDBT_DBGLV_CRIT,    // critical conditions
378     DMD_ISDBT_DBGLV_ALERT,   // action must be taken immediately
379     DMD_ISDBT_DBGLV_EMERG,   // system is unusable
380     DMD_ISDBT_DBGLV_DEBUG,   // debug-level messages
381 } DMD_ISDBT_DbgLv;
382 
383 typedef enum
384 {   DMD_ISDBT_DEMOD,
385     DMD_ISDBT_DEMOD_6M = DMD_ISDBT_DEMOD,
386     DMD_ISDBT_DEMOD_7M,
387     DMD_ISDBT_DEMOD_8M,
388     DMD_ISDBT_DEMOD_MAX,
389     DMD_ISDBT_DEMOD_NULL = DMD_ISDBT_DEMOD_MAX,
390 } DMD_ISDBT_DEMOD_TYPE;
391 
392 typedef enum
393 {
394     DMD_ISDBT_GETLOCK,
395     DMD_ISDBT_GETLOCK_FSA_TRACK_LOCK,
396     DMD_ISDBT_GETLOCK_PSYNC_LOCK,
397     DMD_ISDBT_GETLOCK_ICFO_CH_EXIST_LOCK,
398     DMD_ISDBT_GETLOCK_FEC_LOCK
399 } DMD_ISDBT_GETLOCK_TYPE;
400 
401 typedef enum
402 {
403     DMD_ISDBT_LOCK,
404     DMD_ISDBT_CHECKING,
405     DMD_ISDBT_CHECKEND,
406     DMD_ISDBT_UNLOCK,
407     DMD_ISDBT_NULL,
408 } DMD_ISDBT_LOCK_STATUS;
409 
410 /// For demod init
411 typedef struct DLL_PACKED
412 {
413     // init
414     MS_U16 u16ISDBTIcfoChExistCheckTime;
415     MS_U16 u16ISDBTFECLockCheckTime;
416 
417     // register init
418     MS_U8 *u8DMD_ISDBT_DSPRegInitExt; // TODO use system variable type
419     MS_U8 u8DMD_ISDBT_DSPRegInitSize;
420     MS_U8 *u8DMD_ISDBT_InitExt; // TODO use system variable type
421 
422     //By Tuners:
423     MS_U16  u16IF_KHZ;//By Tuners
424     MS_BOOL bIQSwap;//0
425     MS_U16  u16AgcReferenceValue;//0
426     MS_BOOL bTunerGainInvert;//0
427 
428     //By IC:
429     MS_BOOL bIsExtDemod;//0
430 
431     //By TS (Only for MCP or ext demod):
432     MS_U8 u1TsConfigByte_SerialMode : 1;
433     MS_U8 u1TsConfigByte_DataSwap   : 1;
434     MS_U8 u1TsConfigByte_ClockInv   : 1;
435     MS_U8 u5TsConfigByte_DivNum     : 5;
436 
437     //By SYS I2C (Only for MCP or ext demod):
438     MS_U8 u8I2CSlaveAddr;
439     MS_U8 u8I2CSlaveBus;
440     MS_BOOL (*I2C_WriteBytes)(MS_U16 u16BusNumSlaveID, MS_U8 u8addrcount, MS_U8* pu8addr, MS_U16 u16size, MS_U8* pu8data);
441     MS_BOOL (*I2C_ReadBytes)(MS_U16 u16BusNumSlaveID, MS_U8 u8AddrNum, MS_U8* paddr, MS_U16 u16size, MS_U8* pu8data);
442 
443     //By SYS MSPI (Only for MCP or ext demod):
444     MS_BOOL bIsUseSspiLoadCode;
445     MS_BOOL bIsSspiUseTsPin;
446 
447     //By SYS memory mapping (Only for int demod):
448     MS_U32 u32TdiStartAddr;
449 
450     #if !DMD_ISDBT_UTOPIA_EN && !DMD_ISDBT_UTOPIA2_EN
451     MS_U32  (*GetSystemTimeMS)(void);      // Get sys time (unit: ms)
452     void    (*DelayMS)(MS_U32 ms);         // Delay time (unit: ms)
453     MS_BOOL (*CreateMutex)(MS_BOOL enable); // Create&Delete mutex
454     void    (*LockDMD)(MS_BOOL enable);    // Enter&Leave mutex
455     #endif
456 } DMD_ISDBT_InitData;
457 
458 typedef struct DLL_PACKED
459 {
460     MS_VIRT virtDMDBaseAddr;
461 
462     MS_BOOL bInit;
463     MS_BOOL bDownloaded;
464 
465     #if DMD_ISDBT_STR_EN
466     MS_BOOL              bIsDTV;
467     EN_POWER_MODE        eLastState;
468     #endif
469     DMD_ISDBT_DEMOD_TYPE eLastType;
470 
471     MS_BOOL bIsQPad;
472 
473     MS_BOOL (*HAL_DMD_ISDBT_IOCTL_CMD)(DMD_ISDBT_HAL_COMMAND eCmd, void *pPara);
474 } DMD_ISDBT_PriData;
475 
476 typedef struct DLL_PACKED
477 {
478     MS_U8  u8Version;
479     MS_U32 u32ISDBTScanTimeStart;
480     MS_U32 u32ISDBTFECLockTime;
481     MS_U32 u32ISDBTLockStatus;
482 } DMD_ISDBT_Info;
483 
484 typedef struct DLL_PACKED
485 {
486     DMD_ISDBT_InitData  sDMD_ISDBT_InitData;
487     DMD_ISDBT_PriData   sDMD_ISDBT_PriData;
488     DMD_ISDBT_Info      sDMD_ISDBT_Info;
489 } DMD_ISDBT_ResData;
490 
491 //-------------------------------------------------------------------------------------------------
492 //  Function and Variable
493 //-------------------------------------------------------------------------------------------------
494 
495 #ifdef __cplusplus
496 extern "C"
497 {
498 #endif
499 
500 #ifndef MSOS_TYPE_LINUX_KERNEL
501 
502 //------------------------------------------------------------------------------
503 /// Set detailed level of ISDBT driver debug message
504 /// u8DbgLevel : debug level for Parallel Flash driver\n
505 /// AVD_DBGLV_NONE,    ///< disable all the debug message\n
506 /// AVD_DBGLV_INFO,    ///< information\n
507 /// AVD_DBGLV_NOTICE,  ///< normal but significant condition\n
508 /// AVD_DBGLV_WARNING, ///< warning conditions\n
509 /// AVD_DBGLV_ERR,     ///< error conditions\n
510 /// AVD_DBGLV_CRIT,    ///< critical conditions\n
511 /// AVD_DBGLV_ALERT,   ///< action must be taken immediately\n
512 /// AVD_DBGLV_EMERG,   ///< system is unusable\n
513 /// AVD_DBGLV_DEBUG,   ///< debug-level messages\n
514 /// @return TRUE : succeed
515 /// @return FALSE : failed to set the debug level
516 //------------------------------------------------------------------------------
517 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetDbgLevel(DMD_ISDBT_DbgLv u8DbgLevel);
518 //-------------------------------------------------------------------------------------------------
519 /// Get the information of ISDBT driver\n
520 /// @return the pointer to the driver information
521 //-------------------------------------------------------------------------------------------------
522 DLL_PUBLIC extern DMD_ISDBT_Info* MDrv_DMD_ISDBT_GetInfo(void);
523 //-------------------------------------------------------------------------------------------------
524 /// Get ISDBT driver version
525 /// when get ok, return the pointer to the driver version
526 //-------------------------------------------------------------------------------------------------
527 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetLibVer(const MSIF_Version **ppVersion);
528 
529 ////////////////////////////////////////////////////////////////////////////////
530 /// Should be called once when power on init
531 ////////////////////////////////////////////////////////////////////////////////
532 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Initial_Hal_Interface(void);
533 
534 ////////////////////////////////////////////////////////////////////////////////
535 ///                            SINGLE DEMOD API                              ///
536 ////////////////////////////////////////////////////////////////////////////////
537 
538 ////////////////////////////////////////////////////////////////////////////////
539 /// Should be called every time when enter DTV input source
540 ////////////////////////////////////////////////////////////////////////////////
541 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Init(DMD_ISDBT_InitData *pDMD_ISDBT_InitData, MS_U32 u32InitDataLen);
542 ////////////////////////////////////////////////////////////////////////////////
543 /// Should be called every time when exit DTV input source
544 ////////////////////////////////////////////////////////////////////////////////
545 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Exit(void);
546 ////////////////////////////////////////////////////////////////////////////////
547 /// Get Initial Data
548 ////////////////////////////////////////////////////////////////////////////////
549 DLL_PUBLIC extern MS_U32 MDrv_DMD_ISDBT_GetConfig(DMD_ISDBT_InitData *psDMD_ISDBT_InitData);
550 ////////////////////////////////////////////////////////////////////////////////
551 /// Get demod FW version (no use)
552 ////////////////////////////////////////////////////////////////////////////////
553 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetFwVer(MS_U16 *pu16FwVer);
554 ////////////////////////////////////////////////////////////////////////////////
555 /// Reset demod (no use)
556 ////////////////////////////////////////////////////////////////////////////////
557 DLL_PUBLIC extern void MDrv_DMD_ISDBT_SetReset(void);
558 ////////////////////////////////////////////////////////////////////////////////
559 /// Set demod mode and enable demod
560 ////////////////////////////////////////////////////////////////////////////////
561 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_AdvSetConfig(DMD_ISDBT_DEMOD_TYPE eType, MS_BOOL bEnable);
562 ////////////////////////////////////////////////////////////////////////////////
563 /// Set demod mode and enable demod
564 ////////////////////////////////////////////////////////////////////////////////
565 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetConfig(MS_BOOL bEnable);
566 ////////////////////////////////////////////////////////////////////////////////
567 /// Active demod (not used)
568 ////////////////////////////////////////////////////////////////////////////////
569 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetActive(MS_BOOL bEnable);
570 ////////////////////////////////////////////////////////////////////////////////
571 /// Set demod power state for STR
572 ////////////////////////////////////////////////////////////////////////////////
573 #if DMD_ISDBT_STR_EN
574 DLL_PUBLIC extern MS_U32 MDrv_DMD_ISDBT_SetPowerState(EN_POWER_MODE u16PowerState);
575 #endif
576 ////////////////////////////////////////////////////////////////////////////////
577 /// Get demod lock status
578 ////////////////////////////////////////////////////////////////////////////////
579 DLL_PUBLIC extern DMD_ISDBT_LOCK_STATUS MDrv_DMD_ISDBT_GetLock(DMD_ISDBT_GETLOCK_TYPE eType);
580 ////////////////////////////////////////////////////////////////////////////////
581 /// Get demod modulation mode
582 ////////////////////////////////////////////////////////////////////////////////
583 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetModulationMode(EN_ISDBT_Layer eLayerIndex, sISDBT_MODULATION_MODE *sIsdbtModulationMode);
584 ////////////////////////////////////////////////////////////////////////////////
585 /// Get demod signal strength (IF AGC gain)
586 ////////////////////////////////////////////////////////////////////////////////
587 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetSignalStrength(MS_U16 *u16Strength);
588 ////////////////////////////////////////////////////////////////////////////////
589 /// Get demod frequency offset
590 ////////////////////////////////////////////////////////////////////////////////
591 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetFreqOffset(float *pFreqOff);
592 ////////////////////////////////////////////////////////////////////////////////
593 /// Get demod signal quality (post Viterbi BER)
594 ////////////////////////////////////////////////////////////////////////////////
595 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQuality(void);
596 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityOfLayerA(void);
597 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityOfLayerB(void);
598 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityOfLayerC(void);
599 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityCombine(void);
600 ////////////////////////////////////////////////////////////////////////////////
601 /// Get demod SNR
602 ////////////////////////////////////////////////////////////////////////////////
603 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetSNR(float *f_snr);
604 ////////////////////////////////////////////////////////////////////////////////
605 /// Get demod pre Viterbi BER
606 ////////////////////////////////////////////////////////////////////////////////
607 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetPreViterbiBer(EN_ISDBT_Layer eLayerIndex, float *fber);
608 ////////////////////////////////////////////////////////////////////////////////
609 /// Get demod post Viterbi BER
610 ////////////////////////////////////////////////////////////////////////////////
611 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetPostViterbiBer(EN_ISDBT_Layer eLayerIndex, float *fber);
612 ////////////////////////////////////////////////////////////////////////////////
613 /// Get demod packet error
614 ////////////////////////////////////////////////////////////////////////////////
615 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Read_PKT_ERR(EN_ISDBT_Layer eLayerIndex, MS_U16 *u16PacketErr);
616 ////////////////////////////////////////////////////////////////////////////////
617 /// Set TS output mode (only for external demod)
618 ////////////////////////////////////////////////////////////////////////////////
619 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetSerialControl(MS_U8 u8TsConfigData);
620 ////////////////////////////////////////////////////////////////////////////////
621 /// Enable I2C bypass mode (only for external demod)
622 ////////////////////////////////////////////////////////////////////////////////
623 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_IIC_BYPASS_MODE(MS_BOOL bEnable);
624 ////////////////////////////////////////////////////////////////////////////////
625 /// Switch pin to SSPI or GPIO (only for external demod)
626 ////////////////////////////////////////////////////////////////////////////////
627 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SWITCH_SSPI_GPIO(MS_BOOL bEnable);
628 ////////////////////////////////////////////////////////////////////////////////
629 /// Get GPIO pin high or low (only for external demod)
630 ////////////////////////////////////////////////////////////////////////////////
631 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GPIO_GET_LEVEL(MS_U8 u8Pin, MS_BOOL *bLevel);
632 ////////////////////////////////////////////////////////////////////////////////
633 /// Set GPIO pin high or low (only for external demod)
634 ////////////////////////////////////////////////////////////////////////////////
635 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GPIO_SET_LEVEL(MS_U8 u8Pin, MS_BOOL bLevel);
636 ////////////////////////////////////////////////////////////////////////////////
637 /// Set GPIO pin output or input (only for external demod)
638 ////////////////////////////////////////////////////////////////////////////////
639 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GPIO_OUT_ENABLE(MS_U8 u8Pin, MS_BOOL bEnableOut);
640 ////////////////////////////////////////////////////////////////////////////////
641 /// Swap ADC input (usually for external demod)
642 ////////////////////////////////////////////////////////////////////////////////
643 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_DoIQSwap(MS_BOOL bIsQPad);
644 
645 ////////////////////////////////////////////////////////////////////////////////
646 /// To get ISDBT's register  value, only for special purpose.\n
647 /// u16Addr       : the address of ISDBT's register\n
648 /// return the value of AFEC's register\n
649 ////////////////////////////////////////////////////////////////////////////////
650 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetReg(MS_U16 u16Addr, MS_U8 *pu8Data);
651 ////////////////////////////////////////////////////////////////////////////////
652 /// To set ISDBT's register value, only for special purpose.\n
653 /// u16Addr       : the address of ISDBT's register\n
654 /// u8Value       : the value to be set\n
655 ////////////////////////////////////////////////////////////////////////////////
656 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetReg(MS_U16 u16Addr, MS_U8 u8Data);
657 
658 ////////////////////////////////////////////////////////////////////////////////
659 ///                            MULTI DEMOD API                              ///
660 ////////////////////////////////////////////////////////////////////////////////
661 
662 ////////////////////////////////////////////////////////////////////////////////
663 /// Should be called every time when enter DTV input source
664 ////////////////////////////////////////////////////////////////////////////////
665 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_Init(MS_U8 id, DMD_ISDBT_InitData *pDMD_ISDBT_InitData, MS_U32 u32InitDataLen);
666 ////////////////////////////////////////////////////////////////////////////////
667 /// Should be called every time when exit DTV input source
668 ////////////////////////////////////////////////////////////////////////////////
669 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_Exit(MS_U8 id);
670 ////////////////////////////////////////////////////////////////////////////////
671 /// Get Initial Data
672 ////////////////////////////////////////////////////////////////////////////////
673 DLL_PUBLIC extern MS_U32 MDrv_DMD_ISDBT_MD_GetConfig(MS_U8 id, DMD_ISDBT_InitData *psDMD_ISDBT_InitData);
674 ////////////////////////////////////////////////////////////////////////////////
675 /// Get demod FW version (no use)
676 ////////////////////////////////////////////////////////////////////////////////
677 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetFwVer(MS_U8 id, MS_U16 *pu16FwVer);
678 ////////////////////////////////////////////////////////////////////////////////
679 /// Reset demod (no use)
680 ////////////////////////////////////////////////////////////////////////////////
681 DLL_PUBLIC extern void MDrv_DMD_ISDBT_MD_SetReset(MS_U8 id);
682 ////////////////////////////////////////////////////////////////////////////////
683 /// Set demod mode and enable demod
684 ////////////////////////////////////////////////////////////////////////////////
685 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_AdvSetConfig(MS_U8 id, DMD_ISDBT_DEMOD_TYPE eType, MS_BOOL bEnable);
686 ////////////////////////////////////////////////////////////////////////////////
687 /// Set demod mode and enable demod
688 ////////////////////////////////////////////////////////////////////////////////
689 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetConfig(MS_U8 id, MS_BOOL bEnable);
690 ////////////////////////////////////////////////////////////////////////////////
691 /// Active demod (not used)
692 ////////////////////////////////////////////////////////////////////////////////
693 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetActive(MS_U8 id, MS_BOOL bEnable);
694 ////////////////////////////////////////////////////////////////////////////////
695 /// Set demod power state for STR
696 ////////////////////////////////////////////////////////////////////////////////
697 #if DMD_ISDBT_STR_EN
698 DLL_PUBLIC extern MS_U32 MDrv_DMD_ISDBT_MD_SetPowerState(MS_U8 id, EN_POWER_MODE u16PowerState);
699 #endif
700 ////////////////////////////////////////////////////////////////////////////////
701 /// Get demod lock status
702 ////////////////////////////////////////////////////////////////////////////////
703 DLL_PUBLIC extern DMD_ISDBT_LOCK_STATUS MDrv_DMD_ISDBT_MD_GetLock(MS_U8 id, DMD_ISDBT_GETLOCK_TYPE eType);
704 ////////////////////////////////////////////////////////////////////////////////
705 /// Get demod modulation mode
706 ////////////////////////////////////////////////////////////////////////////////
707 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetModulationMode(MS_U8 id, EN_ISDBT_Layer eLayerIndex, sISDBT_MODULATION_MODE *sIsdbtModulationMode);
708 ////////////////////////////////////////////////////////////////////////////////
709 /// Get demod signal strength (IF AGC gain)
710 ////////////////////////////////////////////////////////////////////////////////
711 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetSignalStrength(MS_U8 id, MS_U16 *u16Strength);
712 ////////////////////////////////////////////////////////////////////////////////
713 /// Get demod frequency offset
714 ////////////////////////////////////////////////////////////////////////////////
715 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetFreqOffset(MS_U8 id, float *pFreqOff);
716 ////////////////////////////////////////////////////////////////////////////////
717 /// Get signal quality (post Viterbi BER)
718 ////////////////////////////////////////////////////////////////////////////////
719 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQuality(MS_U8 id);
720 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerA(MS_U8 id);
721 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerB(MS_U8 id);
722 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerC(MS_U8 id);
723 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityCombine(MS_U8 id);
724 ////////////////////////////////////////////////////////////////////////////////
725 /// Get demod SNR
726 ////////////////////////////////////////////////////////////////////////////////
727 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetSNR(MS_U8 id, float *f_snr);
728 ////////////////////////////////////////////////////////////////////////////////
729 /// Get demod pre Viterbi BER
730 ////////////////////////////////////////////////////////////////////////////////
731 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetPreViterbiBer(MS_U8 id, EN_ISDBT_Layer eLayerIndex, float *fber);
732 ////////////////////////////////////////////////////////////////////////////////
733 /// Get demod post Viterbi BER
734 ////////////////////////////////////////////////////////////////////////////////
735 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetPostViterbiBer(MS_U8 id, EN_ISDBT_Layer eLayerIndex, float *fber);
736 ////////////////////////////////////////////////////////////////////////////////
737 /// Get demod packet error
738 ////////////////////////////////////////////////////////////////////////////////
739 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_Read_PKT_ERR(MS_U8 id, EN_ISDBT_Layer eLayerIndex, MS_U16 *u16PacketErr);
740 ////////////////////////////////////////////////////////////////////////////////
741 /// Set TS output mode (only for external demod)
742 ////////////////////////////////////////////////////////////////////////////////
743 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetSerialControl(MS_U8 id, MS_U8 u8TsConfigData);
744 ////////////////////////////////////////////////////////////////////////////////
745 /// Enable I2C bypass mode (only for external demod)
746 ////////////////////////////////////////////////////////////////////////////////
747 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_IIC_BYPASS_MODE(MS_U8 id, MS_BOOL bEnable);
748 ////////////////////////////////////////////////////////////////////////////////
749 /// Switch pin to SSPI or GPIO (only for external demod)
750 ////////////////////////////////////////////////////////////////////////////////
751 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SWITCH_SSPI_GPIO(MS_U8 id, MS_BOOL bEnable);
752 ////////////////////////////////////////////////////////////////////////////////
753 /// Get GPIO pin high or low (only for external demod)
754 ////////////////////////////////////////////////////////////////////////////////
755 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GPIO_GET_LEVEL(MS_U8 id, MS_U8 u8Pin, MS_BOOL *bLevel);
756 ////////////////////////////////////////////////////////////////////////////////
757 /// Set GPIO pin high or low (only for external demod)
758 ////////////////////////////////////////////////////////////////////////////////
759 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GPIO_SET_LEVEL(MS_U8 id, MS_U8 u8Pin, MS_BOOL bLevel);
760 ////////////////////////////////////////////////////////////////////////////////
761 /// Set GPIO pin output or input (only for external demod)
762 ////////////////////////////////////////////////////////////////////////////////
763 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GPIO_OUT_ENABLE(MS_U8 id, MS_U8 u8Pin, MS_BOOL bEnableOut);
764 ////////////////////////////////////////////////////////////////////////////////
765 /// Swap ADC input (usually for external demod)
766 ////////////////////////////////////////////////////////////////////////////////
767 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_DoIQSwap(MS_U8 id, MS_BOOL bIsQPad);
768 
769 ////////////////////////////////////////////////////////////////////////////////
770 /// To get ISDBT's register  value, only for special purpose.\n
771 /// u16Addr       : the address of ISDBT's register\n
772 /// return the value of AFEC's register\n
773 ////////////////////////////////////////////////////////////////////////////////
774 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetReg(MS_U8 id, MS_U16 u16Addr, MS_U8 *pu8Data);
775 ////////////////////////////////////////////////////////////////////////////////
776 /// To set ISDBT's register value, only for special purpose.\n
777 /// u16Addr       : the address of ISDBT's register\n
778 /// u8Value       : the value to be set\n
779 ////////////////////////////////////////////////////////////////////////////////
780 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetReg(MS_U8 id, MS_U16 u16Addr, MS_U8 u8Data);
781 
782 #endif // #ifndef MSOS_TYPE_LINUX_KERNEL
783 
784 #ifdef UTPA2
785 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_SetDbgLevel(DMD_ISDBT_DbgLv u8DbgLevel);
786 DLL_PUBLIC extern DMD_ISDBT_Info* _MDrv_DMD_ISDBT_GetInfo(void);
787 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_GetLibVer(const MSIF_Version **ppVersion);
788 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_Init(MS_U8 id, DMD_ISDBT_InitData *pDMD_ISDBT_InitData, MS_U32 u32InitDataLen);
789 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_Exit(MS_U8 id);
790 DLL_PUBLIC extern MS_U32 _MDrv_DMD_ISDBT_MD_GetConfig(MS_U8 id, DMD_ISDBT_InitData *psDMD_ISDBT_InitData);
791 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_AdvSetConfig(MS_U8 id, DMD_ISDBT_DEMOD_TYPE eType, MS_BOOL bEnable);
792 #if DMD_ISDBT_STR_EN
793 DLL_PUBLIC extern MS_U32 _MDrv_DMD_ISDBT_MD_SetPowerState(MS_U8 id, EN_POWER_MODE u16PowerState);
794 #endif
795 DLL_PUBLIC extern DMD_ISDBT_LOCK_STATUS _MDrv_DMD_ISDBT_MD_GetLock(MS_U8 id, DMD_ISDBT_GETLOCK_TYPE eType);
796 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetModulationMode(MS_U8 id, EN_ISDBT_Layer eLayerIndex, sISDBT_MODULATION_MODE *sIsdbtModulationMode);
797 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetSignalStrength(MS_U8 id, MS_U16 *u16Strength);
798 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetFreqOffset(MS_U8 id, DMD_ISDBT_CFO_DATA *cfo);
799 DLL_PUBLIC extern MS_U16 _MDrv_DMD_ISDBT_MD_GetSignalQuality(MS_U8 id);
800 DLL_PUBLIC extern MS_U16 _MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerA(MS_U8 id);
801 DLL_PUBLIC extern MS_U16 _MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerB(MS_U8 id);
802 DLL_PUBLIC extern MS_U16 _MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerC(MS_U8 id);
803 DLL_PUBLIC extern MS_U16 _MDrv_DMD_ISDBT_MD_GetSignalQualityCombine(MS_U8 id);
804 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetSNR(MS_U8 id, DMD_ISDBT_SNR_DATA *f_snr);
805 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetPreViterbiBer(MS_U8 id, DMD_ISDBT_GET_BER_VALUE *ber);
806 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetPostViterbiBer(MS_U8 id, DMD_ISDBT_GET_BER_VALUE *ber);
807 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_Read_PKT_ERR(MS_U8 id, EN_ISDBT_Layer eLayerIndex, MS_U16 *u16PacketErr);
808 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_SetSerialControl(MS_U8 id, MS_U8 u8TsConfigData);
809 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_IIC_BYPASS_MODE(MS_U8 id, MS_BOOL bEnable);
810 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_SWITCH_SSPI_GPIO(MS_U8 id, MS_BOOL bEnable);
811 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GPIO_GET_LEVEL(MS_U8 id, MS_U8 u8Pin, MS_BOOL *bLevel);
812 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GPIO_SET_LEVEL(MS_U8 id, MS_U8 u8Pin, MS_BOOL bLevel);
813 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GPIO_OUT_ENABLE(MS_U8 id, MS_U8 u8Pin, MS_BOOL bEnableOut);
814 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_DoIQSwap(MS_U8 id, MS_BOOL bIsQPad);
815 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_GetReg(MS_U8 id, MS_U16 u16Addr, MS_U8 *pu8Data);
816 DLL_PUBLIC extern MS_BOOL _MDrv_DMD_ISDBT_MD_SetReg(MS_U8 id, MS_U16 u16Addr, MS_U8 u8Data);
817 #endif
818 
819 #ifdef __cplusplus
820 }
821 #endif
822 
823 #endif // _DRV_ISDBT_H_
824