source: svn/newcon3bcm2_21bu/nexus/modules/frontend/common/include/nexus_frontend_qam.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 19.0 KB
Line 
1/***************************************************************************
2*     (c)2004-2011 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: nexus_frontend_qam.h $
39* $brcm_Revision: 30 $
40* $brcm_Date: 12/8/11 4:32p $
41*
42* API Description:
43*   API name: Frontend QAM
44*    Generic APIs for QAM tuning.
45*
46* Revision History:
47*
48* $brcm_Log: /nexus/modules/frontend/common/include/nexus_frontend_qam.h $
49*
50* 30   12/8/11 4:32p erickson
51* SW7552-154: clarify that NEXUS_FrontendQamSettings.scan can be used in
52*  eAuto mode
53*
54* 29   12/5/11 3:47p erickson
55* SW7552-154: add NEXUS_FrontendQamSettings.scan.frequencyOffset
56*
57* 28   11/17/11 4:33p erickson
58* SW3461-96: Remove GetLockStatus and replace it with GetFastStatus
59*
60* 27   11/1/11 4:04p erickson
61* SW3461-50, SW3128-16: change
62*  NEXUS_FrontendQamScanStatus.frequencyOffset to signed int
63*
64* 26   10/12/11 10:30a erickson
65* SW3461-50, SW3128-16: add qam scan
66*
67* 25   5/27/11 1:46p erickson
68* SW7231-180: convert NEXUS_FrontendQamFrequencyOffset to unsigned with
69*  backward-compat macros
70*
71* 24   5/11/11 10:58a erickson
72* SW3128-10: add asyncStatusReadyCallback
73*
74* 23   11/9/10 5:11p erickson
75* SW7125-726: add NEXUS_FrontendQamAnnex_eC
76*
77* 22   10/21/10 5:51p mphillip
78* SW7420-1020: Add asynchronous status API
79*
80* 21   9/13/10 12:18p erickson
81* SW35230-1306: deprecate NEXUS_FrontendXxxBandwidth. use unsigned
82*  integer in units of Hz instead.
83*
84* 20   8/5/10 4:32p erickson
85* SW7405-4722: Add support for "Frequency offset" and "Null packets" for
86*  ADS and expose "auto acquire" in nexus for AOB
87*
88* 19   4/21/10 9:31a jgarrett
89* SW7550-388: Merging to main branch
90*
91* 18   3/5/10 4:36p bandrews
92* SW7405-3995: fix mistype
93*
94* 17   3/5/10 3:28p bandrews
95* SW7405-3995: added spectrum mode and spectral inversion settings
96*
97* SW7550_236/1   4/15/10 1:43p farshidf
98* SW7550_236: add the LNA AGD element in the status struct for 7550
99*
100* 16   1/19/10 5:39p mphillip
101* SW7405-3722: Flag power management change on correct JIRA
102*
103* 15   1/15/10 1:53p mphillip
104* SW7550-135: Add power management flag
105*
106* 14   12/31/09 4:13p erickson
107* SW7550-135: add NEXUS_FrontendQamBandwidth
108*
109* 13   12/15/09 11:53a mphillip
110* SW7405-3596: Expose QAM auto acquire setting as a user-configurable
111*  parameter
112*
113* 12   7/20/09 12:47p erickson
114* PR56816: add viterbiErrorRate status and related fields, improve
115*  comments
116*
117* 11   6/30/09 9:10a erickson
118* PR56070: changed type of NEXUS_FrontendQamStatus.dsChannelPower
119*
120* 10   5/21/09 10:23a erickson
121* PR55095: added NEXUS_FrontendQamStatus.interleaveDepth
122*
123* 9   3/5/09 10:42a jgarrett
124* PR 52817: Converting offset values to signed
125*
126* 8   10/14/08 3:33p erickson
127* PR47842: added postRsBer fields to NEXUS_FrontendQamStatus
128*
129* 7   9/23/08 9:16a jgarrett
130* PR 46513: Merging 97459 support to mainline
131*
132* 6   7/22/08 11:02a jgarrett
133* PR 45000: Adding ifFrequency for QAM
134*
135* PR44830/1   7/22/08 7:47p anilmm
136* PR44830: Add to QAM tuning status
137*
138* 5   5/1/08 11:19a erickson
139* PR42376: default the QAM symbolRate based on the mode and annex if 0
140*
141* 4   2/12/08 2:34p jgarrett
142* PR 39009: Unifying status
143*
144* 3   1/23/08 8:37p vobadm
145* PR35457: update docs
146*
147* 2   1/23/08 5:16p erickson
148* PR35457: update docs
149*
150* 1   1/18/08 2:19p jgarrett
151* PR 38808: Merging to main branch
152*
153* Nexus_Devel/2   12/20/07 2:30p jgarrett
154* PR 38019: API touchup
155*
156* Nexus_Devel/1   10/4/07 2:41p jgarrett
157* PR 35551: Adding initial version
158*
159***************************************************************************/
160#ifndef NEXUS_FRONTEND_QAM_H__
161#define NEXUS_FRONTEND_QAM_H__
162
163#ifdef __cplusplus
164extern "C" {
165#endif
166
167/***************************************************************************
168Summary:
169QAM tuning modes
170***************************************************************************/
171typedef enum NEXUS_FrontendQamMode
172{
173    NEXUS_FrontendQamMode_e16,
174    NEXUS_FrontendQamMode_e32,
175    NEXUS_FrontendQamMode_e64,
176    NEXUS_FrontendQamMode_e128,
177    NEXUS_FrontendQamMode_e256,
178    NEXUS_FrontendQamMode_e512,
179    NEXUS_FrontendQamMode_e1024,
180    NEXUS_FrontendQamMode_e2048,
181    NEXUS_FrontendQamMode_e4096,
182    NEXUS_FrontendQamMode_eAuto_64_256, /* Automatically scan both QAM-64 and QAM-256.
183                                           Not available on all chipsets. */
184    NEXUS_FrontendQamMode_eMax
185} NEXUS_FrontendQamMode;
186
187/***************************************************************************
188Summary:
189QAM Annex
190***************************************************************************/
191typedef enum NEXUS_FrontendQamAnnex
192{
193    NEXUS_FrontendQamAnnex_eA,
194    NEXUS_FrontendQamAnnex_eB,
195    NEXUS_FrontendQamAnnex_eC,
196    NEXUS_FrontendQamAnnex_eMax
197} NEXUS_FrontendQamAnnex;
198
199/***************************************************************************
200Summary:
201Determines if QAM spectrum mode.
202***************************************************************************/
203typedef enum NEXUS_FrontendQamSpectrumMode
204{
205    NEXUS_FrontendQamSpectrumMode_eAuto,
206    NEXUS_FrontendQamSpectrumMode_eManual,
207    NEXUS_FrontendQamSpectrumMode_eMax
208} NEXUS_FrontendQamSpectrumMode;
209
210/***************************************************************************
211Summary:
212Determines if QAM spectral inversion is enabled or not
213***************************************************************************/
214typedef enum NEXUS_FrontendQamSpectralInversion
215{
216    NEXUS_FrontendQamSpectralInversion_eNormal,
217    NEXUS_FrontendQamSpectralInversion_eInverted,
218    NEXUS_FrontendQamSpectralInversion_eMax
219} NEXUS_FrontendQamSpectralInversion;
220
221/***************************************************************************
222Summary:
223Determines the acquisition type.
224***************************************************************************/
225typedef enum NEXUS_FrontendQamAcquisitionMode
226{
227    NEXUS_FrontendQamAcquisitionMode_eAuto,
228    NEXUS_FrontendQamAcquisitionMode_eFast,
229    NEXUS_FrontendQamAcquisitionMode_eSlow,
230    NEXUS_FrontendQamAcquisitionMode_eScan,
231    NEXUS_FrontendQamAcquisitionMode_eMax
232} NEXUS_FrontendQamAcquisitionMode;
233
234/***************************************************************************
235The NEXUS_FrontendQamBandwidth enum has been deprecated. It is an unsigned integer in units of Hz now.
236The following #defines are for backward compatibility only.
237***************************************************************************/
238#define NEXUS_FrontendQamBandwidth unsigned
239#define NEXUS_FrontendQamBandwidth_e5Mhz 5000000
240#define NEXUS_FrontendQamBandwidth_e6Mhz 6000000
241#define NEXUS_FrontendQamBandwidth_e7Mhz 7000000
242#define NEXUS_FrontendQamBandwidth_e8Mhz 8000000
243#define NEXUS_FrontendQamBandwidth_eMax  4
244
245/***************************************************************************
246The NEXUS_FrontendQamFrequencyOffset enum has been deprecated. It is an unsigned integer in units of Hz now.
247The following #defines are for backward compatibility only.
248***************************************************************************/
249#define NEXUS_FrontendQamFrequencyOffset unsigned
250#define NEXUS_FrontendQamFrequencyOffset_e125Khz 125000
251#define NEXUS_FrontendQamFrequencyOffset_e180Khz 180000 /* Applies only to Annex_B. */
252#define NEXUS_FrontendQamFrequencyOffset_e200Khz 200000 /* Applies only to Annex_A. */
253#define NEXUS_FrontendQamFrequencyOffset_e250Khz 250000
254#define NEXUS_FrontendQamFrequencyOffset_eMax 4
255
256/***************************************************************************
257Summary:
258QAM tuning parameters
259***************************************************************************/
260typedef struct NEXUS_FrontendQamSettings
261{
262    NEXUS_FrontendQamMode mode;
263    NEXUS_FrontendQamAnnex annex;
264    unsigned frequency;                 /* In Hz */
265    unsigned ifFrequency;               /* IF Frequency in Hz */
266    unsigned symbolRate;                /* In Baud. The default value is 0, which causes Nexus to select default symbol rates based on the QamMode. */
267    bool fastAcquisition;               /* True=fast acquisition mode, false=default */
268    bool terrestrial;                   /* Receiver mode: true=terrestrial, false=cable */
269    NEXUS_CallbackDesc lockCallback;    /* Callback will be called when lock status changes */
270    bool autoAcquire;                   /* True = Enable, False = Disable. */
271    unsigned bandwidth;                 /* Tuner frequency bandwidth in Hz */
272    bool enablePowerMeasurement;        /* True = enables calculation of downstream channel power for some frontends like 31xx. For others it is always enabled. False = Disable. */
273    NEXUS_FrontendQamSpectrumMode spectrumMode; /* Spectrum mode. */
274    NEXUS_FrontendQamSpectralInversion spectralInversion; /* Spectral inversion. */
275    unsigned frequencyOffset; /* Automatic Frequency offset range from the tuned frequency in Hz. */
276    bool enableNullPackets; /* Enables/disables improved locking mechanism for Annex_A signals containing >98% null packets.*/
277    NEXUS_CallbackDesc asyncStatusReadyCallback;   /* Callback will be called when the async qam status is ready. */
278    NEXUS_FrontendQamAcquisitionMode acquisitionMode; /* Acquisition mode. */
279    struct {
280        unsigned    upperBaudSearch;    /* Upper baud search range in Hz. Applicable only in scan mode. */ 
281        unsigned    lowerBaudSearch;    /*Lower baud search range in Hz. Applicable only in scan mode. */
282        bool        mode[NEXUS_FrontendQamAnnex_eMax][NEXUS_FrontendQamMode_eMax]; /* Enable/Disable QAM mode search in scan mode. */
283        unsigned    frequencyOffset;    /* in NEXUS_FrontendQamAcquisitionMode_eAuto, frontend uses non-scan frequencyOffset, then uses the scan.frequencyOffset. */
284    } scan; /* only applies if NEXUS_FrontendQamAcquisitionMode_eScan (or eAuto mode when it internally goes into eScan mode) */
285} NEXUS_FrontendQamSettings;
286
287/***************************************************************************
288Summary:
289    Initialize a QAM settings structure to defaults
290***************************************************************************/
291void NEXUS_Frontend_GetDefaultQamSettings(
292    NEXUS_FrontendQamSettings *pSettings
293    );
294
295/***************************************************************************
296Summary:
297    Tune to a QAM channel
298***************************************************************************/
299NEXUS_Error NEXUS_Frontend_TuneQam(
300    NEXUS_FrontendHandle handle,
301    const NEXUS_FrontendQamSettings *pSettings
302    );
303
304/***************************************************************************
305Summary:
306QAM tuning status
307***************************************************************************/
308typedef struct NEXUS_FrontendQamStatus
309{
310    NEXUS_FrontendQamSettings settings; /* Settings provided at last call to NEXUS_Frontend_TuneQam */
311
312    bool receiverLock;          /* Do we have QAM lock? */
313    bool fecLock;               /* Is the FEC locked? */
314    bool opllLock;              /* Is the output PLL locked? */
315    bool spectrumInverted;      /* Is the spectrum inverted? */
316
317    unsigned symbolRate;        /* Baud. received symbol rate (in-band) */
318    int      symbolRateError;   /* symbol rate error in Baud */
319
320    int berEstimate;            /* deprecated */
321
322    unsigned ifAgcLevel;        /* IF AGC level in units of 1/10 percent */
323    unsigned rfAgcLevel;        /* tuner AGC level in units of 1/10 percent */
324    unsigned intAgcLevel;       /* Internal AGC level in units of 1/10 percent */
325    unsigned snrEstimate;       /* snr estimate in 1/100 dB (in-Band). */
326
327    unsigned fecCorrected;      /* FEC corrected block count, accumulated since tune or NEXUS_Frontent_ResetStatus */
328    unsigned fecUncorrected;    /* FEC uncorrected block count, accumulated since tune or NEXUS_Frontent_ResetStatus */
329    unsigned fecClean;          /* FEC clean block count, accumulated since tune or NEXUS_Frontent_ResetStatus */
330    unsigned bitErrCorrected;   /* deprecated: cumulative bit correctable errors. same as viterbiUncorrectedBits. */
331    unsigned reacquireCount;    /* cumulative reacquisition count */
332
333    unsigned viterbiUncorrectedBits; /* uncorrected error bits output from Viterbi, accumulated since tune or NEXUS_Frontent_ResetStatus */
334    unsigned viterbiTotalBits;       /* total number of bits output from Viterbi, accumulated since tune or NEXUS_Frontent_ResetStatus */
335    uint32_t viterbiErrorRate;       /* viterbi bit error rate (BER) in 1/2147483648 th units.
336                                        This is the ratio of uncorrected bits / total bits.
337                                        Convert to floating point by dividing by 2147483648.0 */
338
339    int      carrierFreqOffset; /* carrier frequency offset in 1/1000 Hz */
340    int      carrierPhaseOffset;/* carrier phase offset in 1/1000 Hz */
341
342    unsigned goodRsBlockCount;  /* reset on every read */
343    unsigned berRawCount;       /* reset on every read */
344
345    int      dsChannelPower;    /* OCAP DPM support for video channels, in 10's of dBmV units */
346    unsigned mainTap;           /* Channel main tap coefficient */
347    unsigned equalizerGain;     /* Channel equalizer gain value in dBm */
348    unsigned postRsBer;         /* OCAP requires postRsBer for all DS channels. postRsBer will be reset on every channel change. Same units as berEstimate. */
349    unsigned postRsBerElapsedTime; /* postRsBer over this time. In units of seconds. */
350    uint16_t interleaveDepth;   /* Used in DOCSIS */
351    unsigned lnaAgcLevel;        /* LNA AGC level in units of 1/10 percent */
352} NEXUS_FrontendQamStatus;
353
354/***************************************************************************
355Summary:
356    Get the synchronous status of a QAM tuner
357***************************************************************************/
358NEXUS_Error NEXUS_Frontend_GetQamStatus(
359    NEXUS_FrontendHandle handle,
360    NEXUS_FrontendQamStatus *pStatus /* [out] */
361    );
362
363/***************************************************************************
364Summary:
365    Request the asynchronous status of a QAM tuner
366***************************************************************************/
367NEXUS_Error NEXUS_Frontend_RequestQamAsyncStatus(
368    NEXUS_FrontendHandle handle
369    );
370
371/***************************************************************************
372Summary:
373    Get the asynchronous status of a QAM tuner
374***************************************************************************/
375NEXUS_Error NEXUS_Frontend_GetQamAsyncStatus(
376    NEXUS_FrontendHandle handle,
377    NEXUS_FrontendQamStatus *pStatus /* [out] */
378    );
379
380typedef enum NEXUS_FrontendQamAcquisitionStatus
381{
382    NEXUS_FrontendQamAcquisitionStatus_eNoSignal,
383    NEXUS_FrontendQamAcquisitionStatus_eNoLock,
384    NEXUS_FrontendQamAcquisitionStatus_eLockedFast,
385    NEXUS_FrontendQamAcquisitionStatus_eLockedSlow,
386    NEXUS_FrontendQamAcquisitionStatus_eMax
387}NEXUS_FrontendQamAcquisitionStatus;
388
389typedef enum NEXUS_FrontendQamInterleaver
390{
391    NEXUS_FrontendQamInterleaver_eI128_J1,
392    NEXUS_FrontendQamInterleaver_eI128_J2,
393    NEXUS_FrontendQamInterleaver_eI128_J3,
394    NEXUS_FrontendQamInterleaver_eI128_J4,
395    NEXUS_FrontendQamInterleaver_eI64_J2,
396    NEXUS_FrontendQamInterleaver_eI32_J4,
397    NEXUS_FrontendQamInterleaver_eI16_J8,
398    NEXUS_FrontendQamInterleaver_eI8_J16,
399    NEXUS_FrontendQamInterleaver_eI4_J32,
400    NEXUS_FrontendQamInterleaver_eI2_J64,
401    NEXUS_FrontendQamInterleaver_eI1_J128,
402    NEXUS_FrontendQamInterleaver_eI12_J17,
403    NEXUS_FrontendQamInterleaver_eUnsupported,
404    NEXUS_FrontendQamInterleaver_eMax
405}NEXUS_FrontendQamInterleaver;
406
407/***************************************************************************
408Summary:
409QAM scan status
410***************************************************************************/
411typedef struct NEXUS_FrontendQamScanStatus
412{
413    unsigned symbolRate;                      /* Detected symbol rate. */
414    int frequencyOffset;                      /* Detected carrier frequency offset.  */
415    NEXUS_FrontendQamMode mode;               /* Detected QAM mode.  */
416    NEXUS_FrontendQamAnnex annex;             /* Detected annex. */
417    NEXUS_FrontendQamInterleaver interleaver; /* Detected interleaver. */
418    NEXUS_FrontendQamSpectralInversion spectrumInverted;  /* Is spectrum inverted? */
419    NEXUS_FrontendQamAcquisitionStatus acquisitionStatus; /* Acquisition status. */
420} NEXUS_FrontendQamScanStatus;
421
422
423/***************************************************************************
424Summary:
425    Get the scan status of a QAM tuner
426Description:
427    For scan mode (NEXUS_Frontend_TuneQam with mode set to NEXUS_FrontendQamAcquisitionType_eScan),
428    initially NEXUS_Frontend_GetFastStatus can be used to determine the lock status faster.
429    Once locked, NEXUS_Frontend_GetQamScanStatus can be used to get the complete scan status.
430    This way the scan time can be improved vs calling NEXUS_Frontend_GetQamScanStatus everytime.
431***************************************************************************/
432NEXUS_Error NEXUS_Frontend_GetQamScanStatus(
433    NEXUS_FrontendHandle handle,
434    NEXUS_FrontendQamScanStatus *pScanStatus /* [out] */
435    );
436
437#ifdef __cplusplus
438}
439#endif
440
441#endif /* #ifndef NEXUS_FRONTEND_QAM_H__ */
442
Note: See TracBrowser for help on using the repository browser.