xref: /utopia/UTPA2-700.0.x/projects/tmplib/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 /*! \defgroup Demod Demod module
103 
104  *! \defgroup ISDBT ISDBT interface (drvDMD_ISDBT.h)
105  *  \ingroup Demod
106 
107  *! \defgroup ISDBT_BASIC ISDBT basic control
108  *  \ingroup ISDBT
109 
110  *! \defgroup ISDBT_INFO ISDBT information
111  *  \ingroup ISDBT
112 
113  *! \defgroup ISDBT_STR ISDBT STR
114  *  \ingroup ISDBT
115 
116  *! \defgroup ISDBT_ToBeRemoved ISDBT API to be removed
117  *  \ingroup ISDBT
118  */
119 
120 #ifndef _DRV_ISDBT_H_
121 #define _DRV_ISDBT_H_
122 
123 //-------------------------------------------------------------------------------------------------
124 //  Driver Capability
125 //-------------------------------------------------------------------------------------------------
126 
127 #define DMD_ISDBT_UTOPIA_EN                  1
128 #define DMD_ISDBT_UTOPIA2_EN                 0
129 
130 #define DMD_ISDBT_STR_EN                     1
131 #define DMD_ISDBT_MULTI_THREAD_SAFE          0
132 #define DMD_ISDBT_MULTI_DMD_EN               1
133 
134 //-------------------------------------------------------------------------------------------------
135 //  Include Files
136 //-------------------------------------------------------------------------------------------------
137 
138 #include "MsTypes.h"
139 #if DMD_ISDBT_UTOPIA_EN || DMD_ISDBT_UTOPIA2_EN
140 #include "MsCommon.h"
141 #endif
142 #if DMD_ISDBT_UTOPIA2_EN || DMD_ISDBT_STR_EN
143 #include "utopia.h"
144 #endif
145 
146 //-------------------------------------------------------------------------------------------------
147 //  Driver Capability
148 //-------------------------------------------------------------------------------------------------
149 
150 
151 //-------------------------------------------------------------------------------------------------
152 //  Macro and Define
153 //-------------------------------------------------------------------------------------------------
154 
155 #ifndef DLL_PUBLIC
156 #define DLL_PUBLIC
157 #endif
158 
159 #if DMD_ISDBT_MULTI_DMD_EN
160 #define DMD_ISDBT_MAX_DEMOD_NUM          2
161 #else
162 #define DMD_ISDBT_MAX_DEMOD_NUM          1
163 #endif
164 
165 #if DMD_ISDBT_UTOPIA_EN || DMD_ISDBT_UTOPIA2_EN
166 #define MSIF_DMD_ISDBT_LIB_CODE          {'D','M','D','_','I','S','D','B','T','_'} //Lib code
167 #define MSIF_DMD_ISDBT_LIBVER            {'0','0'}                                 //LIB version
168 #define MSIF_DMD_ISDBT_BUILDNUM          {'0','0'}                                 //Build Number
169 #define MSIF_DMD_ISDBT_CHANGELIST        {'0','0','0','0','0','0','0','0'}         //P4 ChangeList Number
170 
171 #define DMD_ISDBT_VER                    /* Character String for DRV/API version             */  \
172     MSIF_TAG,                            /* 'MSIF'                                           */  \
173     MSIF_CLASS,                          /* '00'                                             */  \
174     MSIF_CUS,                            /* 0x0000                                           */  \
175     MSIF_MOD,                            /* 0x0000                                           */  \
176     MSIF_CHIP,                                                                                   \
177     MSIF_CPU,                                                                                    \
178     MSIF_DMD_ISDBT_LIB_CODE,             /* IP__                                             */  \
179     MSIF_DMD_ISDBT_LIBVER,               /* 0.0 ~ Z.Z                                        */  \
180     MSIF_DMD_ISDBT_BUILDNUM,             /* 00 ~ 99                                          */  \
181     MSIF_DMD_ISDBT_CHANGELIST,           /* CL#                                              */  \
182     MSIF_OS
183 #endif // #if DMD_ISDBT_UTOPIA_EN || DMD_ISDBT_UTOPIA2_EN
184 
185 #ifndef BIT_
186 #define BIT_(n)                             (1 << (n))
187 #endif
188 
189 #define DMD_ISDBT_LOCK_FSA_TRACK_LOCK       BIT_(0)
190 #define DMD_ISDBT_LOCK_PSYNC_LOCK           BIT_(1)
191 #define DMD_ISDBT_LOCK_ICFO_CH_EXIST_LOCK   BIT_(2)
192 #define DMD_ISDBT_LOCK_FEC_LOCK             BIT_(3)
193 
194 //-------------------------------------------------------------------------------------------------
195 //  Type and Structure
196 //-------------------------------------------------------------------------------------------------
197 
198 typedef enum
199 {
200     DMD_ISDBT_HAL_CMD_Exit = 0,
201     DMD_ISDBT_HAL_CMD_InitClk,
202     DMD_ISDBT_HAL_CMD_Download,
203     DMD_ISDBT_HAL_CMD_FWVERSION,
204     DMD_ISDBT_HAL_CMD_SoftReset,
205     DMD_ISDBT_HAL_CMD_SetACICoef,
206     DMD_ISDBT_HAL_CMD_SetISDBTMode,
207     DMD_ISDBT_HAL_CMD_SetModeClean,
208     DMD_ISDBT_HAL_CMD_Active,
209     DMD_ISDBT_HAL_CMD_Check_FEC_Lock,
210     DMD_ISDBT_HAL_CMD_Check_FSA_TRACK_Lock,
211     DMD_ISDBT_HAL_CMD_Check_PSYNC_Lock,
212     DMD_ISDBT_HAL_CMD_Check_ICFO_CH_EXIST_Lock,
213     DMD_ISDBT_HAL_CMD_GetSignalCodeRate,
214     DMD_ISDBT_HAL_CMD_GetSignalGuardInterval,
215     DMD_ISDBT_HAL_CMD_GetSignalTimeInterleaving,
216     DMD_ISDBT_HAL_CMD_GetSignalFFTValue,
217     DMD_ISDBT_HAL_CMD_GetSignalModulation,
218     DMD_ISDBT_HAL_CMD_ReadIFAGC,
219     DMD_ISDBT_HAL_CMD_GetFreqOffset,
220     DMD_ISDBT_HAL_CMD_GetSignalQuality,
221     DMD_ISDBT_HAL_CMD_GetSignalQualityOfLayerA,
222     DMD_ISDBT_HAL_CMD_GetSignalQualityOfLayerB,
223     DMD_ISDBT_HAL_CMD_GetSignalQualityOfLayerC,
224     DMD_ISDBT_HAL_CMD_GetSignalQualityCombine,
225     DMD_ISDBT_HAL_CMD_GetSNR,
226     DMD_ISDBT_HAL_CMD_GetPreViterbiBer,
227     DMD_ISDBT_HAL_CMD_GetPostViterbiBer,
228     DMD_ISDBT_HAL_CMD_Read_PKT_ERR,
229     DMD_ISDBT_HAL_CMD_TS_INTERFACE_CONFIG,
230     DMD_ISDBT_HAL_CMD_IIC_Bypass_Mode,
231     DMD_ISDBT_HAL_CMD_SSPI_TO_GPIO,
232     DMD_ISDBT_HAL_CMD_GPIO_GET_LEVEL,
233     DMD_ISDBT_HAL_CMD_GPIO_SET_LEVEL,
234     DMD_ISDBT_HAL_CMD_GPIO_OUT_ENABLE,
235     DMD_ISDBT_HAL_CMD_GET_REG,
236     DMD_ISDBT_HAL_CMD_SET_REG
237 } DMD_ISDBT_HAL_COMMAND;
238 
239 typedef enum
240 {
241     E_ISDBT_Layer_A = 0x00,
242     E_ISDBT_Layer_B = 0x01,
243     E_ISDBT_Layer_C = 0x02,
244     E_ISDBT_Layer_INVALID,
245 } EN_ISDBT_Layer;
246 
247 typedef enum
248 {
249     E_ISDBT_FFT_2K = 0x00,  /// 2K
250     E_ISDBT_FFT_4K = 0x01,  /// 4k
251     E_ISDBT_FFT_8K = 0x02,  /// 8k
252     E_ISDBT_FFT_INVALID,    /// invalid indicator
253 } EN_ISDBT_FFT_VAL;
254 
255 typedef enum
256 {
257     E_ISDBT_DQPSK   = 0,   /// DQPSK
258     E_ISDBT_QPSK    = 1,   /// QPSK
259     E_ISDBT_16QAM   = 2,   /// 16QAM
260     E_ISDBT_64QAM   = 3,   /// 64QAM
261     E_ISDBT_QAM_INVALID,   /// invalid indicator
262 } EN_ISDBT_CONSTEL_TYPE;
263 
264 typedef enum
265 {
266     E_ISDBT_CODERATE_1_2 = 0,   /// 1/2
267     E_ISDBT_CODERATE_2_3 = 1,   /// 2/3
268     E_ISDBT_CODERATE_3_4 = 2,   /// 3/4
269     E_ISDBT_CODERATE_5_6 = 3,   /// 5/6
270     E_ISDBT_CODERATE_7_8 = 4,   /// 7/8
271     E_ISDBT_CODERATE_INVALID,   /// invalid indicator
272 } EN_ISDBT_CODE_RATE;
273 
274 typedef enum
275 {
276     E_ISDBT_GUARD_INTERVAL_1_4  = 0,   /// 1/4
277     E_ISDBT_GUARD_INTERVAL_1_8  = 1,   /// 1/8
278     E_ISDBT_GUARD_INTERVAL_1_16 = 2,   /// 1/16
279     E_ISDBT_GUARD_INTERVAL_1_32 = 3,   /// 1/32
280     E_ISDBT_GUARD_INTERVAL_INVALID,    /// invalid indicator
281 } EN_ISDBT_GUARD_INTERVAL;
282 
283 typedef enum
284 {
285     // 2K mode
286     E_ISDBT_2K_TDI_0 = 0,   /// Tdi = 0
287     E_ISDBT_2K_TDI_4 = 1,   /// Tdi = 4
288     E_ISDBT_2K_TDI_8 = 2,   /// Tdi = 8
289     E_ISDBT_2K_TDI_16 = 3,  /// Tdi = 16
290     // 4K mode
291     E_ISDBT_4K_TDI_0 = 4,   /// Tdi = 0
292     E_ISDBT_4K_TDI_2 = 5,   /// Tdi = 2
293     E_ISDBT_4K_TDI_4 = 6,   /// Tdi = 4
294     E_ISDBT_4K_TDI_8 = 7,   /// Tdi = 8
295     // 8K mode
296     E_ISDBT_8K_TDI_0 = 8,   /// Tdi = 0
297     E_ISDBT_8K_TDI_1 = 9,   /// Tdi = 1
298     E_ISDBT_8K_TDI_2 = 10,  /// Tdi = 2
299     E_ISDBT_8K_TDI_4 = 11,  /// Tdi = 4
300     E_ISDBT_TDI_INVALID,    /// invalid indicator
301 } EN_ISDBT_TIME_INTERLEAVING;
302 
303 typedef struct _ISDBT_MODULATION_MODE
304 {
305     EN_ISDBT_CODE_RATE         eIsdbtCodeRate;
306     EN_ISDBT_GUARD_INTERVAL    eIsdbtGI;
307     EN_ISDBT_TIME_INTERLEAVING eIsdbtTDI;
308     EN_ISDBT_FFT_VAL           eIsdbtFFT;
309     EN_ISDBT_CONSTEL_TYPE      eIsdbtConstellation;
310 } sISDBT_MODULATION_MODE;
311 
312 typedef struct _DMD_ISDBT_GET_MODULATION
313 {
314     EN_ISDBT_Layer        eIsdbtLayer;
315     EN_ISDBT_CONSTEL_TYPE eConstellation;
316 } DMD_ISDBT_GET_MODULATION;
317 
318 typedef struct _DMD_ISDBT_GET_CodeRate
319 {
320     EN_ISDBT_Layer     eIsdbtLayer;
321     EN_ISDBT_CODE_RATE eCodeRate;
322 } DMD_ISDBT_GET_CodeRate;
323 
324 typedef struct _DMD_ISDBT_GET_TimeInterleaving
325 {
326     EN_ISDBT_Layer             eIsdbtLayer;
327     EN_ISDBT_TIME_INTERLEAVING eTimeInterleaving;
328 } DMD_ISDBT_GET_TimeInterleaving;
329 
330 typedef struct _DMD_ISDBT_GET_BER_VALUE
331 {
332     EN_ISDBT_Layer eIsdbtLayer;
333     float          fBerValue;
334 } DMD_ISDBT_GET_BER_VALUE;
335 
336 typedef struct _DMD_ISDBT_GET_PKT_ERR
337 {
338     EN_ISDBT_Layer eIsdbtLayer;
339     MS_U16         u16PacketErr;
340 } DMD_ISDBT_GET_PKT_ERR;
341 
342 typedef struct
343 {
344     MS_U8 u8Pin;
345     union
346     {
347         MS_BOOL bLevel;
348         MS_BOOL bIsOut;
349     };
350 } DMD_ISDBT_GPIO_PIN_DATA;
351 
352 typedef struct
353 {
354     MS_U16 u16Addr;
355     MS_U8  u8Data;
356 } DMD_ISDBT_REG_DATA;
357 
358 typedef enum
359 {
360     DMD_ISDBT_DBGLV_NONE,    // disable all the debug message
361     DMD_ISDBT_DBGLV_INFO,    // information
362     DMD_ISDBT_DBGLV_NOTICE,  // normal but significant condition
363     DMD_ISDBT_DBGLV_WARNING, // warning conditions
364     DMD_ISDBT_DBGLV_ERR,     // error conditions
365     DMD_ISDBT_DBGLV_CRIT,    // critical conditions
366     DMD_ISDBT_DBGLV_ALERT,   // action must be taken immediately
367     DMD_ISDBT_DBGLV_EMERG,   // system is unusable
368     DMD_ISDBT_DBGLV_DEBUG,   // debug-level messages
369 } DMD_ISDBT_DbgLv;
370 
371 typedef enum
372 {   DMD_ISDBT_DEMOD,
373     DMD_ISDBT_DEMOD_6M = DMD_ISDBT_DEMOD,
374     DMD_ISDBT_DEMOD_7M,
375     DMD_ISDBT_DEMOD_8M,
376     DMD_ISDBT_DEMOD_MAX,
377     DMD_ISDBT_DEMOD_NULL = DMD_ISDBT_DEMOD_MAX,
378 } DMD_ISDBT_DEMOD_TYPE;
379 
380 typedef enum
381 {
382     DMD_ISDBT_GETLOCK,
383     DMD_ISDBT_GETLOCK_FSA_TRACK_LOCK,
384     DMD_ISDBT_GETLOCK_PSYNC_LOCK,
385     DMD_ISDBT_GETLOCK_ICFO_CH_EXIST_LOCK,
386     DMD_ISDBT_GETLOCK_FEC_LOCK
387 } DMD_ISDBT_GETLOCK_TYPE;
388 
389 typedef enum
390 {
391     DMD_ISDBT_LOCK,
392     DMD_ISDBT_CHECKING,
393     DMD_ISDBT_CHECKEND,
394     DMD_ISDBT_UNLOCK,
395     DMD_ISDBT_NULL,
396 } DMD_ISDBT_LOCK_STATUS;
397 
398 /// For demod init
399 typedef struct
400 {
401     // init
402     MS_U16 u16ISDBTIcfoChExistCheckTime;
403     MS_U16 u16ISDBTFECLockCheckTime;
404 
405     // register init
406     MS_U8 *u8DMD_ISDBT_DSPRegInitExt; // TODO use system variable type
407     MS_U8 u8DMD_ISDBT_DSPRegInitSize;
408     MS_U8 *u8DMD_ISDBT_InitExt; // TODO use system variable type
409 
410     //By Tuners:
411     MS_U16  u16IF_KHZ;//By Tuners
412     MS_BOOL bIQSwap;//0
413     MS_U16  u16AgcReferenceValue;//0
414     MS_BOOL bTunerGainInvert;//0
415 
416     //By IC:
417     MS_BOOL bIsExtDemod;//0
418 
419     //By TS (Only for MCP or ext demod):
420     MS_U8 u1TsConfigByte_SerialMode : 1;
421     MS_U8 u1TsConfigByte_DataSwap   : 1;
422     MS_U8 u1TsConfigByte_ClockInv   : 1;
423     MS_U8 u5TsConfigByte_DivNum     : 5;
424 
425     //By SYS I2C (Only for MCP or ext demod):
426     MS_U8 u8I2CSlaveAddr;
427     MS_U8 u8I2CSlaveBus;
428     MS_BOOL (*I2C_WriteBytes)(MS_U16 u16BusNumSlaveID, MS_U8 u8addrcount, MS_U8* pu8addr, MS_U16 u16size, MS_U8* pu8data);
429     MS_BOOL (*I2C_ReadBytes)(MS_U16 u16BusNumSlaveID, MS_U8 u8AddrNum, MS_U8* paddr, MS_U16 u16size, MS_U8* pu8data);
430 
431     //By SYS MSPI (Only for MCP or ext demod):
432     MS_BOOL bIsUseSspiLoadCode;
433     MS_BOOL bIsSspiUseTsPin;
434 
435     //By SYS memory mapping (Only for int demod):
436     MS_U32 u32TdiStartAddr;
437 
438     #if !DMD_ISDBT_UTOPIA_EN && !DMD_ISDBT_UTOPIA2_EN
439     MS_U32  (*GetSystemTimeMS)(void);      // Get sys time (unit: ms)
440     void    (*DelayMS)(MS_U32 ms);         // Delay time (unit: ms)
441     MS_BOOL (*CreateMutex)(MS_BOOL enable); // Create&Delete mutex
442     void    (*LockDMD)(MS_BOOL enable);    // Enter&Leave mutex
443     #endif
444 } DMD_ISDBT_InitData;
445 
446 typedef struct
447 {
448     MS_BOOL bInit;
449     MS_BOOL bDownloaded;
450 
451     #if DMD_ISDBT_STR_EN
452     MS_BOOL              bIsDTV;
453     EN_POWER_MODE        eLastState;
454     #endif
455     DMD_ISDBT_DEMOD_TYPE eLastType;
456 
457     MS_BOOL (*HAL_DMD_ISDBT_IOCTL_CMD)(DMD_ISDBT_HAL_COMMAND eCmd, void *pPara);
458 } DMD_ISDBT_PriData;
459 
460 typedef struct
461 {
462     MS_U8  u8Version;
463     MS_U32 u32ISDBTScanTimeStart;
464     MS_U32 u32ISDBTFECLockTime;
465     MS_U32 u32ISDBTLockStatus;
466 } DMD_ISDBT_Info;
467 
468 typedef struct
469 {
470     DMD_ISDBT_InitData  sDMD_ISDBT_InitData;
471     DMD_ISDBT_PriData   sDMD_ISDBT_PriData;
472     DMD_ISDBT_Info      sDMD_ISDBT_Info;
473 } DMD_ISDBT_ResData;
474 
475 //-------------------------------------------------------------------------------------------------
476 //  Function and Variable
477 //-------------------------------------------------------------------------------------------------
478 
479 #ifdef __cplusplus
480 extern "C"
481 {
482 #endif
483 
484 //-------------------------------------------------------------------------------------------------
485 /// Set detailed level of ISDBT driver debug message
486 /// @ingroup ISDBT_BASIC
487 /// @param u8DbgLevel    \b IN: debug level for Parallel Flash driver
488 /// @return TRUE : succeed
489 /// @return FALSE : fail
490 //-------------------------------------------------------------------------------------------------
491 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetDbgLevel(DMD_ISDBT_DbgLv u8DbgLevel);
492 //-------------------------------------------------------------------------------------------------
493 /// Get the information of ISDBT driver
494 /// @ingroup ISDBT_INFO
495 /// @return : the pointer to the driver information
496 //-------------------------------------------------------------------------------------------------
497 // DLL_PUBLIC extern DMD_ISDBT_Info* MDrv_DMD_ISDBT_GetInfo(void);
498 //-------------------------------------------------------------------------------------------------
499 /// Get ISDBT driver version
500 /// @ingroup ISDBT_INFO
501 /// @param ppVersion    \b OUT: the pointer to the driver version
502 /// @return TRUE : succeed
503 /// @return FALSE : fail
504 //-------------------------------------------------------------------------------------------------
505 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetLibVer(const MSIF_Version **ppVersion);
506 //-------------------------------------------------------------------------------------------------
507 /// Initialize HAL interface
508 /// @ingroup ISDBT_BASIC
509 /// @return TRUE : succeed
510 /// @return FALSE : fail
511 //-------------------------------------------------------------------------------------------------
512 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Initial_Hal_Interface(void);
513 
514 ////////////////////////////////////////////////////////////////////////////////
515 ///                            SINGLE DEMOD API                              ///
516 ////////////////////////////////////////////////////////////////////////////////
517 
518 //-------------------------------------------------------------------------------------------------
519 /// Initialize ISDBT Demod
520 /// @ingroup ISDBT_BASIC
521 /// @param pDMD_ISDBT_InitData    \b IN: ISDBT initial parameters
522 /// @param u32InitDataLen        \b IN: size of ISDBT initial parameters
523 /// @return TRUE : succeed
524 /// @return FALSE : fail
525 //-------------------------------------------------------------------------------------------------
526 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Init(DMD_ISDBT_InitData *pDMD_ISDBT_InitData, MS_U32 u32InitDataLen);
527 //-------------------------------------------------------------------------------------------------
528 /// Exit ISDBT DTV mode
529 /// @ingroup ISDBT_STR
530 /// @return TRUE : succeed
531 /// @return FALSE : fail
532 //-------------------------------------------------------------------------------------------------
533 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Exit(void);
534 //-------------------------------------------------------------------------------------------------
535 /// Get FW version
536 /// @ingroup ISDBT_ToBeRemoved
537 /// @param pu16FwVer    \b OUT: the pointer to FW version
538 /// @return TRUE : succeed
539 /// @return FALSE : fail
540 //-------------------------------------------------------------------------------------------------
541 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetFwVer(MS_U16 *pu16FwVer);
542 //-------------------------------------------------------------------------------------------------
543 /// Reset FW state machine
544 /// @ingroup ISDBT_ToBeRemoved
545 /// @return TRUE : succeed
546 /// @return FALSE : fail
547 //-------------------------------------------------------------------------------------------------
548 DLL_PUBLIC extern void MDrv_DMD_ISDBT_SetReset(void);
549 //-------------------------------------------------------------------------------------------------
550 /// Set Demod mode and restart Demod
551 /// @ingroup ISDBT_BASIC
552 /// @param eType    \b IN: Select ISDBT modulation type
553 /// @param bEnable  \b IN: Enable SetConfig function
554 /// @return TRUE : succeed
555 /// @return FALSE : fail
556 //-------------------------------------------------------------------------------------------------
557 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_AdvSetConfig(DMD_ISDBT_DEMOD_TYPE eType, MS_BOOL bEnable);
558 //-------------------------------------------------------------------------------------------------
559 /// Set Demod mode and restart Demod
560 /// @ingroup ISDBT_BASIC
561 /// @param bEnable  \b IN: Enable SetConfig function
562 /// @return TRUE : succeed
563 /// @return FALSE : fail
564 //-------------------------------------------------------------------------------------------------
565 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetConfig(MS_BOOL bEnable);
566 //-------------------------------------------------------------------------------------------------
567 /// Active Demod
568 /// @ingroup ISDBT_ToBeRemoved
569 /// @param bEnable    \b IN: Active Demod if TRUE
570 /// @return TRUE : succeed
571 /// @return FALSE : fail
572 //-------------------------------------------------------------------------------------------------
573 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetActive(MS_BOOL bEnable);
574 //-------------------------------------------------------------------------------------------------
575 /// Support ISDBT STR function
576 /// @ingroup ISDBT_STR
577 /// @param u16PowerState    \b IN: Set STR status
578 /// @return : STR status
579 //-------------------------------------------------------------------------------------------------
580 #if DMD_ISDBT_STR_EN
581 DLL_PUBLIC extern MS_U32 MDrv_DMD_ISDBT_SetPowerState(EN_POWER_MODE u16PowerState);
582 #endif
583 //-------------------------------------------------------------------------------------------------
584 /// Get lock status
585 /// @ingroup ISDBT_INFO
586 /// @param eType    \b IN: select lock type
587 /// @return : lock status
588 //-------------------------------------------------------------------------------------------------
589 DLL_PUBLIC extern DMD_ISDBT_LOCK_STATUS MDrv_DMD_ISDBT_GetLock(DMD_ISDBT_GETLOCK_TYPE eType);
590 //-------------------------------------------------------------------------------------------------
591 /// Get modulation mode
592 /// @ingroup ISDBT_INFO
593 /// @param eLayerIndex    \b IN: layer index
594 /// @param sIsdbtModulationMode    \b OUT: the pointer to ISDBT modulation mode
595 /// @return TRUE : succeed
596 /// @return FALSE : fail
597 //-------------------------------------------------------------------------------------------------
598 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetModulationMode(EN_ISDBT_Layer eLayerIndex, sISDBT_MODULATION_MODE *sIsdbtModulationMode);
599 //-------------------------------------------------------------------------------------------------
600 /// Get Demod signal strength (IF AGC gain)
601 /// @ingroup ISDBT_INFO
602 /// @param u16Strength    \b OUT: the pointer to signal strength
603 /// @return TRUE : succeed
604 /// @return FALSE : fail
605 //-------------------------------------------------------------------------------------------------
606 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetSignalStrength(MS_U16 *u16Strength);
607 //-------------------------------------------------------------------------------------------------
608 /// Get Demod frequency offset
609 /// @ingroup ISDBT_INFO
610 /// @param pFreqOff    \b OUT: the pointer to CFO
611 /// @return TRUE : succeed
612 /// @return FALSE : fail
613 //-------------------------------------------------------------------------------------------------
614 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetFreqOffset(float *pFreqOff);
615 //-------------------------------------------------------------------------------------------------
616 /// Get Demod signal quality
617 /// @ingroup ISDBT_INFO
618 /// @return : signal quality
619 //-------------------------------------------------------------------------------------------------
620 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQuality(void);
621 //-------------------------------------------------------------------------------------------------
622 /// Get Demod layerA signal quality
623 /// @ingroup ISDBT_INFO
624 /// @return : signal quality
625 //-------------------------------------------------------------------------------------------------
626 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityOfLayerA(void);
627 //-------------------------------------------------------------------------------------------------
628 /// Get Demod layerB signal quality
629 /// @ingroup ISDBT_INFO
630 /// @return : signal quality
631 //-------------------------------------------------------------------------------------------------
632 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityOfLayerB(void);
633 //-------------------------------------------------------------------------------------------------
634 /// Get Demod layerC signal quality
635 /// @ingroup ISDBT_INFO
636 /// @return : signal quality
637 //-------------------------------------------------------------------------------------------------
638 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityOfLayerC(void);
639 //-------------------------------------------------------------------------------------------------
640 /// Get Demod Combine signal quality
641 /// @ingroup ISDBT_INFO
642 /// @return : signal quality
643 //-------------------------------------------------------------------------------------------------
644 DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_GetSignalQualityCombine(void);
645 //-------------------------------------------------------------------------------------------------
646 /// Get SNR
647 /// @ingroup ISDBT_INFO
648 /// @param pf_snr    \b OUT: the pointer to SNR
649 /// @return TRUE : succeed
650 /// @return FALSE : fail
651 //-------------------------------------------------------------------------------------------------
652 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetSNR(float *pf_snr);
653 //-------------------------------------------------------------------------------------------------
654 /// Get Demod pre Viterbi number
655 /// @ingroup ISDBT_INFO
656 /// @param eLayerIndex    \b IN: layer index
657 /// @param fber    \b OUT: the pointer to pre Viterbi BER
658 /// @return TRUE : succeed
659 /// @return FALSE : fail
660 //-------------------------------------------------------------------------------------------------
661 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetPreViterbiBer(EN_ISDBT_Layer eLayerIndex, float *fber);
662 //-------------------------------------------------------------------------------------------------
663 /// Get Demod post Viterbi number
664 /// @ingroup ISDBT_INFO
665 /// @param eLayerIndex    \b IN: layer index
666 /// @param fber    \b OUT: the pointer to post Viterbi BER
667 /// @return TRUE : succeed
668 /// @return FALSE : fail
669 //-------------------------------------------------------------------------------------------------
670 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetPostViterbiBer(EN_ISDBT_Layer eLayerIndex, float *fber);
671 //-------------------------------------------------------------------------------------------------
672 /// Get Demod packet error number
673 /// @ingroup ISDBT_INFO
674 /// @param eLayerIndex    \b IN: layer index
675 /// @param u16PacketErr    \b OUT: the pointer to packet error number
676 /// @return TRUE : succeed
677 /// @return FALSE : fail
678 //-------------------------------------------------------------------------------------------------
679 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_Read_PKT_ERR(EN_ISDBT_Layer eLayerIndex, MS_U16 *u16PacketErr);
680 //-------------------------------------------------------------------------------------------------
681 /// Set TS output mode
682 /// @ingroup ISDBT_BASIC
683 /// @param u8TsConfigData    \b IN: TS configuration
684 /// @return TRUE : succeed
685 /// @return FALSE : fail
686 //-------------------------------------------------------------------------------------------------
687 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetSerialControl(MS_U8 u8TsConfigData);
688 //-------------------------------------------------------------------------------------------------
689 /// Enable I2C bypass mode
690 /// @ingroup ISDBT_BASIC
691 /// @param bEnable    \b IN: Enable bypass mode
692 /// @return TRUE : succeed
693 /// @return FALSE : fail
694 //-------------------------------------------------------------------------------------------------
695 DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_IIC_BYPASS_MODE(MS_BOOL bEnable);
696 //-------------------------------------------------------------------------------------------------
697 /// Set SSPI pin as GPIO function
698 /// @ingroup ISDBT_BASIC
699 /// @param bEnable    \b IN: Switch to GPIO if TRUE, otherwise SSPI
700 /// @return TRUE : succeed
701 /// @return FALSE : fail
702 //-------------------------------------------------------------------------------------------------
703 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SWITCH_SSPI_GPIO(MS_BOOL bEnable);
704 //-------------------------------------------------------------------------------------------------
705 /// Get GPIO level
706 /// @ingroup ISDBT_BASIC
707 /// @param u8Pin    \b IN: Select pin number
708 /// @param bLevel    \b OUT: the pointer to GPIO level
709 /// @return TRUE : succeed
710 /// @return FALSE : fail
711 //-------------------------------------------------------------------------------------------------
712 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GPIO_GET_LEVEL(MS_U8 u8Pin, MS_BOOL *bLevel);
713 //-------------------------------------------------------------------------------------------------
714 /// Set GPIO level
715 /// @ingroup ISDBT_BASIC
716 /// @param u8Pin    \b IN: Select pin number
717 /// @param bLevel    \b IN: Set GPIO level
718 /// @return TRUE : succeed
719 /// @return FALSE : fail
720 //-------------------------------------------------------------------------------------------------
721 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GPIO_SET_LEVEL(MS_U8 u8Pin, MS_BOOL bLevel);
722 //-------------------------------------------------------------------------------------------------
723 /// Set GPIO as output or input
724 /// @ingroup ISDBT_BASIC
725 /// @param u8Pin    \b IN: Select pin number
726 /// @param bEnableOut    \b IN: output if TRUE, otherwise input
727 /// @return TRUE : succeed
728 /// @return FALSE : fail
729 //-------------------------------------------------------------------------------------------------
730 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GPIO_OUT_ENABLE(MS_U8 u8Pin, MS_BOOL bEnableOut);
731 //-------------------------------------------------------------------------------------------------
732 /// Get Demod register value
733 /// @ingroup ISDBT_BASIC
734 /// @param u16Addr    \b IN: register address
735 /// @param pu8Data    \b OUT: the pointer to register data
736 /// @return TRUE : succeed
737 /// @return FALSE : fail
738 //-------------------------------------------------------------------------------------------------
739 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_GetReg(MS_U16 u16Addr, MS_U8 *pu8Data);
740 //-------------------------------------------------------------------------------------------------
741 /// Set Demod register value
742 /// @ingroup ISDBT_BASIC
743 /// @param u16Addr    \b IN: register address
744 /// @param u8Data    \b IN: register data
745 /// @return TRUE : succeed
746 /// @return FALSE : fail
747 //-------------------------------------------------------------------------------------------------
748 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_SetReg(MS_U16 u16Addr, MS_U8 u8Data);
749 
750 ////////////////////////////////////////////////////////////////////////////////
751 ///                            MULTI DEMOD API                              ///
752 ////////////////////////////////////////////////////////////////////////////////
753 
754 //-------------------------------------------------------------------------------------------------
755 /// Initialize multiple ISDBT Demod
756 /// @ingroup ISDBT_BASIC
757 /// @param id                    \b IN: Select Demod number
758 /// @param pDMD_ISDBT_InitData    \b IN: ISDBT initial parameters
759 /// @param u32InitDataLen        \b IN: size of ISDBT initial parameters
760 /// @return TRUE : succeed
761 /// @return FALSE : fail
762 //-------------------------------------------------------------------------------------------------
763 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_Init(MS_U8 id, DMD_ISDBT_InitData *pDMD_ISDBT_InitData, MS_U32 u32InitDataLen);
764 //-------------------------------------------------------------------------------------------------
765 /// Support multiple Demod of exiting ISDBT DTV mode
766 /// @ingroup ISDBT_STR
767 /// @param id    \b IN: Select Demod number
768 /// @return TRUE : succeed
769 /// @return FALSE : fail
770 //-------------------------------------------------------------------------------------------------
771 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_Exit(MS_U8 id);
772 //-------------------------------------------------------------------------------------------------
773 /// Support multiple Demod of getting FW version
774 /// @ingroup ISDBT_ToBeRemoved
775 /// @param id    \b IN: Select Demod number
776 /// @param pu16FwVer    \b OUT: the pointer to FW version
777 /// @return TRUE : succeed
778 /// @return FALSE : fail
779 //-------------------------------------------------------------------------------------------------
780 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetFwVer(MS_U8 id, MS_U16 *pu16FwVer);
781 //-------------------------------------------------------------------------------------------------
782 /// Support multiple Demod of resetting FW state machine
783 /// @ingroup ISDBT_ToBeRemoved
784 /// @param id    \b IN: Select Demod number
785 /// @return TRUE : succeed
786 /// @return FALSE : fail
787 //-------------------------------------------------------------------------------------------------
788 // DLL_PUBLIC extern void MDrv_DMD_ISDBT_MD_SetReset(MS_U8 id);
789 //-------------------------------------------------------------------------------------------------
790 /// Support multiple Demod of setting and restarting Demod
791 /// @ingroup ISDBT_BASIC
792 /// @param id    \b IN: Select Demod number
793 /// @param eType    \b IN: Select ISDBT modulation type
794 /// @param bEnable  \b IN: Enable SetConfig function
795 /// @return TRUE : succeed
796 /// @return FALSE : fail
797 //-------------------------------------------------------------------------------------------------
798 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_AdvSetConfig(MS_U8 id, DMD_ISDBT_DEMOD_TYPE eType, MS_BOOL bEnable);
799 //-------------------------------------------------------------------------------------------------
800 /// Support multiple Demod of setting and restarting Demod
801 /// @ingroup ISDBT_BASIC
802 /// @param id    \b IN: Select Demod number
803 /// @param bEnable  \b IN: Enable SetConfig function
804 /// @return TRUE : succeed
805 /// @return FALSE : fail
806 //-------------------------------------------------------------------------------------------------
807 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetConfig(MS_U8 id, MS_BOOL bEnable);
808 //-------------------------------------------------------------------------------------------------
809 /// Active Demod
810 /// @ingroup ISDBT_ToBeRemoved
811 /// @param id    \b IN: Select Demod number
812 /// @param bEnable    \b IN: Active Demod if TRUE
813 /// @return TRUE : succeed
814 /// @return FALSE : fail
815 //-------------------------------------------------------------------------------------------------
816 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetActive(MS_U8 id, MS_BOOL bEnable);
817 //-------------------------------------------------------------------------------------------------
818 /// Support multiple Demod of ISDBT STR function
819 /// @ingroup ISDBT_STR
820 /// @param id    \b IN: Select Demod number
821 /// @param u16PowerState    \b IN: Set STR status
822 /// @return : STR status
823 //-------------------------------------------------------------------------------------------------
824 #if DMD_ISDBT_STR_EN
825 // DLL_PUBLIC extern MS_U32 MDrv_DMD_ISDBT_MD_SetPowerState(MS_U8 id, EN_POWER_MODE u16PowerState);
826 #endif
827 //-------------------------------------------------------------------------------------------------
828 /// Support multiple Demod of getting lock status
829 /// @ingroup ISDBT_INFO
830 /// @param id    \b IN: Select Demod number
831 /// @param eType    \b IN: select lock type
832 /// @return : lock status
833 //-------------------------------------------------------------------------------------------------
834 // DLL_PUBLIC extern DMD_ISDBT_LOCK_STATUS MDrv_DMD_ISDBT_MD_GetLock(MS_U8 id, DMD_ISDBT_GETLOCK_TYPE eType);
835 //-------------------------------------------------------------------------------------------------
836 /// Support multiple Demod of getting modulation mode
837 /// @ingroup ISDBT_INFO
838 /// @param id    \b IN: Select Demod number
839 /// @param eLayerIndex    \b IN: layer index
840 /// @param sIsdbtModulationMode    \b OUT: the pointer to ISDBT modulation mode
841 /// @return TRUE : succeed
842 /// @return FALSE : fail
843 //-------------------------------------------------------------------------------------------------
844 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetModulationMode(MS_U8 id, EN_ISDBT_Layer eLayerIndex, sISDBT_MODULATION_MODE *sIsdbtModulationMode);
845 //-------------------------------------------------------------------------------------------------
846 /// Support multiple Demod of getting Demod signal strength (IF AGC gain)
847 /// @ingroup ISDBT_INFO
848 /// @param id    \b IN: Select Demod number
849 /// @param u16Strength    \b OUT: the pointer to signal strength
850 /// @return TRUE : succeed
851 /// @return FALSE : fail
852 //-------------------------------------------------------------------------------------------------
853 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetSignalStrength(MS_U8 id, MS_U16 *u16Strength);
854 //-------------------------------------------------------------------------------------------------
855 /// Support multiple Demod of getting Demod fequency offset
856 /// @ingroup ISDBT_INFO
857 /// @param id    \b IN: Select Demod number
858 /// @param pFreqOff    \b OUT: the pointer to CFO
859 /// @return TRUE : succeed
860 /// @return FALSE : fail
861 //-------------------------------------------------------------------------------------------------
862 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetFreqOffset(MS_U8 id, float *pFreqOff);
863 //-------------------------------------------------------------------------------------------------
864 /// Support multiple Demod of getting Demod signal quality
865 /// @ingroup ISDBT_INFO
866 /// @param id    \b IN: Select Demod number
867 /// @return : signal quality
868 //-------------------------------------------------------------------------------------------------
869 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQuality(MS_U8 id);
870 //-------------------------------------------------------------------------------------------------
871 /// Support multiple Demod of getting Demod layerA signal quality
872 /// @ingroup ISDBT_INFO
873 /// @param id    \b IN: Select Demod number
874 /// @return : signal quality
875 //-------------------------------------------------------------------------------------------------
876 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerA(MS_U8 id);
877 //-------------------------------------------------------------------------------------------------
878 /// Support multiple Demod of getting Demod layerB signal quality
879 /// @ingroup ISDBT_INFO
880 /// @param id    \b IN: Select Demod number
881 /// @return : signal quality
882 //-------------------------------------------------------------------------------------------------
883 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerB(MS_U8 id);
884 //-------------------------------------------------------------------------------------------------
885 /// Support multiple Demod of getting Demod layerC signal quality
886 /// @ingroup ISDBT_INFO
887 /// @param id    \b IN: Select Demod number
888 /// @return : signal quality
889 //-------------------------------------------------------------------------------------------------
890 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityOfLayerC(MS_U8 id);
891 //-------------------------------------------------------------------------------------------------
892 /// Support multiple Demod of getting Demod combine signal quality
893 /// @ingroup ISDBT_INFO
894 /// @param id    \b IN: Select Demod number
895 /// @return : signal quality
896 //-------------------------------------------------------------------------------------------------
897 // DLL_PUBLIC extern MS_U16 MDrv_DMD_ISDBT_MD_GetSignalQualityCombine(MS_U8 id);
898 //-------------------------------------------------------------------------------------------------
899 /// Support multiple Demod of getting SNR
900 /// @ingroup ISDBT_INFO
901 /// @param id    \b IN: Select Demod number
902 /// @param pf_snr    \b OUT: the pointer to SNR
903 /// @return TRUE : succeed
904 /// @return FALSE : fail
905 //-------------------------------------------------------------------------------------------------
906 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetSNR(MS_U8 id, float *pf_snr);
907 //-------------------------------------------------------------------------------------------------
908 /// Support multiple Demod of getting Demod pre Viterbi number
909 /// @ingroup ISDBT_INFO
910 /// @param id    \b IN: Select Demod number
911 /// @param eLayerIndex    \b IN: layer index
912 /// @param fber    \b OUT: the pointer to BER
913 /// @return TRUE : succeed
914 /// @return FALSE : fail
915 //-------------------------------------------------------------------------------------------------
916 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetPreViterbiBer(MS_U8 id, EN_ISDBT_Layer eLayerIndex, float *fber);
917 //-------------------------------------------------------------------------------------------------
918 /// Support multiple Demod of getting Demod post Viterbi number
919 /// @ingroup ISDBT_INFO
920 /// @param id    \b IN: Select Demod number
921 /// @param eLayerIndex    \b IN: layer index
922 /// @param fber    \b OUT: the pointer to BER
923 /// @return TRUE : succeed
924 /// @return FALSE : fail
925 //-------------------------------------------------------------------------------------------------
926 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetPostViterbiBer(MS_U8 id, EN_ISDBT_Layer eLayerIndex, float *fber);
927 //-------------------------------------------------------------------------------------------------
928 /// Support multiple Demod of getting Demod packet error number
929 /// @ingroup ISDBT_INFO
930 /// @param id    \b IN: Select Demod number
931 /// @param eLayerIndex    \b IN: layer index
932 /// @param u16PacketErr    \b OUT: the pointer to packet error number
933 /// @return TRUE : succeed
934 /// @return FALSE : fail
935 //-------------------------------------------------------------------------------------------------
936 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_Read_PKT_ERR(MS_U8 id, EN_ISDBT_Layer eLayerIndex, MS_U16 *u16PacketErr);
937 //-------------------------------------------------------------------------------------------------
938 /// Support multiple Demod of setting TS output mode
939 /// @ingroup ISDBT_BASIC
940 /// @param id    \b IN: Select Demod number
941 /// @param u8TsConfigData    \b IN: TS configuration
942 /// @return TRUE : succeed
943 /// @return FALSE : fail
944 //-------------------------------------------------------------------------------------------------
945 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetSerialControl(MS_U8 id, MS_U8 u8TsConfigData);
946 //-------------------------------------------------------------------------------------------------
947 /// Support multiple Demod of enabling I2C bypass mode
948 /// @ingroup ISDBT_BASIC
949 /// @param id    \b IN: Select Demod number
950 /// @param bEnable    \b IN: Enable bypass mode
951 /// @return TRUE : succeed
952 /// @return FALSE : fail
953 //-------------------------------------------------------------------------------------------------
954 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_IIC_BYPASS_MODE(MS_U8 id, MS_BOOL bEnable);
955 //-------------------------------------------------------------------------------------------------
956 /// Support multiple Demod of setting SSPI pin as GPIO function
957 /// @ingroup ISDBT_BASIC
958 /// @param id    \b IN: Select Demod number
959 /// @param bEnable    \b IN: Switch to GPIO if TRUE, otherwise SSPI
960 /// @return TRUE : succeed
961 /// @return FALSE : fail
962 //-------------------------------------------------------------------------------------------------
963 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SWITCH_SSPI_GPIO(MS_U8 id, MS_BOOL bEnable);
964 //-------------------------------------------------------------------------------------------------
965 /// Support multiple Demod of getting GPIO level
966 /// @ingroup ISDBT_BASIC
967 /// @param id    \b IN: Select Demod number
968 /// @param u8Pin    \b IN: Select pin number
969 /// @param bLevel    \b OUT: the pointer to GPIO level
970 /// @return TRUE : succeed
971 /// @return FALSE : fail
972 //-------------------------------------------------------------------------------------------------
973 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GPIO_GET_LEVEL(MS_U8 id, MS_U8 u8Pin, MS_BOOL *bLevel);
974 //-------------------------------------------------------------------------------------------------
975 /// Support multiple Demod of setting GPIO level
976 /// @ingroup ISDBT_BASIC
977 /// @param id    \b IN: Select Demod number
978 /// @param u8Pin    \b IN: Select pin number
979 /// @param bLevel    \b IN: Set GPIO level
980 /// @return TRUE : succeed
981 /// @return FALSE : fail
982 //-------------------------------------------------------------------------------------------------
983 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GPIO_SET_LEVEL(MS_U8 id, MS_U8 u8Pin, MS_BOOL bLevel);
984 //-------------------------------------------------------------------------------------------------
985 /// Support multiple Demod of setting GPIO as output or input
986 /// @ingroup ISDBT_BASIC
987 /// @param id    \b IN: Select Demod number
988 /// @param u8Pin    \b IN: Select pin number
989 /// @param bEnableOut    \b IN: output if TRUE, otherwise input
990 /// @return TRUE : succeed
991 /// @return FALSE : fail
992 //-------------------------------------------------------------------------------------------------
993 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GPIO_OUT_ENABLE(MS_U8 id, MS_U8 u8Pin, MS_BOOL bEnableOut);
994 //-------------------------------------------------------------------------------------------------
995 /// Support multiple Demod of getting Demod register value
996 /// @ingroup ISDBT_BASIC
997 /// @param id    \b IN: Select Demod number
998 /// @param u16Addr    \b IN: register address
999 /// @param pu8Data    \b OUT: the pointer to get register data
1000 /// @return TRUE : succeed
1001 /// @return FALSE : fail
1002 //-------------------------------------------------------------------------------------------------
1003 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_GetReg(MS_U8 id, MS_U16 u16Addr, MS_U8 *pu8Data);
1004 //-------------------------------------------------------------------------------------------------
1005 /// Support multiple Demod of setting Demod register value
1006 /// @ingroup ISDBT_BASIC
1007 /// @param id    \b IN: Select Demod number
1008 /// @param u16Addr    \b IN: register address
1009 /// @param u8Data    \b IN: register data
1010 /// @return TRUE : succeed
1011 /// @return FALSE : fail
1012 //-------------------------------------------------------------------------------------------------
1013 // DLL_PUBLIC extern MS_BOOL MDrv_DMD_ISDBT_MD_SetReg(MS_U8 id, MS_U16 u16Addr, MS_U8 u8Data);
1014 
1015 #ifdef __cplusplus
1016 }
1017 #endif
1018 
1019 #endif // _DRV_ISDBT_H_
1020