source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/thd/7552/bthd_acq.h

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

first commit

  • Property svn:executable set to *
File size: 12.2 KB
Line 
1/***************************************************************************
2*     (c)2005-2012 Broadcom Corporation
3
4*  This program is the proprietary software of Broadcom Corporation and/or its licensors,
5*  and may only be used, duplicated, modified or distributed pursuant to the terms and
6*  conditions of a separate, written license agreement executed between you and Broadcom
7*  (an "Authorized License").  Except as set forth in an Authorized License, Broadcom grants
8*  no license (express or implied), right to use, or waiver of any kind with respect to the
9*  Software, and Broadcom expressly reserves all rights in and to the Software and all
10*  intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11*  HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12*  NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. 
13*   
14*  Except as expressly set forth in the Authorized License,
15*   
16*  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17*  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18*  and to use this information only in connection with your use of Broadcom integrated circuit products.
19*   
20*  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21*  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22*  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23*  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24*  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25*  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26*  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27*  USE OR PERFORMANCE OF THE SOFTWARE.
28
29*  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30*  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31*  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32*  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33*  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34*  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35*  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36*  ANY LIMITED REMEDY.
37*
38 * $brcm_Workfile: bthd_acq.h $
39 * $brcm_Revision: 28 $
40 * $brcm_Date: 3/8/12 12:02a $
41 *
42 * [File Description:]
43 *
44 * Revision History:
45 *
46* $brcm_Log: /AP/ctfe/core/thd/bthd_acq.h $
47*
48* 28   3/8/12 12:02a farshidf
49* SW3461-171: merge to main
50*
51* Fw_Integration_Devel/5   2/8/12 5:11p farshidf
52* SW3461-1: remove warning
53*
54* 27   2/8/12 5:10p farshidf
55* SW3461-1: remove warning
56*
57* 26   2/8/12 2:51p farshidf
58* SW3461-1: remove warning
59*
60* Fw_Integration_Devel/4   2/8/12 2:47p farshidf
61* SW3461-1: remove warning
62*
63* Fw_Integration_Devel/3   1/20/12 6:30p farshidf
64* SW3461-1: merge to integ
65*
66* Fw_Integration_Devel/AP_V3_0_THD_DEV/2   1/6/12 1:54p farshidf
67* SW3461-40: merge to Dev branch
68*
69* Fw_Integration_Devel/AP_V3_0_THD_DEV/SW3461-40/3   10/27/11 2:33p mpovich
70* SW3461-40: Abort-Early for THD acquire (Initial
71*  concept/implementation).
72*
73* Fw_Integration_Devel/AP_V3_0_THD_DEV/SW3461-40/2   10/27/11 11:32a mpovich
74* SW3461-40: Abort-Early for THD acquire (Initial
75*  concept/implementation).
76*
77* Fw_Integration_Devel/AP_V3_0_THD_DEV/SW3461-40/1   10/24/11 10:02p mpovich
78* SW3461-40: Abort-Early for THD acquire (Initial
79*  concept/implementation).
80*
81* Fw_Integration_Devel/AP_V3_0_THD_DEV/1   9/26/11 2:40p mbsingh
82* SW3461-1: Merge from 2.0 dev branch (This is mainly a shift to WPO
83*  algorithm)
84*
85* Fw_Integration_Devel/AP_V2_0_THD_DEV/4   9/9/11 6:08p mbsingh
86* SW3461-1:  - Added back AcquirechangeFFTwindow function (needed by
87*  ISDB-T)
88*
89* Fw_Integration_Devel/AP_V2_0_THD_DEV/3   9/8/11 10:48p mbsingh
90* SW3461-1:  Separated SetFW function cleanly now to make DVBT work for
91*  ISDBT containing chips also.  In initial merged code from THD_FTT_WPO
92*  branch DVBT would work only in non ISDBT chips due to wrong SetFW
93*  function selection
94*
95* Fw_Integration_Devel/AP_V2_0_THD_DEV/2   9/8/11 10:05p mbsingh
96* SW3461-1: Merging from THD_FTT_WPO branch                   -
97*  Architectural change to new FTT algo for acquisition
98*
99* Fw_Integration_Devel/AP_V0_6_THD_DEV/Thd_ftt_wpo/1   8/18/11 10:50a hzou
100* Ported changes for FTT and WPO
101*
102* 23   8/24/11 5:54p farshidf
103* SW7552-60: merge to main
104*
105* Fw_Integration_Devel/1   8/24/11 5:47p farshidf
106* SW7552-60: add the isdb-t constellation
107*
108* Fw_Integration_Devel/AP_V2_0_THD_DEV/1   8/24/11 5:40p farshidf
109* SW7552-60: add the softdecision for isdbt
110*
111* 22   6/8/11 6:25p farshidf
112* SW3461-1: merge main
113*
114* Dvb_Fw_Devel_4/1   6/8/11 5:20p farshidf
115* SW3461-1: sync up with backend chip
116*
117* Hydra_Software_Devel/2   5/27/11 10:51a farshidf
118* SW7552-36: compiel fix
119*
120* 20   4/21/11 6:21p farshidf
121* SW3461-1: merge main
122*
123* 19   4/21/11 5:47p farshidf
124* SW3461-1: merge main
125*
126* DVB_3461_1/5   4/21/11 5:46p farshidf
127* SW3461-1: merge main
128*
129* DVB_3461_1/4   4/15/11 9:37p jputnam
130* SW3461-1: Firmware FFT trigger positioning functional. Feature can be
131*  disabled by removing #define FFTTriggerPosition in bthd_acq.h
132*
133* DVB_3461_1/3   4/12/11 10:25a jputnam
134* SW3461-1: Added P_GetChannelEstimateBuf() and
135*  P_GetInterpolatorCoefficientsBuf() functions. Reduced FI leakage to
136*  2^(-20)
137*
138* DVB_3461_1/2   4/11/11 9:16a jputnam
139* SW3461-1: Functional CoChannel mode
140*
141* DVB_3461_1/1   4/7/11 9:29p jputnam
142* SW3461-1: Initial version of interrupt-based lock detection
143*
144* 14   3/9/11 3:44p jputnam
145* SW3461-1: Moved status copy from BTHD_P_Status() up to BTHD_Status()
146*
147* 13   3/4/11 4:52p farshidf
148* SW3461-1: add the power seq
149*
150* 12   1/21/11 5:57p farshidf
151* SW3461-1: update names
152*
153* 11   1/6/11 10:09a jputnam
154* SW3461-1: Major cosmetic overhaul - Conform to new API conventions
155*  common to all demods - Conform to naming conventions for private
156*  functions and typedefs - Separate DVB-T and ISDB-T params, status,
157*  functions
158*
159* 10   1/3/11 5:36p jputnam
160* SW3461-1: changed enumerated type and #define names from THD_ to BTHD_
161*
162* 9   12/16/10 6:48p farshidf
163* SW3461-1: clean up
164*
165* 8   11/30/10 10:49a farshidf
166* SW3461-1: update the thd files
167*
168* 7   11/16/10 6:35p farshidf
169* SW3461-1: clean up
170*
171* 6   11/4/10 2:31p farshidf
172* SW3461-1: clean up the irq
173*
174* 5   11/4/10 10:07a jputnam
175* SW3461-1: Separated Acquire() function into multiple functions called
176*  by a new top-level acquisition state machine
177*
178* 4   9/23/10 5:44p farshidf
179* SW3461-1: add the hab request command
180*
181* 3   9/3/10 5:56p farshidf
182* SW3461-1: bug fix
183*
184* 2   8/27/10 4:42p farshidf
185* SW3461-1: fix compile issues
186*
187* 1   8/17/10 5:12p farshidf
188* SW3461-1: initial THD code
189 *
190 *
191 ***************************************************************************/
192#ifndef _BTHD_ACQ_H__
193#define _BTHD_ACQ_H__
194
195#if __cplusplus
196extern "C" {
197#endif
198
199/* #define ChangeFFTWindowSeamless */
200#define BTHD_CHK_RETCODE(x) \
201  { if ((retCode = (x)) != BERR_SUCCESS) goto done; }
202
203typedef uint32_t BTHD_RESULT;
204
205/***************************************************************************
206 * Register Field Combinations Definition
207 ***************************************************************************/
208#define BCHP_THD_CORE_EQ_EXP_USE_FORMAT_OV_SHIFT BCHP_THD_CORE_EQ_FORMAT_OV_SHIFT
209#define BCHP_THD_CORE_EQ_EXP_USE_FORMAT_OV_MASK  (BCHP_THD_CORE_EQ_FORMAT_OV_MASK | BCHP_THD_CORE_EQ_USE_FORMAT_OV_MASK)
210
211#define BCHP_THD_CORE_BYP_EXP_AVG_NSE_SHIFT BCHP_THD_CORE_BYP_EXP_NSE_BYP_SHIFT
212#define BCHP_THD_CORE_BYP_EXP_AVG_NSE_MASK  (BCHP_THD_CORE_BYP_EXP_NSE_BYP_MASK | BCHP_THD_CORE_BYP_EXP_AVG_NSE_BYP_MASK)
213
214#define BCHP_THD_CORE_CE_ACE_ACT_SHIFT BCHP_THD_CORE_CE_ACE_SHIFT
215#define BCHP_THD_CORE_CE_ACE_ACT_MASK  (BCHP_THD_CORE_CE_ACE_MASK | BCHP_THD_CORE_CE_ACT_MASK)
216
217#define BCHP_THD_CORE_RST_RS_FEC_BCH_TPS_SNR_RST_SHIFT BCHP_THD_CORE_RST_SNR_RST_SHIFT
218#define BCHP_THD_CORE_RST_RS_FEC_BCH_TPS_SNR_RST_MASK  (BCHP_THD_CORE_RST_SNR_RST_MASK | BCHP_THD_CORE_RST_TPS_RST_MASK  | BCHP_THD_CORE_RST_TPS_SAVE_RST_MASK | BCHP_THD_CORE_RST_BCH_ERC_RST_MASK | BCHP_THD_CORE_RST_FEC_RST_MASK | BCHP_THD_CORE_RST_RS_RST_MASK)
219
220#define BCHP_THD_CORE_FRZ_NOTCH_FRZ_SHIFT BCHP_THD_CORE_FRZ_NOTCH0M_FRZ_SHIFT
221#define BCHP_THD_CORE_FRZ_NOTCH_FRZ_MASK  (BCHP_THD_CORE_FRZ_NOTCH0M_FRZ_MASK | BCHP_THD_CORE_FRZ_NOTCH0_FRZ_MASK  | BCHP_THD_CORE_FRZ_NOTCH1_FRZ_MASK | BCHP_THD_CORE_FRZ_NOTCH2_FRZ_MASK | BCHP_THD_CORE_FRZ_NOTCH3_FRZ_MASK | BCHP_THD_CORE_FRZ_NOTCH4_FRZ_MASK | BCHP_THD_CORE_FRZ_NOTCH_DDFS_FRZ_MASK)
222
223#define BCHP_THD_CORE_TPS_OV_RX_INFO_SHIFT BCHP_THD_CORE_TPS_OV_QAM_SHIFT
224#define BCHP_THD_CORE_TPS_OV_RX_INFO_MASK  (BCHP_THD_CORE_TPS_OV_QAM_MASK | BCHP_THD_CORE_TPS_OV_reserved5_MASK  | BCHP_THD_CORE_TPS_OV_HIERARCHY_MASK | BCHP_THD_CORE_TPS_OV_INDEPTH_MASK | BCHP_THD_CORE_TPS_OV_reserved4_MASK | BCHP_THD_CORE_TPS_OV_CRATE_HP_MASK)
225
226#define BCHP_THD_CORE_TPS_RX_INFO_SHIFT BCHP_THD_CORE_TPS_QAM_SHIFT
227#define BCHP_THD_CORE_TPS_RX_INFO_MASK  (BCHP_THD_CORE_TPS_QAM_MASK | BCHP_THD_CORE_TPS_reserved5_MASK  | BCHP_THD_CORE_TPS_HIERARCHY_MASK | BCHP_THD_CORE_TPS_INDEPTH_MASK | BCHP_THD_CORE_TPS_reserved4_MASK | BCHP_THD_CORE_TPS_CRATE_HP_MASK)
228
229#define BCHP_THD_CORE_BYP_EQ_BYP_SHIFT BCHP_THD_CORE_BYP_EQ_BIT_SCALING_BYP_SHIFT
230#define BCHP_THD_CORE_BYP_EQ_BYP_MASK  (BCHP_THD_CORE_BYP_EQ_BIT_SCALING_BYP_MASK | BCHP_THD_CORE_BYP_NSE_AVG_BYP_MASK  | BCHP_THD_CORE_BYP_EXP_CHAN_BYP_MASK | BCHP_THD_CORE_BYP_EXP_NSE_BYP_MASK | BCHP_THD_CORE_BYP_EXP_AVG_NSE_BYP_MASK)
231
232/* Implementation of API functions */
233
234   
235/* Internal THD Functions */
236BERR_Code BTHD_P_GetChannelEstimateBuf(BTHD_3x7x_Handle, uint32_t *, THD_SnooperMode_t);
237BERR_Code BTHD_P_GetInterpolatorCoefficientsBuf(BTHD_3x7x_Handle, uint32_t *, THD_InterpolatorMode_t);
238BERR_Code BTHD_P_OSleep(BTHD_3x7x_Handle,uint32_t,uint32_t,uint32_t);
239void BTHD_P_UpdateStatusChange(BTHD_3x7x_Handle,uint32_t);
240BERR_Code BTHD_P_Init(BTHD_3x7x_Handle);
241BERR_Code BTHD_P_Acquire(BTHD_3x7x_Handle);
242void BTHD_P_SetTs(BTHD_3x7x_Handle);
243void BTHD_P_SetFrequency(BTHD_3x7x_Handle);
244void BTHD_P_SetFrontEnd(BTHD_3x7x_Handle);
245void BTHD_P_SetNotch(BTHD_3x7x_Handle);
246THD_TransGuardResult_t BTHD_P_SetTransGuard(BTHD_3x7x_Handle);
247
248void BTHD_P_SetCE( BTHD_3x7x_Handle,THD_ChannelEstimatorMode_t);
249void BTHD_P_WriteFICoef( BTHD_3x7x_Handle,THD_FrequencyInterpolatorMode_t);
250void BTHD_P_Status(BTHD_3x7x_Handle);
251BTHD_RESULT BTHD_P_Lock(BTHD_3x7x_Handle);
252void BTHD_P_ResetAll(BTHD_3x7x_Handle);
253void BTHD_P_ResetAcquire(BTHD_3x7x_Handle);
254void BTHD_P_ResetStatus(BTHD_3x7x_Handle);
255void BTHD_P_ResetStatusHW(BTHD_3x7x_Handle);
256void BTHD_P_Config(BTHD_3x7x_Handle);
257BTHD_RESULT BTHD_P_AcquireInit(BTHD_3x7x_Handle,THD_FFTWindowMode_t);
258BTHD_RESULT BTHD_P_AcquireSP(BTHD_3x7x_Handle);
259BTHD_RESULT BTHD_P_AcquireFFTTrigger(BTHD_3x7x_Handle);
260BTHD_RESULT BTHD_P_AcquireTPS(BTHD_3x7x_Handle);
261BTHD_RESULT BTHD_P_AcquireFEC(BTHD_3x7x_Handle,bool);
262BTHD_RESULT BTHD_P_AcquireChangeFFTWindow(BTHD_3x7x_Handle,THD_FFTWindowMode_t);
263BTHD_RESULT BTHD_P_AcquireTrack(BTHD_3x7x_Handle,THD_FFTWindowMode_t,THD_ChannelEstimatorMode_t);
264BTHD_RESULT BTHD_P_AcquireCheckLock(BTHD_3x7x_Handle);
265BTHD_RESULT BTHD_P_AcquireChangeChannelEstimator(BTHD_3x7x_Handle,THD_ChannelEstimatorMode_t);
266BTHD_RESULT BTHD_P_MapWaitForEventResult_To_THD_AcqResult ( BERR_Code eEventWaitResult, BTHD_RESULT successCode, BTHD_RESULT failureCode );
267bool BTHD_P_Wait_CE_Recording_Status_Done ( BTHD_3x7x_Handle h, uint32_t uTimeOutMsec );
268void BTHD_P_AbortAcquire ( BTHD_3x7x_Handle h) ;
269
270/* Sets the Abort-Early event/condition during an acquisition */
271void BTHD_P_AbortAcquire ( BTHD_3x7x_Handle h );
272/* Resets the Abort-Early event/condition during an acquisition */
273void BTHD_P_AbortAcquireReset ( BTHD_3x7x_Handle h );
274/* Queries an aquisition's Abort-Early event/condition */
275bool BTHD_P_IsAbortAcquireRequested ( BTHD_3x7x_Handle h );
276/* Wait for an event (or Abort-Early) during an acquisition */
277BERR_Code BTHD_P_WaitForEventOrAbort ( BTHD_3x7x_Handle h, BKNI_EventHandle event, int timeoutMsec );
278/* Acquire Aborted Early BERR_Code */
279#define BTHD_ERR_ACQUIRE_ABORTED  BERR_MAKE_CODE(BERR_THD_ID, 1)
280
281#ifdef __cplusplus
282}
283#endif
284
285#endif /* BTHD_ACQ_H__ */
286
Note: See TracBrowser for help on using the repository browser.