source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/thd/bthd.h @ 32

Last change on this file since 32 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 70.9 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2005-2012, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bthd.h $
11 * $brcm_Revision: Hydra_Software_Devel/58 $
12 * $brcm_Date: 2/7/12 5:07p $
13 *
14 * [File Description:]
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/thd/bthd.h $
19 *
20 * Hydra_Software_Devel/58   2/7/12 5:07p atanugul
21 * SW3461-144: Change signalstrength units to 1/100th of a dBmV
22 *
23 * Hydra_Software_Devel/57   2/2/12 6:22p atanugul
24 * SW3461-141: Implement new apis for SetAcquireParams, GetAcquireParams
25 * and PowerUp
26 *
27 * Hydra_Software_Devel/56   1/23/12 2:24p atanugul
28 * SW3461-136: Fix signalstrength units
29 *
30 * Hydra_Software_Devel/55   1/19/12 4:59p atanugul
31 * SW3461-135: Add auto acquire on tune support for 3461
32 *
33 * Hydra_Software_Devel/54   1/13/12 3:25p atanugul
34 * SW3461-133: Add SignalLevelPercent and SignalQualityPercent to THD and
35 * TC2 PIs
36 *
37 * Hydra_Software_Devel/53   11/16/11 12:06p atanugul
38 * SW3461-79: Add No Signal to GetThdLockStatus()
39 *
40 * Hydra_Software_Devel/52   10/5/11 5:07p atanugul
41 * SW3461-3: Update description for BTHD_GetVersion() and
42 * BTHD_GetChipRevision()
43 *
44 * Hydra_Software_Devel/51   8/12/11 12:35p farshidf
45 * SWDTV-8160: add the DQPSK enum
46 *
47 * Hydra_Software_Devel/50   7/25/11 4:22p farshidf
48 * SWDTV-7399: new mode added for GuardMode to support more mode  in ISDBT
49 *
50 * Hydra_Software_Devel/49   6/10/11 12:15p farshidf
51 * SW7552-36: add a new flag for ISDBT support
52 *
53 * Hydra_Software_Devel/48   6/1/11 3:38p atanugul
54 * SW3461-5: Add THD support to 3461
55 *
56 * Hydra_Software_Devel/47   4/27/11 12:14p farshidf
57 * SWDTV-6190: add the Nexus BBS interface
58 *
59 * Hydra_Software_Devel/46   5/18/10 3:50p farshidf
60 * SW7550-440: add GetThdLockStatus
61 *
62 * Hydra_Software_Devel/SW7550-399/1   5/6/10 6:16p farshidf
63 * SW7550-399: add the mini tune while we are lock
64 *
65 * Hydra_Software_Devel/45   3/2/10 4:26p farshidf
66 * SW7550-38: merge from branch auto
67 *
68 * Hydra_Software_Devel/THD_7550_Auto/3   3/2/10 4:23p farshidf
69 * SW7550-38: miss type
70 *
71 * Hydra_Software_Devel/THD_7550_Auto/2   2/3/10 5:39p farshidf
72 * SW7550-38: add the scan mode
73 *
74 * Hydra_Software_Devel/THD_7550_Auto/1   2/1/10 6:04p farshidf
75 * SW7550-38: initinal ISDB-T channel scan
76 *
77 * Hydra_Software_Devel/44   1/13/10 6:08p dliu
78 * SW3556-972: Add optiont to turn off IF AGC
79 *
80 * Hydra_Software_Devel/43   11/6/09 5:53p farshidf
81 * SW7550-38: match Nexus changes
82 *
83 * Hydra_Software_Devel/42   11/6/09 10:53a farshidf
84 * SW7550-38: compile fix
85 *
86 * Hydra_Software_Devel/41   11/6/09 9:40a farshidf
87 * SW7550-38: update the inband and status structure to support ISDB-T
88 *
89 * Hydra_Software_Devel/40   11/5/09 3:32p farshidf
90 * SW7550-38: compile issue
91 *
92 * Hydra_Software_Devel/39   11/5/09 2:16p farshidf
93 * SW7550-38: API changes for 7550
94 * PR41450: remove status event
95 * PR41450: move down the timer settings
96 * PR41450: remove Dynamic settings
97 * PR41450: add the memory look up for BBS dynamic param
98 * PR41450: add the update Aquire param settings
99 * PR57150: Implement THD under Nexus without the AP
100 *
101 * Hydra_Software_Devel/38   8/7/09 12:14p katrep
102 * PR57520: Checkin the THD code recived from Dallas for phase 6.5 release
103 *
104 * Hydra_Software_Devel/37   6/17/09 3:32p dliu
105 * PR56100: Add IFD agc settings
106 *
107 * Hydra_Software_Devel/36   5/15/09 3:51p dliu
108 * PR53570: Add option for fast/slow acquistion
109 *
110 * Hydra_Software_Devel/35   5/14/09 10:08p dliu
111 * PR55008: Add options to invert delta sigma
112 *
113 * Hydra_Software_Devel/34   4/27/09 5:25p dliu
114 * PR54218: Add instantaneous VitBER
115 *
116 * Hydra_Software_Devel/33   3/24/09 2:18p dliu
117 * PR53540: Add support for SECAM-L (prime)
118 *
119 * Hydra_Software_Devel/32   3/16/09 1:42p dliu
120 * PR53095: Add cell_id to THD status
121 *
122 * Hydra_Software_Devel/PR57150/7   11/5/09 2:07p farshidf
123 * SW7550-38: API changes for 7550
124 *
125 * Hydra_Software_Devel/PR57150/6   11/3/09 2:29p farshidf
126 * PR41450: remove status event
127 *
128 * Hydra_Software_Devel/PR57150/5   11/1/09 2:13p farshidf
129 * PR41450: move down the timer settings
130 *
131 * Hydra_Software_Devel/PR57150/4   10/8/09 6:13p farshidf
132 * PR41450: remove Dynamic settings
133 *
134 * Hydra_Software_Devel/PR57150/3   10/7/09 4:59p farshidf
135 * PR41450: add the memory look up for BBS dynamic param
136 *
137 * Hydra_Software_Devel/PR57150/2   9/30/09 3:31p farshidf
138 * PR41450: add the update Aquire param settings
139 *
140 * Hydra_Software_Devel/PR57150/1   7/28/09 2:14p farshidf
141 * PR57150: Implement THD under Nexus without the AP
142 *
143 * Hydra_Software_Devel/31   2/27/09 5:20p dliu
144 * PR52629: Add spectrum inversion bit
145 *
146 * Hydra_Software_Devel/30   2/17/09 10:24a dliu
147 * PR52131: Add e to audio deviation enum
148 *
149 * Hydra_Software_Devel/29   2/16/09 1:44p dliu
150 * PR52131: Add medium deviation
151 *
152 * Hydra_Software_Devel/28   11/24/08 4:30p dliu
153 * PR49627: Add high deviation
154 *
155 * Hydra_Software_Devel/27   11/3/08 3:11p dliu
156 * PR48626: Add pre/post RS viterbi error rate
157 *
158 * Hydra_Software_Devel/26   9/30/08 12:06p dliu
159 * PR46516: Add power managment error flag
160 *
161 * Hydra_Software_Devel/25   9/29/08 2:05p dliu
162 * PR46539: Add dynamic power API
163 *
164 * Hydra_Software_Devel/24   9/17/08 9:48a dliu
165 * PR47011: Add no-signal detect flag
166 *
167 * Hydra_Software_Devel/23   8/13/08 5:04p dliu
168 * PR38944: Change SetIfdAudioSettings to pass in const pointer
169 *
170 * Hydra_Software_Devel/22   8/8/08 2:56p dliu
171 * PR38944: Change SetIfdAudioSettings function to use pointers
172 *
173 * Hydra_Software_Devel/21   8/6/08 4:55p dliu
174 * PR38934: Add functions and parameters for AASD
175 *
176 * Hydra_Software_Devel/20   7/30/08 2:32p dliu
177 * PR45192: Change function name
178 *
179 * Hydra_Software_Devel/19   7/30/08 12:54p dliu
180 * PR45192: Add default functions to header
181 *
182 * Hydra_Software_Devel/18   7/28/08 4:01p dliu
183 * PR45192: Add GetDefault functions to api list
184 *
185 * Hydra_Software_Devel/17   7/25/08 5:43p dliu
186 * PR45002: Add QAM Mode and code rate as input parameter to acquire
187 *
188 * Hydra_Software_Devel/16   7/21/08 4:17p dliu
189 * PR45002: Remove timer from open call
190 *
191 * Hydra_Software_Devel/15   7/21/08 12:55p dliu
192 * PR45002: Include TPS info in acquire parameter. Also add timer for IFD
193 * acquistion
194 *
195 * Hydra_Software_Devel/14   6/24/08 3:23p dliu
196 * PR38944: Change parameters for GetSoftDecisionBuf to signed values
197 *
198 * Hydra_Software_Devel/13   6/19/08 3:06p dliu
199 * PR38944: Fix compiler warning
200 *
201 * Hydra_Software_Devel/12   6/19/08 3:05p dliu
202 * PR38944: Add code rate and AGC gain to THD Status
203 *
204 * Hydra_Software_Devel/11   6/13/08 4:36p dliu
205 * PR38944: Add more parameters to THD acquire
206 *
207 * Hydra_Software_Devel/10   5/31/08 12:42p dliu
208 * PR38934: Add NICAM status, change parameters of GetSoftDecisionBuf to
209 * uint_16
210 *
211 * Hydra_Software_Devel/9   5/16/08 10:59a dliu
212 * PR38934: Add Pal-I mode. Change enum AudioInput to AnalogInput to
213 * better represent the meaning
214 *
215 * Hydra_Software_Devel/8   5/15/08 12:34p dliu
216 * PR38934: Add IFD Status function and GetSoftDecisionBuf function
217 *
218 * Hydra_Software_Devel/7   5/14/08 2:24p dliu
219 * PR38934: Change IFD acquire to its own dedicate function. Also changed
220 * input paramters of IFD acquire
221 *
222 * Hydra_Software_Devel/6   5/7/08 4:42p dliu
223 * PR38934: Add 3556 required defines
224 *
225 * Hydra_Software_Devel/5   3/26/08 5:51p dliu
226 * PR40927: Add modulation, transmission mode and guard interval
227 *
228 * Hydra_Software_Devel/4   2/27/08 10:13a dliu
229 * PR36603: Add viterbi counters and do some name rechange
230 *
231 * Hydra_Software_Devel/3   2/27/08 10:08a dliu
232 * PR36603: Add viterbi counters and do some name rechange
233 *
234 * Hydra_Software_Devel/2   11/6/07 5:36p dliu
235 * PR36603: Add GetVersion function
236 *
237 * Hydra_Software_Devel/1   11/5/07 3:40p dliu
238 * PR36603: Initial version
239 *
240 ***************************************************************************/
241
242/*================== Module Overview =====================================
243<verbatim>
244The BTHD (Broadcom Terrestrial Handheld Demodulator) portinginterface (PI)
245controls the RF front-end block on any Broadcom chip that has one or more
246DVB T/H core(s), such as BCM2940. The BTHD PI is responsible for controlling
247the terrestrial tuner, and theterrestrial downstream receiver.
248
249The BTHD PI device is accessed by the handle BTHD_Handle. There is 1
250BTHD_Handle per Broadcom chip. A BTHD_Handle will have 1 or more channels,
251depending on the number of THD cores present in the Broadcom chip.
252
253The BTHD_Handle shall be proveded the following API
254    BTHD_Open
255    BTHD_Close
256    BTHD_Init
257    BTHD_TuneAcquire
258    BTHD_GetVersion
259    BTHD_GetThdStatus
260    BTHD_ResetInbandStatus
261    BTHD_GetInterruptEventHandler
262    BTHD_HandleInterrupt_isr
263
264The magnum/portinginterface/THD/bthd.h header file defines a standard THDT/H
265front-end API for all Broadcom THD chips.  The implementation of the API for
266each chip is in the magnum/portinginterface/thd/<chip> directory. 
267
268Interrupt Requirements
269The application needs to call BTHD_HandleInterrupt_isr() when it receives
270the THDT L1 interrupt.
271
272Sample Code
273//
274// NOTE: This is sample code for a system that contains single-channel THDT/H
275//       using BCM2940.  This code does not do any error checking
276//
277#include "bTHD.h"
278#include "bTHD_3520.h"
279#include "bTHD_3560.h"
280
281static BTHD_Handle      hTHD;  // handle for BCM3560 THD core
282static BCHP_Handle      hCHP;
283static BREG_I2C_Handle  hReg;
284
285// These are pointers to AP microcode used in BCM3560/BCM3520. 
286// The microcode will vary depending on chip/board/customer, so it is not
287// part of the BTHD PI.
288extern const uint8_t *pBcm3520ApImage;
289extern const uint8_t *pBcm3560ApImage;
290
291void main(void)
292{
293   BTHD_Settings     settings1, settings2;
294   BTHD_InbandParams inbandParams;
295
296   // do initialization
297   // (get BCHP_Handle, BREG_I2C_Handle, etc)
298   ...
299
300   // BTHD initialization for BCM2940
301   BTHD_GetDefaultSettings(&settings2);
302   settings2.i2c.chipAddr = BCM2940_I2C_ADDR;
303   settings2.i2c.interruptEnableFunc = bcm2940_enable_irq;
304   settings2.i2c.interruptEnableFuncParam = NULL;
305
306   // enable the BCM2940 host interrupt and map that interrupt to a function
307   // that will call the BTHD PI function BTHD_HandleInterrupt_isr()
308   ...
309
310   // start a thread that runs bcm2940_background()
311   ...
312
313   // download the default Bcm2940 microcode and run the AP
314   BTHD_Init(hTHD, NULL);
315
316   // tune the tuner
317   ...
318
319   
320   // acquire a DVB-T Channel
321   inbandParams.tunerFreq = 500000000;
322   inbandParams.bandwidth = BTHD_Bandwidth_8Mhz;
323   inbandParams.cciMode = BTHD_CCI_None;
324   BTHD_TuneAcquire(hTHD, &inbandParams);
325
326   ...
327
328   close_THD:
329   // disable THD L1 interrupts
330   // terminate bcm3520_background task
331   ...
332   BTHD_Close(hTHD);
333
334   program_done:
335   ...
336}
337
338// The application must call BTHD_ProcessInterruptEvent() every time the THD
339// interrupt event is set.
340void bcm2940_background()
341{
342   // get handle to the BCM3520 interrupt event
343   BTHD_GetInterruptEventHandle(hTHD, &event);
344
345   while (1)
346   {
347      BKNI_WaitForEvent(event, BKNI_INFINTE);
348      BTHD_ProcessInterruptEvent(hTHD);
349   }
350}
351
352
353// This is an example of a callback function for enabling/disabling the L1
354// interrupt.
355void THD_enable_irq(bool b, void *p)
356{
357   if (b)
358      CPUINT1_Enable(THD_IRQ);   // enable the L1 interrupt
359   else
360      CPUINT1_Disable(THD_IRQ);  // disable the L1 interrupt
361}
362</verbatim>
363========================================================================*/
364
365#ifndef BTHD_H__
366#define BTHD_H__
367
368#ifdef __cplusplus
369extern "C" {
370#endif
371
372#include "bchp.h"
373#include "bkni.h"
374#include "bint.h"
375#include "btmr.h"
376#include "bmem.h"
377#include "berr_ids.h"
378
379
380/***************************************************************************
381Summary:
382        BTHD error codes
383
384Description:
385
386See Also:
387
388****************************************************************************/
389#define BTHD_ERR_MI2C_NO_ACK     BERR_MAKE_CODE(BERR_THD_ID, 0x0) /* This is a BERR_Code to indicate no ack from i2c slave device (e.g. tuner). */
390#define BTHD_ERR_DMA             BERR_MAKE_CODE(BERR_THD_ID, 0x1) /* This is a BERR_Code to indicate DMA transfer has failed */
391#define BTHD_ERR_RFIFO_UNDERRUN  BERR_MAKE_CODE(BERR_THD_ID, 0x2) /* This is a BERR_Code to indicate DMA transfer has failed due to read fifo underflow */
392#define BTHD_ERR_WFIFO_OVERWRITE BERR_MAKE_CODE(BERR_THD_ID, 0x3) /* This is a BERR_Code to indicate DMA transfer has failed due to write fifo overflow */
393#define BTHD_ERR_COMMAND_TIMEOUT BERR_MAKE_CODE(BERR_THD_ID, 0x4) /* This is a BERR_Code to indicate a command was sent to firmware but was not acknowledged */
394#define BTHD_ERR_INIT_TIMEOUT    BERR_MAKE_CODE(BERR_THD_ID, 0x5) /* This is a BERR_Code to indicate timeout occured while downloading the microcode */
395#define BTHD_ERR_HAB_NO_ACK      BERR_MAKE_CODE(BERR_THD_ID, 0x6) /* This is a BERR_Code to indicate that the HAB command was not processed by AP. */
396#define BTHD_ERR_HAB_TIMEOUT     BERR_MAKE_CODE(BERR_THD_ID, 0x7) /* This is a BERR_Code to indicate an HAB timeout. */
397#define BTHD_ERR_AP_NOT_INIT     BERR_MAKE_CODE(BERR_THD_ID, 0x8) /* This is a BERR_Code to indicate that the AP has failed to initialize. */
398#define BTHD_ERR_AP_FAIL         BERR_MAKE_CODE(BERR_THD_ID, 0x9) /* This is a BERR_Code to indicate that the AP is no longer responding to command */
399#define BTHD_ERR_HABAV           BERR_MAKE_CODE(BERR_THD_ID, 0xa) /* This is a BERR_Code to indicate that the AP did not properly respond to HAB command */
400#define BTHD_ERR_MEMAV           BERR_MAKE_CODE(BERR_THD_ID, 0xb) /* This is a BERR_Code to indicate that the AP failed while accessing memory */
401#define BTHD_ERR_HAB_ERR         BERR_MAKE_CODE(BERR_THD_ID, 0xd) /* This is a BERR_Code to indicate an HAB command format error. */
402#define BTHD_ERR_AP_COPY         BERR_MAKE_CODE(BERR_THD_ID, 0xe) /* This is a BERR_Code to indicate an AP-internal error. */
403#define BTHD_ERR_AP_IRQ          BERR_MAKE_CODE(BERR_THD_ID, 0xf) /* This is a BERR_Code to indicate an AP-internal error. */
404#define BTHD_ERR_AP_SCR          BERR_MAKE_CODE(BERR_THD_ID, 0x10) /* This is a BERR_Code to indicate an AP-internal error. */
405#define BTHD_ERR_AP_ISB          BERR_MAKE_CODE(BERR_THD_ID, 0x11) /* This is a BERR_Code to indicate an AP-internal error. */
406#define BTHD_ERR_AP_WD           BERR_MAKE_CODE(BERR_THD_ID, 0x12) /* This is a BERR_Code to indicate an AP-internal error. */
407#define BTHD_ERR_AP_STACK        BERR_MAKE_CODE(BERR_THD_ID, 0x13) /* This is a BERR_Code to indicate an AP-internal error. */
408#define BTHD_ERR_AP_BSC          BERR_MAKE_CODE(BERR_THD_ID, 0x14) /* This is a BERR_Code to indicate an AP-internal error. */
409#define BTHD_ERR_AP_PLL                  BERR_MAKE_CODE(BERR_THD_ID, 0x15)  /* This is a BERR_Code to indicate AP was unable to boot because PLL did not lock*/
410#define BTHD_ERR_AP_HABAV                BERR_MAKE_CODE(BERR_THD_ID, 11) /* This is a BERR_Code to indicate an AP-internal error. */
411#define BTHD_ERR_HOST_XFER               BERR_MAKE_CODE(BERR_THD_ID, 0x16)  /* This is a BERR_Code to indicate a host transfer error (underrun/overrun). */
412#define BTHD_ERR_AP_UNKNOWN              BERR_MAKE_CODE(BERR_THD_ID, 0x17) /* This is a BERR_Code to indicate an AP-internal error. */
413#define BTHD_ERR_INVALID_ANALOG_MODES   BERR_MAKE_CODE(BERR_THD_ID, 0x18) /* This is a BERR_Code to indicate the video and audio modes selected is not valid */
414#define BTHD_ERR_POWER_DOWN     BERR_MAKE_CODE(BERR_THD_ID, 0x19) /* This is a BERR_Code to indicate a THD api was called while power is not enabled */
415
416/***************************************************************************
417Summary:
418        BTHD Powerup/Powerdown code
419
420Description: This is used by PowerEnable and PowerDisable function to allow
421             the user to select which cores they would like the dynamicly
422             control the power.
423
424See Also:
425
426****************************************************************************/
427#define BTHD_POWER_AP 0x1 /* This will only power on/off the internal acquistion processor */
428
429/***************************************************************************
430Summary:
431        The handle for thd module.
432
433Description:
434        This is an opaque handle that is used to access the BTHD API.
435
436See Also:
437        BTHD_Open()
438
439****************************************************************************/
440typedef struct BTHD_P_Handle *BTHD_Handle;
441
442/***************************************************************************
443Summary:
444        Enumeration for analog video modes
445
446Description:
447        This enum specifies analog video mode options for the IFD decoder. This
448        only applies to IFD core in cases where this PI controls both ofdm and
449        analog video receiver.
450
451See Also:
452        None.
453
454****************************************************************************/
455typedef enum BTHD_AnalogVideoMode {
456        BTHD_AnalogVideoMode_eNtsc_M,   /* NTSC-M mode. can be combined with BTSC or A2 audio */
457        BTHD_AnalogVideoMode_eNtsc_N,   /* NTSC-N mode, can be combined with only BTSC audio */
458        BTHD_AnalogVideoMode_ePal_M,    /* PAL-M mode, can be combined with only BTSC audio */
459        BTHD_AnalogVideoMode_ePal_N,    /* PAL-N mode, can be combined with only BTSC audio */
460        BTHD_AnalogVideoMode_ePal_I,    /* PAL-I mode, can be combined with only NICAM audio */
461        BTHD_AnalogVideoMode_ePal_BGH,  /* PAL-B/G/H mode, can be combined with A2 or NICAM audio */
462        BTHD_AnalogVideoMode_ePal_DK,   /* PAL-D/K mode, can be combined with NICAM audio only */
463        BTHD_AnalogVideoMode_ePal_DK1,  /* PAL-D/K1 mode, can be combined with A2 audio only */
464        BTHD_AnalogVideoMode_ePal_DK2,  /* PAL-D/K2 mode, can be combined with A2 audio only */
465        BTHD_AnalogVideoMode_ePal_DK3,  /* PAL-D/K3 mode, can be combined with A2 audio only */
466        BTHD_AnalogVideoMode_eSecam_BGH,/* SECAM-B/G/H mode, can be combined with A2 or NICAM audio */
467        BTHD_AnalogVideoMode_eSecam_DK, /* SECAM-D/K mode, can be combined with only NICAM audio */
468        BTHD_AnalogVideoMode_eSecam_L   /* SECAM-L mode, can be combined with onl y NICAM audio */
469} BTHD_AnalogVideoMode;
470
471/***************************************************************************
472Summary:
473        Enumeration for analog audio modes
474
475Description:
476        This enum specifies second audio carrier mode options for the IFD decoder.
477        This only applies to IFD core in cases where this PI controls both ofdm
478        an analog video receiver. Not all video/audio combo are valid, refer to
479        each video mode for more options
480
481See Also:
482        BTHD_AnalogVideoMode
483
484****************************************************************************/
485typedef enum BTHD_AnalogAudioMode {
486        BTHD_AnalogAudioMode_eBtsc,             /* Selects BTSC audio */
487        BTHD_AnalogAudioMode_eA2,               /* Selects A2 audio */
488        BTHD_AnalogAudioMode_eNicam             /* Selects NICAM audio */
489} BTHD_AnalogAudioMode;
490
491/***************************************************************************
492Summary:
493        Enumeration for analog input
494
495Description:
496        This enum specifies analog audio input options for the IFD decoder. This
497        only applies to IFD core in cases where this PI controls both ofdm and
498        analog video receiver.
499
500See Also:
501        None.
502
503****************************************************************************/
504typedef enum BTHD_AnalogInput {
505        BTHD_AnalogInput_eIf = 0,               /* Audio input with IF signal */
506        BTHD_AnalogInput_eSif_1 = 0x80  /* Audio input from SIF Channel 1 */
507} BTHD_AnalogInput;
508
509/***************************************************************************
510Summary:
511        Enum for IFD deviation modes
512
513Description:
514        This enum specifies deviation mode for the IFD core
515
516See Also:
517        None.
518
519****************************************************************************/
520typedef enum BTHD_AnalogAudioDeviation
521{
522    BTHD_AnalogAudioDeviation_eNormal,
523    BTHD_AnalogAudioDeviation_eMedium,
524    BTHD_AnalogAudioDeviation_eHigh
525} BTHD_AnalogAudioDeviation;
526
527/***************************************************************************
528Summary:
529        Enum for IFD acquisition mode
530
531Description:
532        This enum specifies whether should speed acquistion but acquire less offsets
533
534See Also:
535        None.
536
537****************************************************************************/
538typedef enum BTHD_IfdAcquisitionMode
539{
540    BTHD_IfdAcquisitionMode_eSlow,
541    BTHD_IfdAcquisitionMode_eFast
542} BTHD_IfdAcquisitionMode;
543
544
545/***************************************************************************
546Summary:
547        Enum for THD acquisition mode
548
549Description:
550        This enum specifies whether we are in Scan, Manual or Auto mode
551
552See Also:
553        None.
554
555****************************************************************************/
556typedef enum BTHD_ThdAcquisitionMode
557{
558    BTHD_ThdAcquisitionMode_eAuto,
559    BTHD_ThdAcquisitionMode_eManual,
560        BTHD_ThdAcquisitionMode_eScan
561} BTHD_ThdAcquisitionMode;
562
563/***************************************************************************
564Summary:
565        Enumeration for pga gain.
566
567Description:
568        This enum specifies the pga gain.
569
570See Also:
571        None.
572
573****************************************************************************/
574typedef enum BTHD_PgaGain
575{
576   BTHD_PgaGain_e0dB,     
577   BTHD_PgaGain_e1dB,   
578   BTHD_PgaGain_e2dB, 
579   BTHD_PgaGain_e3dB, 
580   BTHD_PgaGain_e4dB, 
581   BTHD_PgaGain_e5dB,
582   BTHD_PgaGain_e6dB
583} BTHD_PgaGain;
584
585/***************************************************************************
586Summary:
587        Enumeration for Agc Pin Mode
588
589Description:
590        This enum specifies the voltage swing of the AGC pin
591
592See Also:
593        None.
594
595****************************************************************************/
596typedef enum BTHD_AgcPinMode
597{
598    BTHD_AgcPinMode_e33V, /* indicates AGC pin goes from 0 to 3.3V */
599    BTHD_AgcPinMode_e25V  /* indicates AGC pin goes from 0 to 2.5V */
600} BTHD_AgcPinMode;
601
602/***************************************************************************
603Summary:
604        Enum for IFD pullin range
605
606Description:
607        This enum specifies how much frequency offset the receiver will acquire to
608
609See Also:
610        None.
611
612****************************************************************************/
613typedef enum BTHD_IfdPullInRange
614{
615    BTHD_IfdPullInRange_e32kHz=0,
616    BTHD_IfdPullInRange_e250kHz,
617    BTHD_IfdPullInRange_e500kHz,
618    BTHD_IfdPullInRange_e750kHz,
619    BTHD_IfdPullInRange_e1000kHz,
620    BTHD_IfdPullInRange_e1100kHz
621} BTHD_IfdPullInRange;
622
623/***************************************************************************
624Summary:
625    Enumeration for Callback types
626
627Description:
628    This enumeration defines Callback types.
629
630See Also:
631
632****************************************************************************/
633typedef enum BTHD_Callback
634{
635    BTHD_Callback_eLockChange,          /* Callback to notify application of lock change */
636    BTHD_Callback_eUpdateGain,          /* Callback to notify application to update gain */ 
637    BTHD_Callback_eNoSignal,            /* Callback to notify application there is no signal */ 
638    BTHD_Callback_eAsyncStatusReady,    /* Callback to notify application there is no signal */   
639        BTHD_Callback_eTuner,                           /* Callback to tuner regarding a new setting */ 
640    BTHD_Callback_eLast                 /* More may be required */
641} BTHD_Callback;
642
643/***************************************************************************
644Summary:
645        Structure containing IFD agc parameters
646
647Description:
648        This structure contains the setting for AGC block
649
650See Also:
651        None.
652
653****************************************************************************/
654typedef struct BTHD_IfdAgcSettings
655{
656    uint16_t top;           /* tuner TOP point */
657    BTHD_PgaGain pgaGain;   /* pga gain in dB */ 
658    uint8_t delay;          /* Delay in ms that the acquisition script will wait for the AGC hardware to settle */
659    uint8_t rfBandwidth;    /* RF AGC band width */
660    uint8_t ifBandwidth;    /* IF AGC band width */     
661} BTHD_IfdAgcSettings;
662
663/***************************************************************************
664Summary:
665        Structure containing input parameters to IFD acquire command
666
667Description:
668        This structure contains the setting for IFD acquire command
669
670See Also:
671        None.
672
673****************************************************************************/
674typedef struct BTHD_IfdParams
675{
676   BTHD_AnalogVideoMode eVideoMode;             /* Selects analog video standards */
677   BTHD_AnalogAudioMode eAudioMode;     /* Selects analog audio standards */
678   BTHD_AnalogInput     eAnalogInput;   /* Select analog input options */
679   uint32_t             ifFreqOffset;   /* IF Frequency offset */
680   BTHD_AnalogAudioDeviation eAnalogAudioDeviation;      /* Selects deviation mode for analog audio */
681   bool                 bSpectrumInvert; /* Invert input spectrum, only used in SECAM-L mode to get SECAM-L' */
682   BTHD_IfdPullInRange  ePullInRange;
683   BTHD_IfdAcquisitionMode eAcquisitionMode; /* Faster acquisition */
684   BTHD_IfdAgcSettings  agcSettings;
685
686} BTHD_IfdParams;
687
688/*****************************************************************************
689Summary:
690   Structure containing host I2C settings
691Description:
692   This structure contains the settings for host I2C control.  For memory-
693   mapped BTHD devices, this structure will not be used.
694See Also:
695   BTHD_Settings
696******************************************************************************/
697typedef struct BTHD_I2cSettings
698{
699   uint16_t chipAddr;  /* Bcm2940 i2c chip address, not needed for 3556 */
700   void     (*interruptEnableFunc)(bool, void*); /* callback function for enabling/disabling L1 interrupt */
701   void     *interruptEnableFuncParam; /* parameter passed to interruptEnableFunc */
702} BTHD_I2cSettings;
703
704/***************************************************************************
705Summary:
706        Enumeration for receiver deocde method
707
708Description:
709        This enum specifies the decode options
710
711See Also:
712        None.
713
714****************************************************************************/
715typedef enum BTHD_DecodeMode
716{
717   BTHD_Decode_Lp,      /* Low priority decode */
718   BTHD_Decode_Hp     /* High priority decode */
719} BTHD_DecodeMode;
720
721/***************************************************************************
722Summary:
723        Enumeration for receiver CCI Mode
724
725Description:
726        This enum specifies CoChannel Interferece filter options
727
728See Also:
729        None.
730
731****************************************************************************/
732typedef enum BTHD_CCIMode
733{
734   BTHD_CCI_None,           /* No CCI selected */
735   BTHD_CCI_Auto            /* Auto Selection */
736} BTHD_CCIMode;
737
738/***************************************************************************
739Summary:
740        Enumeration for receiver bandwidth
741
742Description:
743        This enum specifies the bandwidth the channel received
744
745See Also:
746        None.
747
748****************************************************************************/
749typedef enum BTHD_Bandwidth
750{
751   BTHD_Bandwidth_5Mhz=5,   /* Selects 5 MHz */
752   BTHD_Bandwidth_6Mhz,   /* Selects 5 MHz */
753   BTHD_Bandwidth_7Mhz,   /* Selects 5 MHz */
754   BTHD_Bandwidth_8Mhz    /* Selects 5 MHz */
755} BTHD_Bandwidth;
756
757
758/***************************************************************************
759Summary:
760        Enumeration for receiver modulaton type
761
762Description:
763        This enum specifies the modulation type of the channel received
764
765See Also:
766        None.
767
768****************************************************************************/
769typedef enum BTHD_Modulation
770{
771        BTHD_Modulation_eDqpsk=0,      /* DQPSK Modulation */
772        BTHD_Modulation_eQpsk=4,      /* QPSK Modulation */
773        BTHD_Modulation_e16Qam=16,    /* 16-QAM Modulation */
774        BTHD_Modulation_e64Qam=64     /* 64-QAM Modulation */
775} BTHD_Modulation;
776
777
778/***************************************************************************
779Summary:
780        Enumeration for THD pull-in range.
781
782Description:
783        This enum specifies the pull-in range of THD core
784
785See Also:
786        None.
787
788****************************************************************************/
789typedef enum BTHD_PullInRange
790{
791   BTHD_PullInRange_eNarrow,   /* carrier acquisition range is narrow +/-200kHz */
792   BTHD_PullInRange_eWide     /* carrier acquisition range is wide +/-600kHz */
793} BTHD_PullInRange;
794
795
796/***************************************************************************
797Summary:
798        Enum for inband mode
799
800Description:
801        This enum specifies the mode for the inband receiver
802
803See Also:
804        None.
805
806****************************************************************************/
807typedef enum BTHD_InbandMode
808{
809  BTHD_InbandMode_eDvbt,           /* DVB-T */
810  BTHD_InbandMode_eIsdbt          /* ISDB-T */
811} BTHD_InbandMode;
812
813
814/***************************************************************************
815Summary:
816        Enumeration for receiver transmission mode
817
818Description:
819        This enum specifies the transmission mode of the channel received
820
821See Also:
822        None.
823
824****************************************************************************/
825typedef enum BTHD_TransmissionMode
826{
827        BTHD_TransmissionMode_e2K=2, /* 2K Mode */
828        BTHD_TransmissionMode_e4K=4, /* 4K Mode */
829        BTHD_TransmissionMode_e8K=8  /* 8K Mode */
830} BTHD_TransmissionMode;
831
832/***************************************************************************
833Summary:
834        Enumeration for receiver guard interval
835
836Description:
837        This enum specifies the guard interval of the channel received
838
839See Also:
840        None.
841
842****************************************************************************/
843typedef enum BTHD_GuardInterval
844{
845        BTHD_GuardInterval_e1_32=32, /* Guard 1/32 */
846        BTHD_GuardInterval_e1_16=16, /* Guard 1/16 */
847        BTHD_GuardInterval_e1_8=8,   /* Guard 1/8 */
848        BTHD_GuardInterval_e1_4=4    /* Guard 1/4 */
849} BTHD_GuardInterval;
850
851/***************************************************************************
852Summary:
853        Enumeration for receiver code rate
854
855Description:
856        This enum specifies the code rate of the channel received
857
858See Also:
859        None.
860
861****************************************************************************/
862typedef enum BTHD_CodeRate
863{
864        BTHD_CodeRate_e1_2=2, /* Rate 1/2 */
865        BTHD_CodeRate_e2_3=3, /* Rate 2/3 */
866        BTHD_CodeRate_e3_4=4, /* Rate 3/4 */
867        BTHD_CodeRate_e5_6=6, /* Rate 5/6 */
868        BTHD_CodeRate_e7_8=8  /* Rate 7/8 */ 
869} BTHD_CodeRate;
870
871/***************************************************************************
872Summary:
873        Enumeration for DVB-T hierarchical mode
874
875Description:
876        This enum specifies the hierarchy of the channel received
877
878See Also:
879        None.
880
881****************************************************************************/
882typedef enum BTHD_Hierarchy
883{
884        BTHD_Hierarchy_0=0, /* select hierarchy = 0 */
885        BTHD_Hierarchy_1=1, /* select hierarchy = 1 */
886        BTHD_Hierarchy_2=2, /* select hierarchy = 2 */
887        BTHD_Hierarchy_4=4  /* select hierarchy = 4 */
888} BTHD_Hierarchy;
889
890/***************************************************************************
891Summary:
892        Enumeration for ISDB-T time interleaving
893
894Description:
895        This enum specifies the ISDB-T time interleaving mode
896
897See Also:
898        None.
899
900****************************************************************************/
901typedef enum BTHD_IsdbtTimeInterleaving
902{
903  BTHD_IsdbtTimeInterleaving_0X,
904  BTHD_IsdbtTimeInterleaving_1X,
905  BTHD_IsdbtTimeInterleaving_2X,
906  BTHD_IsdbtTimeInterleaving_3X
907}BTHD_IsdbtTimeInterleaving;
908
909/***************************************************************************
910Summary:
911        Enumeration for NICAM audio recevier current encoder mode
912
913Description:
914        This enum specifies the NICAM encoder modes
915
916See Also:
917        None.
918
919****************************************************************************/
920typedef enum BTHD_NicamEncoderMode
921{
922        BTHD_Stereo_BackupFm=1,
923        BTHD_DualMono_BackupFm=5,
924        BTHD_Stereo_NoBackup=0,
925        BTHD_DualMono_NoBackup=4,
926        BTHD_MonoData_NoBackup=8,
927        BTHD_MonoData_BackupFm=9,
928        BTHD_Data_NoBackup=12,
929        BTHD_Data_BackupFm=13
930} BTHD_NicamEncoderMode;
931
932/***************************************************************************
933Summary:
934        Enumeration for receiver mode
935
936Description:
937        This enum specifies the receiver  modes
938
939See Also:
940        None.
941
942****************************************************************************/
943typedef enum BTHD_ThdMode
944{
945        BTHD_Mode_eAuto = 0,
946        BTHD_Mode_eFixed=1,
947        BTHD_Mode_ePederstrian=2,
948        BTHD_Mode_eMobile=3
949} BTHD_ThdMode;
950
951
952/***************************************************************************
953Summary:
954        Enumeration for receiver mode
955
956Description:
957        This enum specifies the receiver  modes
958
959See Also:
960        None.
961
962****************************************************************************/
963typedef enum BTHD_ModeGuard
964{
965        BTHD_ModeGuard_eManual = 0,
966        BTHD_ModeGuard_eAuto=1,
967        BTHD_ModeGuard_eAutoDvbt=2,
968        BTHD_ModeGuard_eAutoIsdbt=3
969} BTHD_ModeGuard;
970
971/***************************************************************************
972Summary:
973    Enumeration for Lock Status
974
975Description:
976    This enumeration represents the lock status of of a THD channel.
977
978See Also:
979
980****************************************************************************/
981typedef enum BTHD_LockStatus
982{           
983    BTHD_LockStatus_eUnlocked,
984    BTHD_LockStatus_eLocked, 
985    BTHD_LockStatus_eNoSignal,     
986    BTHD_LockStatus_eLast   
987} BTHD_LockStatus;
988
989
990/***************************************************************************
991Summary:
992        Structure for inband acquisition
993
994Description:
995        This structure contains parameters used for an inband channel acquisition.
996
997See Also:
998        BTHD_Bandwidth, BTHD_CCIMode, BTHD_DecodeMode, BTHD_InbandMode
999
1000****************************************************************************/
1001typedef struct BTHD_InbandParams
1002{
1003        /* Common Parameters */
1004  BTHD_InbandMode            mode;                           /* Selects inband mode (DVB-T or ISDB-T)*/
1005  BTHD_Bandwidth             bandwidth;                      /* Selects bandwidth of input signal */
1006  uint32_t                   tunerFreq;                      /* Set the current tuner frequency in Hz */
1007  uint32_t                   ifFreq;                         /* Selects IF freqeuncy in Hz, only used in 3556 */
1008  BTHD_CCIMode               cciMode;                        /* Selects co-channel filter options */
1009  BTHD_PullInRange           ePullinRange;                   /* Set wide or narrow carrier acquisition range */
1010  BTHD_ModeGuard             eModeGuardAcquire;              /* If Manual, caller will provide eTransmissionMode and eGuardInterval, else if true, receiver automatically discovers this info */
1011  BTHD_TransmissionMode      eTransmissionMode;              /* Manually set the transmission mode. Only used if bModeGuardAcquire=false */
1012  BTHD_GuardInterval         eGuardInterval;                 /* Manually set the guard interval. Only used if bModeGuardAcquire=false */
1013  bool                       bTuneAcquire;                  /* This bit directs the Downstream Demodulator to initiate an acquire immediately after its associated WFE or Tuner is tuned. 
1014                                                               If the bit is set, then the Demodulator will initiate an acquire immediately after the tuner has completed a tune  regardless of autoacquire.   
1015                                                               Note: Unless otherwise indicated, this flag only applies to the Acquisition Processors Internal WFE or Internal Tuner. */
1016
1017  /* DVB-T Specific Parameters */
1018  BTHD_DecodeMode            decodeMode;                     /* Selects the DVB-T hierarchical stream to decode (High Priority or Low Priority) */
1019  bool                       bTpsAcquire;                    /* If false, caller will provide the {modulation,high priority code rate, low priority code rate, hierarchy } TPS parameters. Only used if mode-DVB-T */
1020  BTHD_Modulation            eModulation;                    /* Manually set DVB-T modulation type. Only used if mode=DVB-T and bTpsAcquire=false */
1021  BTHD_CodeRate              eCodeRateHP;                    /* Manually set DVB-T high priority code rate. Only used if mode=DVB-T and bTpsAcquire=false */
1022  BTHD_CodeRate              eCodeRateLP;                    /* Manually set DVB-T low priority code rate. Only used if mode=DVB-T and bTpsAcquire=false */
1023  BTHD_Hierarchy             eHierarchy;                     /* Manually set DVB-T hierarchy. Only used if mode=DVB-T and bTpsAcquire=false */
1024
1025  /* ISDB-T Specific Parameters */
1026  bool                       bTmccAcquire;                   /* If false, caller will provide the {partial reception, modulation, code rate, time interleaving, number of segments} TMCC parameters. Only used if mode=ISDB-T */
1027  bool                       bIsdbtPartialReception;         /* Manually set ISDB-T partial reception. Only used if mode=ISDB-T and bTmccAcquire=false */
1028  BTHD_Modulation            eIsdbtAModulation;              /* Manually set ISDB-T Layer A modulation type. Only usedd if mode=ISDB-T and bTmccAcquire=false */
1029  BTHD_CodeRate              eIsdbtACodeRate;                /* Manually set ISDB-T Layer A code rate. Only used if mode=ISDB-T and bTmccAcquire=false */
1030  BTHD_IsdbtTimeInterleaving eIsdbtATimeInterleaving;        /* Manually set ISDB-T Layer A time interleaving. Only used if mode=ISDB-T and bTmccAcquire=false */
1031  uint32_t                   eIsdbtASegments;                /* Manually set ISDB-T Layer A number of segments. Only used if mode=ISDB-T and bTmccAcquire=false */
1032  BTHD_Modulation            eIsdbtBModulation;              /* Manually set ISDB-T Layer B modulation type. Only usedd if mode=ISDB-T and bTmccAcquire=false */
1033  BTHD_CodeRate              eIsdbtBCodeRate;                /* Manually set ISDB-T Layer B code rate. Only used if mode=ISDB-T and bTmccAcquire=false */
1034  BTHD_IsdbtTimeInterleaving eIsdbtBTimeInterleaving;        /* Manually set ISDB-T Layer B time interleaving. Only used if mode=ISDB-T and bTmccAcquire=false */
1035  uint32_t                   eIsdbtBSegments;                /* Manually set ISDB-T Layer B number of segments. Only used if mode=ISDB-T and bTmccAcquire=false */
1036  BTHD_Modulation            eIsdbtCModulation;              /* Manually set ISDB-T Layer C modulation type. Only usedd if mode=ISDB-T and bTmccAcquire=false */
1037  BTHD_CodeRate              eIsdbtCCodeRate;                /* Manually set ISDB-T Layer C code rate. Only used if mode=ISDB-T and bTmccAcquire=false */
1038  BTHD_IsdbtTimeInterleaving eIsdbtCTimeInterleaving;        /* Manually set ISDB-T Layer C time interleaving. Only used if mode=ISDB-T and bTmccAcquire=false */
1039  uint32_t                   eIsdbtCSegments;                /* Manually set ISDB-T Layer C number of segments. Only used if mode=ISDB-T and bTmccAcquire=false */
1040  BTHD_ThdAcquisitionMode        eAcquisitionMode;
1041} BTHD_InbandParams;
1042
1043
1044/***************************************************************************
1045Summary:
1046        Structure for THD status
1047
1048Description:
1049        This structure contains THD status
1050
1051See Also:
1052        None.
1053
1054****************************************************************************/
1055typedef struct BTHD_THDStatus
1056{
1057  /* Common Fields */
1058  BTHD_InbandParams          acqParams;                      /* Input parameters from most recent acquisition */
1059  bool                       bReceiverLock;                  /* Receiver lock indicator */
1060  bool                       bFecLock;                       /* FEC lock indicator */
1061  bool                       bNoSignalDetected;              /* OFDM signal detected indicator. Should only be used by channel scan as a flag to move on to the next channel */
1062  BTHD_TransmissionMode      eTransmissionMode;              /* Transmission mode */
1063  BTHD_GuardInterval         eGuardInterval;                 /* Guard interval */
1064  uint32_t                   ulRFAgc;                        /* RF Agc value in 1/10 percent */
1065  uint32_t                   ulIFAgc;                        /* IF Agc value in 1/10 percent */
1066  int16_t                    nSignalStrength;                /* Signal strength in 1/100th of a dBmV. Not available on BCM3556 */
1067  int32_t                    lCarrierOffset;                 /* Carrier offset in Hz */
1068  int32_t                    lTimingOffset;                  /* Timing offset in Hz */
1069  int16_t                    nSnr;                           /* SNR in 1/256th dB */
1070  bool                       bSpectrumInverted;              /* Spectral inversion indicator */
1071  uint32_t                   ulReacqCount;                   /* Number of reacquisitions performed */
1072  bool                       bValid;                         /* Indicates status structure returned is valid. When this is false, the application should ignore all status returned */
1073
1074  /* DVB-T Specific Fields */
1075  BTHD_DecodeMode            eDecodeMode;                    /* DVB-T hierarchical decode mode (priority) that was set in the acquire parameters */
1076  BTHD_Modulation            eModulation;                    /* DVB-T modulation type */
1077  BTHD_CodeRate              eCodeRate;                      /* DVB-T code rate */
1078  BTHD_Hierarchy             eHierarchy;                     /* DVB-T hierarchy */
1079  uint16_t                   nCellId;                        /* DVB-T cell Id */
1080
1081  uint32_t                   ulRsCorrectedBlocks;            /* DVB-T accumulated corrected RS blocks */
1082  uint32_t                   ulRsUncorrectedBlocks;          /* DVB-T accumlated uncorrected RS blocks */
1083  uint32_t                   ulRsCleanBlocks;                /* DVB-T accumlated clean RS blocks */
1084  uint32_t                   ulRsTotalBlocks;                /* DVB-T accumalted total RS blocks */
1085  uint32_t                   ulViterbiUncorrectedBits;       /* DVB-T accumlated error bits after Viterbi */
1086  uint32_t                   ulViterbiTotalbits;             /* DVB-T accumlated total bits after Viterbi */
1087  uint32_t                   ulViterbiBer;                   /* DVB-T Viterbi bit error rate in 1/2147483648 th unit. To calculate the actual rate, take the value and divide by 2147483648 */
1088  uint32_t                   ulPreViterbiBer;                /* DVB-T pre-Viterbi bit error rate in 1/2147483648 th unit. To calculate the actual rate, take the value and divide by 2147483648 */
1089  uint8_t                    signalLevelPercent;             /* Signal Level Percent represents the Signal Strength of the received signal in percent */
1090  uint8_t                    signalQualityPercent;           /* Signal Quality Percent represents the Signal Quality of the received signal in percent */   
1091
1092  /* ISDB-T Specific Fields */
1093  bool                       bIsdbtEWS;                      /* ISDB-T Emergency Warning System EWS indicator */
1094  bool                       bIsdbtPartialReception;         /* ISDB-T partial reception */
1095
1096  BTHD_Modulation            eIsdbtAModulation;              /* ISDB-T Layer A modulation type */
1097  BTHD_CodeRate              eIsdbtACodeRate;                /* ISDB-T Layer A code rate */
1098  BTHD_IsdbtTimeInterleaving eIsdbtATimeInterleaving;        /* ISDB-T Layer A time interleaving */
1099  uint32_t                   eIsdbtASegments;                /* ISDB-T Layer A number of segments */
1100  uint32_t                   ulIsdbtARsCorrectedBlocks;      /* ISDB-T Layer A accumulated corrected RS blocks */
1101  uint32_t                   ulIsdbtARsUncorrectedBlocks;    /* ISDB-T Layer A accumlated uncorrected RS blocks */
1102  uint32_t                   ulIsdbtARsCleanBlocks;          /* ISDB-T Layer A accumlated clean RS blocks */
1103  uint32_t                   ulIsdbtARsTotalBlocks;          /* ISDB-T Layer A accumalted total RS blocks */
1104  uint32_t                   ulIsdbtAViterbiUncorrectedBits; /* ISDB-T Layer A accumlated error bits after Viterbi */
1105  uint32_t                   ulIsdbtAViterbiTotalbits;       /* ISDB-T Layer A accumlated total bits after Viterbi */
1106
1107  BTHD_Modulation            eIsdbtBModulation;              /* ISDB-T Layer B modulation type */
1108  BTHD_CodeRate              eIsdbtBCodeRate;                /* ISDB-T Layer B code rate */
1109  BTHD_IsdbtTimeInterleaving eIsdbtBTimeInterleaving;        /* ISDB-T Layer B time interleaving */
1110  uint32_t                   eIsdbtBSegments;                /* ISDB-T Layer B number of segments */
1111  uint32_t                   ulIsdbtBRsCorrectedBlocks;      /* ISDB-T Layer B accumulated corrected RS blocks */
1112  uint32_t                   ulIsdbtBRsUncorrectedBlocks;    /* ISDB-T Layer B accumlated uncorrected RS blocks */
1113  uint32_t                   ulIsdbtBRsCleanBlocks;          /* ISDB-T Layer B accumlated clean RS blocks */
1114  uint32_t                   ulIsdbtBRsTotalBlocks;          /* ISDB-T Layer B accumalted total RS blocks */
1115  uint32_t                   ulIsdbtBViterbiUncorrectedBits; /* ISDB-T Layer B accumlated error bits after Viterbi */
1116  uint32_t                   ulIsdbtBViterbiTotalbits;       /* ISDB-T Layer B accumlated total bits after Viterbi */
1117
1118  BTHD_Modulation            eIsdbtCModulation;              /* ISDB-T Layer C modulation type */
1119  BTHD_CodeRate              eIsdbtCCodeRate;                /* ISDB-T Layer C code rate */
1120  BTHD_IsdbtTimeInterleaving eIsdbtCTimeInterleaving;        /* ISDB-T Layer C time interleaving */
1121  uint32_t                   eIsdbtCSegments;                /* ISDB-T Layer C number of segments */
1122  uint32_t                   ulIsdbtCRsCorrectedBlocks;      /* ISDB-T Layer C accumulated corrected RS blocks */
1123  uint32_t                   ulIsdbtCRsUncorrectedBlocks;    /* ISDB-T Layer C accumlated uncorrected RS blocks */
1124  uint32_t                   ulIsdbtCRsCleanBlocks;          /* ISDB-T Layer C accumlated clean RS blocks */
1125  uint32_t                   ulIsdbtCRsTotalBlocks;          /* ISDB-T Layer C accumalted total RS blocks */
1126  uint32_t                   ulIsdbtCViterbiUncorrectedBits; /* ISDB-T Layer C accumlated error bits after Viterbi */
1127  uint32_t                   ulIsdbtCViterbiTotalbits;       /* ISDB-T Layer C accumlated total bits after Viterbi */
1128} BTHD_THDStatus;
1129
1130/***************************************************************************
1131Summary:
1132        Structure for IFD status
1133
1134Description:
1135        This structure contains IFD status
1136
1137See Also:
1138        None.
1139
1140****************************************************************************/
1141typedef struct BTHD_IfdStatus
1142{   
1143   BTHD_IfdParams      acqParams;               /* input parameters from most recent acquisition */
1144   bool         bHsyncLocked;                   /* true if HSYNC is locked    */
1145   uint32_t     pixCarrFreq;                    /* pix carrier freq in Hz */   
1146   int32_t      pixCarrFreqError;               /* pix carrier error in Hz */
1147   uint32_t     rf_agc;                         /* AGT_DELTA_SIGMA level in units of 1/10 percent */
1148   uint32_t     if_agc;                         /* AGI_DELTA_SIGMA level in units of 1/10 percent */
1149   bool                 bNicamLock;                     /* True if NICAM is locked */
1150   uint32_t         ulNicamSnr;                         /* NICAM slicer SNR */
1151   uint32_t             ulNicamParityError;             /* Number of parity errors in the current frame */
1152   uint32_t             ulNicamErrorCount;              /* Number of bit errors in the last 128 frames */
1153   BTHD_NicamEncoderMode eNicamEncoderMode;     /* Current NICAM encoder mode */
1154   uint32_t     ulAVRatio1Hi;                   /* AV Ratio in linear units (upper 32 bits) */
1155   uint32_t     ulAVRatio1Lo;                   /* AV Ratio in linear units (lower 32 bits) */
1156   uint32_t     ulAVRatio2Hi;                   /* AV Ratio for 2nd audio carrioer in linear units (upper 32 bits) */
1157   uint32_t     ulAVRatio2Lo;                   /* AV Ratio for 2nd audio carrioer in linear units (lower 32 bits) */
1158    uint32_t    ulAudioCarrier2Variance;        /*  Carrier Average Or Variance Read of 2nd audio carrier */
1159   
1160} BTHD_IfdStatus;
1161
1162/***************************************************************************
1163Summary:
1164        Structure for IFD audio settings
1165
1166Description:
1167        This structure is used to change the audio carrier frequency control
1168    word. Since there is only a finite set of possible carrier frequency
1169    we use the video/audio mode as index to the look up table
1170
1171See Also:
1172        None.
1173
1174****************************************************************************/
1175typedef struct BTHD_IfdAudioSettings
1176{
1177    BTHD_AnalogVideoMode        eVideoMode;             /* Selects analog video standards */
1178    BTHD_AnalogAudioMode    eAudioMode;     /* Selects analog audio standards */
1179    uint32_t ulCarrier2DecimationRatio; 
1180} BTHD_IfdAudioSettings;
1181
1182/***************************************************************************
1183Summary:
1184    Callback used for event notification.
1185
1186Description:
1187    When this PI wants to notify an application, it will call this callback
1188    function the callback function is registered.
1189
1190See Also:
1191    BTHD_InstallLockStateChangeCallback(), BTHD_InstallInterruptCallback()
1192
1193****************************************************************************/
1194typedef BERR_Code (*BTHD_CallbackFunc)(void *pParam );
1195
1196typedef struct BTHD_Settings BTHD_Settings;
1197
1198
1199/***************************************************************************
1200Summary:
1201        Structure for API function table
1202
1203Description:
1204   This structure contains pointers to all public BTHD functions.
1205
1206See Also:
1207        None.
1208
1209****************************************************************************/
1210typedef struct BTHD_ApiFunctTable
1211{
1212   BERR_Code (*Open)(BTHD_Handle *, BCHP_Handle, void*, BINT_Handle, const BTHD_Settings *pDefSettings);
1213   BERR_Code (*Close)(BTHD_Handle);
1214   BERR_Code (*Init)(BTHD_Handle, const uint8_t *, uint32_t);
1215   BERR_Code (*ReadRegister)(BTHD_Handle, uint32_t, uint32_t*);
1216   BERR_Code (*WriteRegister)(BTHD_Handle, uint32_t, uint32_t*);
1217   BERR_Code (*Mi2cWrite)(BTHD_Handle, uint8_t, uint8_t*, uint8_t);
1218   BERR_Code (*Mi2cRead)(BTHD_Handle, uint8_t, uint8_t*, uint8_t, uint8_t*, uint8_t);
1219   BERR_Code (*SetAcquireParams)(BTHD_Handle, const BTHD_InbandParams*);
1220   BERR_Code (*GetAcquireParams)(BTHD_Handle, BTHD_InbandParams*); 
1221   BERR_Code (*TuneAcquire)(BTHD_Handle, const BTHD_InbandParams*);
1222   BERR_Code (*GetThdStatus)(BTHD_Handle, BTHD_THDStatus *);
1223   BERR_Code (*ResetInbandStatus)(BTHD_Handle);
1224   BERR_Code (*GetChipRevision)(BTHD_Handle, uint8_t*);
1225   BERR_Code (*GetVersion)(BTHD_Handle, uint32_t*, uint32_t*);
1226   BERR_Code (*GetInterruptEventHandle)(BTHD_Handle, BKNI_EventHandle*);
1227   BERR_Code (*HandleInterrupt_isr)(BTHD_Handle);
1228   BERR_Code (*ProcessInterruptEvent)(BTHD_Handle);
1229   BERR_Code (*GetLockStateChangeEventHandle)(BTHD_Handle, BKNI_EventHandle*);
1230   BERR_Code (*AcquireIfd)(BTHD_Handle, const BTHD_IfdParams*);
1231   BERR_Code (*GetIfdStatus)(BTHD_Handle, BTHD_IfdStatus*);
1232   BERR_Code (*GetSoftDecisionBuf)(BTHD_Handle, int16_t*, int16_t*);
1233   BERR_Code (*GetDefaultInbandParams)(BTHD_InbandParams*);
1234   BERR_Code (*GetDefaultIfdParams)(BTHD_IfdParams*);
1235   BERR_Code (*ResetIfdStatus)(BTHD_Handle);
1236   BERR_Code (*SetIfdAudioSettings)(BTHD_Handle, const BTHD_IfdAudioSettings*);
1237   BERR_Code (*GetIfdAudioSettings)(BTHD_Handle, BTHD_IfdAudioSettings*);
1238   BERR_Code (*PowerUp)(BTHD_Handle);
1239   BERR_Code (*PowerDown)(BTHD_Handle);
1240   BERR_Code (*GetEWSEventHandle)(BTHD_Handle, BKNI_EventHandle*);
1241   BERR_Code (*GetThdLockStatus)(BTHD_Handle, BTHD_LockStatus *);
1242   BERR_Code (*GetBBSInterruptEventHandle)(BTHD_Handle, BKNI_EventHandle*);
1243   BERR_Code (*ProcessBBSInterruptEvent)(BTHD_Handle);   
1244   BERR_Code (*RequestThdAsyncStatus)(BTHD_Handle);   
1245   BERR_Code (*GetThdAsyncStatus)(BTHD_Handle, BTHD_THDStatus *);   
1246   BERR_Code (*InstallCallback)(BTHD_Handle, BTHD_Callback, BTHD_CallbackFunc, void *);   
1247} BTHD_ApiFunctTable;
1248
1249/***************************************************************************
1250Summary:
1251        Structure for THD settings
1252
1253Description:
1254   This structure contains the settings for the BTHD PI.
1255
1256See Also:
1257        None.
1258
1259
1260****************************************************************************/
1261struct BTHD_Settings
1262{
1263   BTHD_I2cSettings      i2c;      /* i2c settings */
1264   BTHD_ApiFunctTable    api;
1265   BTMR_Handle           hTmr;     /* Timer used for IFD acqusition, not need in 2940 */
1266   bool                  bRfDeltaSigmaInvert; /* Inverts RF delta sigma pin */
1267   bool                  bIfDeltaSigmaInvert; /* Inverts IF delta sigma pin */
1268   BTHD_AgcPinMode       IfAgcPinMode; /* specifis the voltage swing of RF delta sigma pin */
1269   BMEM_Heap_Handle      hHeap;
1270   bool                  bIfAgcZero;   /* Turns off IF AGC in the chip */
1271   void *hGeneric;         /* generic handle can be used for anything */   
1272   bool                                  supportIsdbt;
1273};
1274
1275/******************************************************************************
1276Summary:
1277   Initializes the BTHD API.
1278Description:
1279   This function must be called first to get a BTHD_Handle.  This handle is
1280   used by all other function calls in the BTHD API.
1281Returns:
1282   BERR_Code
1283******************************************************************************/
1284BERR_Code BTHD_Open(
1285   BTHD_Handle *h,       /* [out] BTHD handle */
1286   BCHP_Handle hChip,    /* [in] chip handle */
1287   void        *pReg,    /* [in] pointer to register or i2c handle */
1288   BINT_Handle hInterrupt, /* [in] interrupt handle */
1289   const BTHD_Settings *pDefSettings /* [in] default settings */
1290);
1291
1292/******************************************************************************
1293Summary:
1294   Closes the BTHD API.
1295Description:
1296   This function releases all the resources allocated by BTHD API and disables
1297   BCM3520 host interrupts.
1298Returns:
1299   BERR_Code
1300******************************************************************************/
1301BERR_Code BTHD_Close(
1302   BTHD_Handle h   /* [in] BTHD handle */
1303);
1304
1305
1306/******************************************************************************
1307Summary:
1308   Downloads the microcode and runs the AP.
1309Description:
1310   This function downloads the microcode to the AP RAM and then starts running
1311   the AP.
1312Returns:
1313   BERR_Code : BERR_SUCCESS = AP is running and successfully initialized
1314******************************************************************************/
1315BERR_Code BTHD_Init(
1316   BTHD_Handle   h,       /* [in] BTHD handle */
1317   const uint8_t *pImage, /* [in] pointer to microcode image. Set to NULL to use default image */
1318   uint32_t imageLength   /* [in] length of image. Set to 0 when using default image */
1319);
1320
1321/******************************************************************************
1322Summary:
1323   Reads a register.
1324Description:
1325   This function reads a register.  This function is normally used for
1326   non-memory mapped BTHD devices, such as BCM3520.
1327Returns:
1328   BERR_Code
1329******************************************************************************/
1330BERR_Code BTHD_ReadRegister(
1331   BTHD_Handle hTHD,  /* [in] BTHD handle */
1332   uint32_t    reg,   /* [in] address of register to read */
1333   uint32_t    *val   /* [in] contains data that was read */
1334);
1335
1336
1337/******************************************************************************
1338Summary:
1339   Writes a register.
1340Description:
1341   This function writes to a register.  This function is normally used for
1342   non-memory mapped BTHD devices, such as BCM3520.
1343Returns:
1344   BERR_Code
1345******************************************************************************/
1346BERR_Code BTHD_WriteRegister(
1347   BTHD_Handle hTHD,  /* [in] BTHD handle */
1348   uint32_t    reg,   /* [in] address of register to write */
1349   uint32_t    *val   /* [in] contains data to write */
1350);
1351
1352
1353/******************************************************************************
1354Summary:
1355   Initiates an I2C write transaction from the front end device's I2C
1356   controller.
1357Description:
1358   This function programs the front end device's master i2c controller to
1359   transmit the data given in buf[].  If there is no master i2c controller on
1360   the front end device, this function will return BERR_NOT_SUPPORTED.
1361Returns:
1362   BERR_Code
1363******************************************************************************/
1364BERR_Code BTHD_Mi2cWrite(
1365   BTHD_Handle h,      /* [in] BTHD handle */
1366   uint8_t slave_addr, /* [in] address of the i2c slave device */
1367   uint8_t *buf,       /* [in] specifies the data to transmit */
1368   uint8_t n           /* [in] number of bytes to transmit after the i2c slave address */
1369);
1370
1371
1372/******************************************************************************
1373Summary:
1374   Initiates an I2C read transaction from the front end device's I2C
1375   controller.
1376Description:
1377   This function programs the front end device's master i2c controller to
1378   transmit the data given in buf[].  If there is no master i2c controller on
1379   the front end device, this function will return BERR_NOT_SUPPORTED.
1380Returns:
1381   BERR_Code
1382******************************************************************************/
1383BERR_Code BTHD_Mi2cRead(
1384   BTHD_Handle h,      /* [in] BTHD handle */
1385   uint8_t slave_addr, /* [in] address of the i2c slave device */
1386   uint8_t *out_buf,   /* [in] specifies the data to transmit before the i2c restart condition */
1387   uint8_t out_n,      /* [in] number of bytes to transmit before the i2c restart condition not including the i2c slave address */
1388   uint8_t *in_buf,    /* [out] holds the data read */
1389   uint8_t in_n        /* [in] number of bytes to read after the i2c restart condition not including the i2c slave address */
1390);
1391
1392/***************************************************************************
1393Summary:
1394   Sets the Acquire parameters for the inband channel.
1395Description:
1396   Sets the Acquire parameters for the inband channel.
1397Returns:
1398   BERR_Code
1399
1400****************************************************************************/ 
1401BERR_Code BTHD_SetAcquireParams(
1402   BTHD_Handle h,      /* [in] BTHD handle */
1403   const BTHD_InbandParams *pParams  /* [in] inband acquisition parameters */
1404);
1405
1406/***************************************************************************
1407Summary:
1408   Gets the Acquire parameters for the inband channel.
1409Description:
1410   Gets the Acquire parameters for the inband channel.
1411Returns:
1412   BERR_Code
1413
1414****************************************************************************/ 
1415BERR_Code BTHD_GetAcquireParams(
1416   BTHD_Handle h,      /* [in] BTHD handle */
1417   BTHD_InbandParams *pParams  /* [out] inband acquisition parameters */ 
1418);
1419   
1420   
1421/******************************************************************************
1422Summary:
1423   Acquire the inband channel.
1424Description:
1425   Tells the Thd core to start DVB-T channel acquisition.
1426Returns:
1427   BERR_Code
1428******************************************************************************/
1429BERR_Code BTHD_TuneAcquire(
1430   BTHD_Handle h,                    /* [in] BTHD handle */
1431   const BTHD_InbandParams *pParams  /* [in] inband acquisition parameters */
1432);
1433
1434/******************************************************************************
1435Summary:
1436   Acquire the inband ananlog channel
1437Description:
1438   Tells the IFD core to start channel acqusition
1439Returns:
1440   BERR_Code
1441******************************************************************************/
1442BERR_Code BTHD_AcquireIfd(
1443        BTHD_Handle h,                                  /* [in] BTHD handle */
1444        const BTHD_IfdParams *pParams   /* [in] IFD acquisition parameters */
1445        );
1446
1447/******************************************************************************
1448Summary:
1449   Gets IFD status.
1450Description:
1451   This function returns IFD status information.
1452Returns:
1453   BERR_Code
1454******************************************************************************/
1455BERR_Code BTHD_GetIfdStatus(
1456        BTHD_Handle h,                  /* [in] BTHD handle */
1457        BTHD_IfdStatus *pIfdStatus              /* [out] IFD Status structure */
1458        );
1459
1460/******************************************************************************
1461Summary:
1462    This function gets the status asynchronously of THD module channel.
1463
1464Description:
1465    This function is responsible for asynchronously getting the complete status
1466    for a THD module channel. BTHD_RequestThdAsyncStatus() is called to notify the
1467    frontend to calculate the status and notify the backend asynchronously
1468    that the status is ready then BTHD_GetAsyncThdStatus() needs to be called to
1469    retrieve the status.
1470
1471Returns:
1472   BERR_Code
1473******************************************************************************/
1474BERR_Code BTHD_RequestThdAsyncStatus(
1475   BTHD_Handle h  /* [in] BTHD handle */
1476);
1477
1478/******************************************************************************
1479Summary:
1480   Gets THD Async status.
1481Description:
1482   This function returns THD Asyncstatus information.
1483Returns:
1484   BERR_Code
1485******************************************************************************/
1486BERR_Code BTHD_GetThdAsyncStatus(
1487   BTHD_Handle h,           /* [in] BTHD handle */
1488   BTHD_THDStatus *pStatus  /* [out] THD status   */
1489);
1490   
1491/******************************************************************************
1492Summary:
1493   Gets THD status.
1494Description:
1495   This function returns THD status information.
1496Returns:
1497   BERR_Code
1498******************************************************************************/
1499BERR_Code BTHD_GetThdStatus(
1500   BTHD_Handle h,           /* [in] BTHD handle */
1501   BTHD_THDStatus *pStatus  /* [out] THD status   */
1502);
1503
1504
1505/******************************************************************************
1506Summary:
1507   Resets inband FEC bit error and block counters.
1508Description:
1509   This function clears the following counters in BTHD_THDStatus/BTHD_QamStatus:
1510   corrErrCount, corrBlockCount, ucorrBlockCount, cleanBlockCount, and berCount
1511Returns:
1512   BERR_Code
1513******************************************************************************/
1514BERR_Code BTHD_ResetInbandStatus(
1515   BTHD_Handle h  /* [in] BTHD handle */
1516);
1517
1518
1519/******************************************************************************
1520Summary:
1521   Gets the currents settings for the BTHD PI.
1522Description:
1523   This function returns the current settings being used on the BTHD PI.
1524Returns:
1525   BERR_Code
1526******************************************************************************/
1527BERR_Code BTHD_GetSettings(
1528   BTHD_Handle h,           /* [in] BTHD handle */
1529   BTHD_Settings *pSettings /* [out] current BTHD settings */
1530);
1531
1532
1533/******************************************************************************
1534Summary:
1535   Modifies the currents settings for the BTHD PI.
1536Description:
1537   This function modifies the current settings for the BTHD PI.
1538Returns:
1539   BERR_Code
1540******************************************************************************/
1541BERR_Code BTHD_SetSettings(
1542   BTHD_Handle h,           /* [in] BTHD handle */
1543   BTHD_Settings *pSettings /* [in] new BTHD settings */
1544);
1545
1546
1547
1548/******************************************************************************
1549Summary:
1550   This function returns the BTHD interrupt event handle.
1551Description:
1552   This function is used for an i2c-controlled BTHD device only.  The
1553   application will need to call this function to get the event handle
1554   for BTHD interrupts.  The application will wait on this interrupt event.
1555   When this event is signalled, the application must call
1556   BTHD_ProcessInterruptEvent().  For memory-mapped BTHD devices, this function
1557   will return BERR_NOT_SUPPORTED.
1558Returns:
1559   BERR_Code
1560******************************************************************************/
1561BERR_Code BTHD_GetInterruptEventHandle(
1562   BTHD_Handle h,            /* [in] BTHD handle */
1563   BKNI_EventHandle *phEvent /* [out] event handle */
1564);
1565
1566
1567
1568/******************************************************************************
1569Summary:
1570   This function returns the BTHD interrupt event handle.
1571Description:
1572Returns:
1573   BERR_Code
1574******************************************************************************/
1575BERR_Code BTHD_GetBBSInterruptEventHandle(
1576   BTHD_Handle h,            /* [in] BTHD handle */
1577   BKNI_EventHandle *phEvent /* [out] event handle */
1578);
1579
1580/******************************************************************************
1581Summary:
1582   Handle BTHD interrupts.
1583Description:
1584   This function must be called when the host receives an interrupt from the
1585   BTHD device.
1586Returns:
1587   BERR_Code
1588******************************************************************************/
1589BERR_Code BTHD_HandleInterrupt_isr(
1590   BTHD_Handle h   /* [in] BTHD handle */
1591);
1592
1593
1594/******************************************************************************
1595Summary:
1596   This function processes BTHD interrupt events.
1597Description:
1598   This function is used for an i2c-controlled BTHD device only.  The
1599   application calls this function when a BTHD interrupt event has been
1600   signalled.  This function will decode the interrupt and set approriate
1601   events.  For memory-mapped BTHD devices, this function will return
1602   BERR_NOT_SUPPORTED.
1603Returns:
1604   BERR_Code
1605******************************************************************************/
1606BERR_Code BTHD_ProcessInterruptEvent(
1607   BTHD_Handle hTHD  /* [in] THD device handle */
1608);
1609
1610
1611/******************************************************************************
1612Summary:
1613   This function processes BTHD interrupt events.
1614Description:
1615
1616Returns:
1617   BERR_Code
1618******************************************************************************/
1619BERR_Code BTHD_ProcessBBSInterruptEvent(
1620   BTHD_Handle hTHD  /* [in] THD device handle */
1621);
1622
1623
1624/******************************************************************************
1625Summary:
1626   This function reads the chip id
1627Description:
1628   This function is used to figure out which chip revision is the software
1629   connected to. The revision is important information as it determines which
1630   hexfile to download
1631Returns:
1632   BERR_Code
1633******************************************************************************/
1634BERR_Code BTHD_GetChipRevision(
1635   BTHD_Handle hTHD,  /* [in] THD device handle */
1636   uint8_t* revision /* [out] Chip revision, for 3461 revision is 16 bits */
1637);
1638
1639/******************************************************************************
1640Summary:
1641   This function reads THD software version
1642Description:
1643   This function is used to figure out what version of the THD software is
1644   currently running. The revision is important information as it determines
1645   which firmware was downloaded
1646Returns:
1647   BERR_Code
1648******************************************************************************/
1649BERR_Code BTHD_GetVersion(
1650   BTHD_Handle hTHD,  /* [in] THD device handle */
1651   uint32_t* version, /* [out] firmware revision, for 3461 version is lower 16 bits(e.g. Ver. 1.4 is represented by 0x00000104) */
1652   uint32_t* checksum /* [out] firmware checksum */
1653);
1654
1655/******************************************************************************
1656Summary:
1657   Returns the Lock State Change event handle.
1658Description:
1659   If the application wants to know when the downstream channel goes in lock or
1660   out of lock, it should use this function to get a handle to the Lock State
1661   Change event.  This event is set whenever the downstream channel lock status
1662   changes.
1663Returns:
1664   BERR_Code
1665******************************************************************************/
1666BERR_Code BTHD_GetLockStateChangeEventHandle(
1667   BTHD_Handle h,     /* [in] BTHD channel handle */
1668   BKNI_EventHandle *hEvent  /* [out] lock event handle */
1669);
1670
1671/******************************************************************************
1672Summary:
1673   Gets I/Q soft decisions for THD
1674Description:
1675   This function is mainly used for inband QAM/VSB constellation display.  This
1676   function returns 30 pairs of I/Q values.
1677Returns:
1678   BERR_Code
1679******************************************************************************/
1680BERR_Code BTHD_GetSoftDecisionBuf(
1681   BTHD_Handle h,  /* [in] BTHD handle */
1682   int16_t *pI,    /* [out] 30 I-values */
1683   int16_t *pQ     /* [out] 30 Q-values */
1684);
1685
1686/******************************************************************************
1687Summary:
1688   Gets default inband param settings used in DVB-T acquire
1689Description:
1690   This function is used to get a set of default parameters that can be passed
1691   to the BTHD_TuneAcquire function
1692Returns:
1693   BERR_Code
1694******************************************************************************/
1695BERR_Code BTHD_GetDefaultInbandParams(
1696    BTHD_Handle h,  /* [in] BTHD handle */
1697    BTHD_InbandParams* pDefInbandParam /* [out] default param */
1698);
1699
1700/******************************************************************************
1701Summary:
1702   Gets default inband param settings used in IFD acquire
1703Description:
1704   This function is used to get a set of default parameters that can be passed
1705   to the BTHD_AcquireIfd function
1706Returns:
1707   BERR_Code
1708******************************************************************************/
1709BERR_Code BTHD_GetDefaultIfdParams(
1710    BTHD_Handle h,  /* [in] BTHD handle */
1711    BTHD_IfdParams* pDefIfdParam /* [out] default param */
1712);
1713
1714/******************************************************************************
1715Summary:
1716   Reset internal counters for IFD status
1717Description:
1718   This function is used to get a set of default parameters that can be passed
1719   to the BTHD_AcquireIfd function
1720Returns:
1721   BERR_Code
1722******************************************************************************/
1723BERR_Code BTHD_ResetIfdStatus(
1724    BTHD_Handle h  /* [in] BTHD handle */
1725);
1726
1727/******************************************************************************
1728Summary:
1729   Retrieve the current IFD audio carrier settings
1730Description:
1731   This function is used to get current audio carrier settings
1732Returns:
1733   BERR_Code
1734******************************************************************************/
1735BERR_Code BTHD_GetIfdAudioSettings(
1736    BTHD_Handle h,                          /* [in] BTHD handle */
1737    BTHD_IfdAudioSettings* audioSettings    /* [out] Audio settings structure */
1738);
1739
1740/******************************************************************************
1741Summary:
1742   Sets the current IFD audio carrier settings
1743Description:
1744   This function is used to set current audio carrier settings after acqusition.
1745   These settings will be overwritten on an IFDAcquire command.
1746Returns:
1747   BERR_Code
1748******************************************************************************/
1749BERR_Code BTHD_SetIfdAudioSettings(
1750    BTHD_Handle h,                         /* [in] BTHD handle */
1751    const BTHD_IfdAudioSettings* audioSettings   /* [in] Audio settings structure */
1752);
1753
1754/******************************************************************************
1755Summary:
1756   Turn On clocks to all frontend related cores
1757Description:
1758   This function is used by dynamic power management to essentially power up
1759   all frontend related cores.
1760Returns:
1761   BERR_Code
1762******************************************************************************/
1763BERR_Code BTHD_PowerUp(
1764    BTHD_Handle h                         /* [in] BTHD handle */
1765);
1766
1767/******************************************************************************
1768Summary:
1769   Turn off clocks to all frontend related cores include AFE, THD, IFD and PLLs
1770Description:
1771   This function is used by dynamic power management to essentially shut off
1772   all frontend related cores. To bring core back the application needs to call
1773   either acquire function or the init function
1774Returns:
1775   BERR_Code
1776******************************************************************************/
1777BERR_Code BTHD_PowerDown(
1778    BTHD_Handle h                         /* [in] BTHD handle */
1779);
1780
1781/******************************************************************************
1782Summary:
1783   Get a handle for EWS
1784Description:
1785
1786Returns:
1787   BERR_Code
1788******************************************************************************/
1789BERR_Code BTHD_GetEWSEventHandle(   BTHD_Handle h,     /* [in] BTHD channel handle */
1790   BKNI_EventHandle *hEvent  /* [out] lock event handle */
1791);
1792
1793/******************************************************************************
1794Summary:
1795   Get the THD lock status without pulling all other status
1796Description:
1797
1798Returns:
1799   BERR_Code
1800******************************************************************************/
1801BERR_Code BTHD_GetThdLockStatus(  BTHD_Handle h,           /* [in] BTHD handle */
1802   BTHD_LockStatus *pLockStatus /* [out] THD lock status   */
1803);
1804
1805/***************************************************************************
1806Summary:
1807    This function is responsible for installing a callback function.
1808
1809Description:
1810    This function installs a callback function.
1811
1812Returns:
1813    TODO:
1814
1815See Also:
1816
1817****************************************************************************/
1818BERR_Code BTHD_InstallCallback(
1819    BTHD_Handle h,            /* [in] Device channel handle */
1820    BTHD_Callback callbackType,  /* [in] Type of callback */
1821    BTHD_CallbackFunc pCallback, /* [in] Function Ptr to callback */
1822    void *pParam                 /* [in] Generic parameter send on callback */
1823    );
1824#ifdef __cplusplus
1825}
1826#endif
1827
1828#endif /* BTHD_H__ */
1829
Note: See TracBrowser for help on using the repository browser.