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

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

first commit

  • Property svn:executable set to *
File size: 19.6 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.h $
39* $brcm_Revision: 26 $
40* $brcm_Date: 11/17/11 4:33p $
41*
42* API Description:
43*   API name: Frontend
44*    Generic Frontend APIs.
45*
46* Revision History:
47*
48* $brcm_Log: /nexus/modules/frontend/common/include/nexus_frontend.h $
49*
50* 26   11/17/11 4:33p erickson
51* SW3461-96: Remove GetLockStatus and replace it with GetFastStatus
52*
53* 25   11/1/11 3:07p erickson
54* SW3461-55: add NEXUS_Frontend_GetType, NEXUS_FrontendType,
55*  NEXUS_FrontendChipType, and NEXUS_FrontendVersion
56*
57* 24   10/13/11 4:28p erickson
58* SW3461-55: add comment to deprecate/freeze NEXUS_FrontendUserParameters
59*
60* 23   10/6/11 5:21p jtna
61* SW7425-1327: add NEXUS_Frontend_Get/SetTransportSettings()
62*
63* 22   10/6/11 9:53a jtna
64* SW7425-1189: change NEXUS_Frontend_GetTsmfSettings() to return void
65*
66* 21   10/5/11 12:23p jtna
67* SW7425-1189: add transport and frontend TSMF support
68*
69* 20   9/21/11 5:25p bandrews
70* SW3461-53: add common GetLockStatus
71*
72* 19   8/30/11 4:17p erickson
73* SW7425-1129: add NEXUS_FrontendCapabilities.docsis
74*
75* 18   1/26/11 11:08a jgarrett
76* SW7125-769: Merge to main branch
77*
78* SW7125-769/1   1/24/11 10:59a mward
79* SW7125-769:  Add id, chipId, and chipRevision to
80*  NEXUS_FrontendUserParameters.
81*
82* 17   1/6/11 5:20p jhaberf
83* SW35230-2441: Moved channel scan API to platform specific location
84*
85* 16   9/10/10 4:21p erickson
86* SW35230-1306: deprecate NEXUS_FrontendBandwidth. use unsigned integer
87*  in units of Hz instead.
88*
89* 15   9/1/10 4:15p erickson
90* SW7325-800: add NEXUS_FrontendCapabilities.diseqc and use for internal
91*  configuration as well
92*
93* 14   9/1/10 3:48p jhaberf
94* SW35230-1024: Merged SW35230-1024 branch into main line
95*
96* SW35230-1020/4   9/1/10 6:03p shyi
97* SW35230-857: Adding ifFrequency to NEXUS_FrontendScanSettings to allow
98*  applications to specify dynamically changing IF
99*
100* SW35230-1020/3   8/30/10 6:29p shyi
101* SW35230-1020: Adding flexibility of specifying bandwidths to search
102*
103* SW35230-1020/2   8/26/10 12:01p shyi
104* SW35230-1020: Added frequency scanning for DVB-T signal
105*
106* SW35230-1020/1   8/26/10 11:19a shyi
107* SW35230-1020: Porting changes made under SW35230-900 to quickly prepare
108*  release
109*
110* 12   7/21/09 10:00a erickson
111* PR56958: fix NEXUS_Frontend_SetUserParameters, add comments to
112*  NEXUS_Frontend_ScanFrequency
113*
114* 11   7/14/09 3:47p erickson
115* PR56789: remove NEXUS_Frontend_SetPowerState. unimplemented and unused.
116*
117* 10   7/6/09 4:50p erickson
118* PR56607: clarify comment on callbacks after NEXUS_Frontend_Untune
119*
120* 9   2/25/09 4:39p jgarrett
121* PR 51839: Fix for kernel mode
122*
123* 8   8/5/08 11:25a erickson
124* PR45427: add NEXUS_Frontend_Untune
125*
126* 7   3/14/08 12:55p jgarrett
127* PR 40108: Adding NEXUS_Frontend_ScanFrequency
128*
129* 6   3/14/08 11:31a jgarrett
130* PR 40109: Adding NEXUS_Frontend_ResetStatus
131*
132* 5   2/8/08 6:36p jgarrett
133* PR 39408: Adding daughtercard support
134*
135* 4   2/7/08 5:35p jgarrett
136* PR 39407: Converting to common close functions
137*
138* 3   1/23/08 8:37p vobadm
139* PR35457: update docs
140*
141* 2   1/23/08 5:16p erickson
142* PR35457: update docs
143*
144* 1   1/18/08 2:19p jgarrett
145* PR 38808: Merging to main branch
146*
147* Nexus_Devel/6   1/10/08 2:33p jgarrett
148* PR 38653: Initial version
149*
150* Nexus_Devel/5   11/5/07 2:58p erickson
151* PR36725: remove Get and GetCount
152*
153* Nexus_Devel/4   10/10/07 11:29a jgarrett
154* PR 35551: Adding IFD
155*
156* Nexus_Devel/3   10/5/07 5:51p jgarrett
157* PR 35551: successful build
158*
159* Nexus_Devel/2   10/4/07 2:51p jgarrett
160* PR 35551: Removing Register and Configuration -- part of device
161*
162* Nexus_Devel/1   10/4/07 2:41p jgarrett
163* PR 35551: Adding initial version
164*
165***************************************************************************/
166#ifndef NEXUS_FRONTEND_H__
167#define NEXUS_FRONTEND_H__
168
169#include "nexus_types.h"
170
171#ifdef __cplusplus
172extern "C" {
173#endif
174
175/***************************************************************************
176Summary:
177Handle for a generic frontend object
178***************************************************************************/
179typedef struct NEXUS_Frontend *NEXUS_FrontendHandle;
180
181
182#ifdef __cplusplus
183}
184#endif
185
186#include "nexus_frontend_qam.h"
187#include "nexus_frontend_vsb.h"
188#include "nexus_frontend_satellite.h"
189#include "nexus_frontend_ofdm.h"
190#include "nexus_frontend_oob.h"
191#include "nexus_frontend_upstream.h"
192#include "nexus_frontend_analog.h"
193#include "nexus_tuner.h"
194#include "nexus_amplifier.h"
195#include "nexus_ifd.h"
196#include "nexus_frontend_card.h"
197
198#ifdef __cplusplus
199extern "C" {
200#endif
201
202/***************************************************************************
203Summary:
204Frontend Capabilities -- Allows capabilities of generic frontend objects to be queried by the application.
205***************************************************************************/
206typedef struct NEXUS_FrontendCapabilities
207{
208    bool powerDownSupported;                        /* If true, this tuner supports a power-down mode */
209    bool analog;                                    /* If true, this tuner can support analog/NTSC tuning */
210    bool ifd;                                       /* If true, this tuner can demodulate an analog signal with the IFD */
211    bool qam;                                       /* If true, at least one QAM mode is supported */
212    bool docsis;                                    /* If true, DOCSIS is supported */
213    bool vsb;                                       /* If true, at least one VSB mode is supported */
214    bool satellite;                                 /* If true, at least one satellite mode is supported */
215    bool outOfBand;                                 /* If true, at least one out of band mode is supported */
216    bool upstream;                                  /* If true, at least one upstream mode is supported */
217    bool ofdm;                                      /* If true, OFDM modulation is supported */
218    bool scan;                                      /* If true, NEXUS_Frontend_ScanFrequency is supported for this frontend */
219    bool qamModes[NEXUS_FrontendQamMode_eMax];      /* For each QAM mode, the mode is supported if true and unsupported if false */
220    bool vsbModes[NEXUS_FrontendVsbMode_eMax];      /* For each VSB mode, the mode is supported if true and unsupported if false */
221    bool satelliteModes[NEXUS_FrontendSatelliteMode_eMax];  /* For each satellite mode, the mode is supported if true and unsupported if false */
222    bool outOfBandModes[NEXUS_FrontendOutOfBandMode_eMax];  /* For each out-of-band mode, the mode is supported if true and unsupported if false */
223    bool upstreamModes[NEXUS_FrontendUpstreamMode_eMax];    /* For each upstream mode, the mode is supported if true and unsupported if false */
224    bool ofdmModes[NEXUS_FrontendOfdmMode_eMax];    /* For each OFDM mode, the mode is supported if true and unsupported if false */
225    bool diseqc;
226} NEXUS_FrontendCapabilities;
227
228/***************************************************************************
229Summary:
230    Return a list of capabilities for a given frontend object.
231
232Description:
233    This call returns a list of capabilities for a frontend object.  Because
234    many frontends support multiple types of modulation schemes, this
235    allows the application to distinguish the capabilities of one tuner
236    versus another.  If a tuner has multiple capabilities, only one of
237    the modes may be used at any one time.
238See Also:
239    NEXUS_Frontend_Get
240***************************************************************************/
241void NEXUS_Frontend_GetCapabilities(
242    NEXUS_FrontendHandle handle,
243    NEXUS_FrontendCapabilities *pCapabilities   /* [out] */
244    );
245
246/***************************************************************************
247Summary:
248Frontend Soft Decisions
249***************************************************************************/
250typedef struct NEXUS_FrontendSoftDecision
251{
252    int16_t i;
253    int16_t q;
254} NEXUS_FrontendSoftDecision;
255
256/***************************************************************************
257Summary:
258    Get an array of soft decisions for a constellation.
259
260Description:
261    I and Q range from 32767 to -32768 for all devices, however precision
262    may vary per device.
263***************************************************************************/
264NEXUS_Error NEXUS_Frontend_GetSoftDecisions(
265    NEXUS_FrontendHandle handle,
266    NEXUS_FrontendSoftDecision *pDecisions, /* attr{nelem=length;reserved=100} [out, size_is(length)] array of soft decisions */
267    size_t length                           /* number of NEXUS_FrontendSoftDecision's to get */
268    );
269
270/***************************************************************************
271Summary:
272Frontend User Parameters -- Optional values that platform may bind to a
273                            specific device/channel to pass information
274                            to the application (such as input band)
275                           
276This struct is deprecated. It should not be extended. If additional frontend
277information is needed from the platform, the NEXUS_PlatformConfiguration struct should
278be extended so the info can be communicated directly, not through a tunnel.
279***************************************************************************/
280typedef struct NEXUS_FrontendUserParameters
281{
282    int param1;
283    void *pParam2;
284    unsigned id; /* platform-assigned id for this frontend instance */
285    uint16_t chipId; /* demod chip, in hex, e.g. 0x3117 */
286    uint16_t chipRevision; /* demod chip revision, in hex, e.g. 0x0010 = A0, 0x0021 = B1
287                              0 = "not needed" or "not available" */
288} NEXUS_FrontendUserParameters;
289
290/***************************************************************************
291Summary:
292    Get user parameters provided by NEXUS_Frontend_SetUserParameters.
293
294Description:
295    This is an optional call that allows the platform layer to attach some
296    user parameters to a frontend object.  The application can, in turn,
297    retrieve these parameters to get some data from platform such as
298    input band.
299See Also:
300    NEXUS_Frontend_SetUserParameters
301***************************************************************************/
302NEXUS_Error NEXUS_Frontend_GetUserParameters(
303    NEXUS_FrontendHandle handle,
304    NEXUS_FrontendUserParameters *pParams   /* [out] */
305    );
306
307/***************************************************************************
308Summary:
309    Set user parameters for a frontend.
310
311Description:
312    This is an optional call that allows the platform layer to attach some
313    user parameters to a frontend object.  The application can, in turn,
314    retrieve these parameters to get some data from platform such as
315    input band.
316See Also:
317    NEXUS_Frontend_GetUserParameters
318***************************************************************************/
319NEXUS_Error NEXUS_Frontend_SetUserParameters(
320    NEXUS_FrontendHandle handle,
321    const NEXUS_FrontendUserParameters *pParams
322    );
323
324
325/***************************************************************************
326Summary:
327Major/minor version code
328
329Examples:
330For silicon,
331major=0x01 and minor=0x00, denotes A0.
332major=0x01 and minor=0x01, denotes A1.
333major=0x02 and minor=0x02, denotes B2.
334
335For firmware:
336major=0x00 and minor=0x05, denotes 0.5.
337major=0x01 and minor=0x01, denotes 1.1.
338major=0x02 and minor=0x02, denotes 2.2.
339***************************************************************************/
340typedef struct NEXUS_FrontendVersion
341{
342    unsigned major;
343    unsigned minor;
344} NEXUS_FrontendVersion;
345
346/***************************************************************************
347Summary: Frontend Chip Info.
348***************************************************************************/
349typedef struct NEXUS_FrontendChipType
350{
351    unsigned familyId; /* Chip's family Id. In hex, e.g. 0x3128. */
352    unsigned id;       /* Chip's Id or Bondout Id. In hex, e.g. 0x3128/ 0x3124/ 0x3123. */
353    NEXUS_FrontendVersion version;
354} NEXUS_FrontendChipType;
355
356/***************************************************************************
357Summary: Frontend Chip and Firmware Info.
358***************************************************************************/
359typedef struct NEXUS_FrontendType
360{
361    NEXUS_FrontendChipType chip;
362    NEXUS_FrontendVersion firmwareVersion;
363} NEXUS_FrontendType;
364
365/***************************************************************************
366Summary:
367    Retrieve the chip family id, chip id, chip version and firmware version.
368***************************************************************************/
369void NEXUS_Frontend_GetType(
370    NEXUS_FrontendHandle handle,
371    NEXUS_FrontendType *pType
372    );
373
374/***************************************************************************
375Summary:
376    Close a frontend handle
377***************************************************************************/
378void NEXUS_Frontend_Close(
379    NEXUS_FrontendHandle handle
380    );
381
382/***************************************************************************
383Summary:
384    Reset state after a tune
385
386Description:
387    After this function is called, no new lock callback will be generated.
388    It's possible that a pending lock callback will still be issued. If you cannot process another
389    callback after NEXUS_Frontend_Untune, call NEXUS_StopCallbacks befor calling NEXUS_Frontend_Untune and
390    call NEXUS_StartCallbacks from any subsequent Tune function.
391
392    The demodulator and tuner cores may be reset or powered down as well.
393***************************************************************************/
394void NEXUS_Frontend_Untune(
395    NEXUS_FrontendHandle handle
396    );
397
398/***************************************************************************
399Summary:
400    Reset accumulated status values for a frontend
401***************************************************************************/
402void NEXUS_Frontend_ResetStatus(
403    NEXUS_FrontendHandle handle
404    );
405
406/***************************************************************************
407Summary:
408Frontend Lock Status
409****************************************************************************/
410typedef enum NEXUS_FrontendLockStatus
411{           
412    NEXUS_FrontendLockStatus_eUnknown,  /* no status available */
413    NEXUS_FrontendLockStatus_eUnlocked, /* not locked, but there is a signal. */
414    NEXUS_FrontendLockStatus_eLocked,   /* locked */
415    NEXUS_FrontendLockStatus_eNoSignal, /* no signal; therefore not locked */
416    NEXUS_FrontendLockStatus_eMax
417} NEXUS_FrontendLockStatus;
418
419/***************************************************************************
420Summary:
421Status returned by NEXUS_Frontend_GetFastStatus
422***************************************************************************/
423typedef struct NEXUS_FrontendFastStatus {
424    NEXUS_FrontendLockStatus lockStatus;
425} NEXUS_FrontendFastStatus;
426
427/***************************************************************************
428Summary:
429Get fast status for the frontend
430
431Descriptoin:
432Frontends may not populate all status.
433Usually fast status happens from direct register reads from the SoC,
434not FW transactions.
435***************************************************************************/
436NEXUS_Error NEXUS_Frontend_GetFastStatus(
437    NEXUS_FrontendHandle handle,
438    NEXUS_FrontendFastStatus *pStatus /* [out] */
439    );
440
441/***************************************************************************
442Summary:
443Get current TSMF settings for a frontend
444***************************************************************************/
445void NEXUS_Frontend_GetTsmfSettings(
446    NEXUS_FrontendHandle handle,
447    NEXUS_TsmfSettings *pTsmfSettings  /* [out] */
448    );
449
450/***************************************************************************
451Summary:
452Set TSMF settings for a frontend
453***************************************************************************/
454NEXUS_Error NEXUS_Frontend_SetTsmfSettings(
455    NEXUS_FrontendHandle handle,
456    const NEXUS_TsmfSettings *pTsmfSettings
457    );
458
459/*********************************************************************************
460Summary:
461NEXUS_FrontendTransportSettings
462**********************************************************************************/
463typedef struct NEXUS_FrontendTransportSettings
464{   
465    struct {
466        unsigned virtualParserBandNum;
467        bool virtualParserIsPlayback;
468    } bandmap; /* parser band remapping */
469} NEXUS_FrontendTransportSettings;
470
471/***************************************************************************
472Summary:
473Get current parser band mapping for a tuner.
474***************************************************************************/
475void NEXUS_Frontend_GetTransportSettings(
476    NEXUS_FrontendHandle handle,
477    NEXUS_FrontendTransportSettings *pSettings  /* [out] */
478    );
479
480/***************************************************************************
481Summary:
482Set new parser band mapping for a tuner.
483***************************************************************************/
484NEXUS_Error NEXUS_Frontend_SetTransportSettings(
485    NEXUS_FrontendHandle handle,
486    const NEXUS_FrontendTransportSettings *pSettings
487    );
488
489
490/***************************************************************************
491The NEXUS_FrontendBandwidth enum has been deprecated. It is an unsigned integer in units of Hz now.
492The following #defines are for backward compatibility only.
493***************************************************************************/
494#define NEXUS_FrontendBandwidth_e5Mhz 5000000
495#define NEXUS_FrontendBandwidth_e6Mhz 6000000
496#define NEXUS_FrontendBandwidth_e7Mhz 7000000
497#define NEXUS_FrontendBandwidth_e8Mhz 8000000
498#define NEXUS_FrontendBandwidth_eMax  4
499
500#ifdef __cplusplus
501}
502#endif
503
504#endif /* #ifndef NEXUS_FRONTEND_H__ */
505
Note: See TracBrowser for help on using the repository browser.