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

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

first commit

  • Property svn:executable set to *
File size: 10.9 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_tuner.h $
39* $brcm_Revision: 11 $
40* $brcm_Date: 4/20/11 6:30p $
41*
42* API Description:
43*   API name: Frontend Tuner
44*    Generic APIs for tuner device control
45*
46* Revision History:
47*
48* $brcm_Log: /nexus/modules/frontend/common/include/nexus_tuner.h $
49*
50* 11   4/20/11 6:30p jhaberf
51* SWDTV-6727: Added J.83 annex to tuner settings
52*
53* 10   3/24/11 5:34p jhaberf
54* SWDTV-5608: Added ADC PGA gain settings
55*
56* SWDTV-5608/2   3/24/11 2:39p shyi
57* SWDTV-5608: Added adcPgaGainReadingSupported to NEXUS_TunerAttributes
58*  so that NEXUS_TunerStatus.adcPgaGain can be facilitated only with the
59*  feature supported tuners
60*
61* SWDTV-5608/1   3/22/11 10:04a shyi
62* SWDTV-5608: Added ADC PGA gain settings
63*
64* 9   3/4/11 2:40p jhaberf
65* SWDTV-5407: Deleted duplicate keywords
66*
67* SW35230-1309/1   9/7/10 7:28p shyi
68* SW35230-1309: Adding spectral inversion report to NEXUS tuner status
69*
70* 6   9/14/10 11:38a jhaberf
71* SW35230-1308: Merge changes into mainline
72*
73* SW35230-1308/1   9/9/10 1:41p shyi
74* SW35230-1308: Adding preliminary tuner bandwidth re-configuration
75*  feature to NXP TDA18273
76*
77* 5   8/26/10 12:00p jgarrett
78* SW35230-900: Merging new tuner interfaces to main branch
79*
80* SW35230-900/2   8/16/10 6:50p shyi
81* SW35230-900: Reflecting TFE tuner changes (targetting at NXP TDA18273)
82*  into NEXUS, converting Nutune FA2315 and FH2601 first
83*
84* SW35230-900/1   8/12/10 8:24p shyi
85* SW35230-900: Taking TFE tuner changes for I2C read and firmware
86*  download capabilities
87*
88* 4   2/7/08 5:36p jgarrett
89* PR 39407: Converting to common close functions
90*
91* 3   1/23/08 8:37p vobadm
92* PR35457: update docs
93*
94* 2   1/23/08 5:16p erickson
95* PR35457: update docs
96*
97* 1   1/18/08 2:19p jgarrett
98* PR 38808: Merging to main branch
99*
100* Nexus_Devel/2   10/5/07 5:51p jgarrett
101* PR 35551: successful build
102*
103* Nexus_Devel/1   10/4/07 2:41p jgarrett
104* PR 35551: Adding initial version
105*
106***************************************************************************/
107#ifndef NEXUS_TUNER_H__
108#define NEXUS_TUNER_H__
109
110#include "nexus_frontend.h"
111
112#ifdef __cplusplus
113extern "C" {
114#endif
115
116/***************************************************************************
117Summary:
118Generic tuner handle
119***************************************************************************/
120typedef struct NEXUS_Tuner *NEXUS_TunerHandle;
121
122/***************************************************************************
123Summary:
124Tuner Mode
125***************************************************************************/
126typedef enum NEXUS_TunerMode
127{
128    NEXUS_TunerMode_eDigital,
129    NEXUS_TunerMode_eAnalog,
130    NEXUS_TunerMode_eQam,
131    NEXUS_TunerMode_eVsb,
132    NEXUS_TunerMode_eOfdm,
133    NEXUS_TunerMode_eMax
134} NEXUS_TunerMode;
135
136/***************************************************************************
137Summary:
138    Set the frequency of a tuner device
139
140Description:
141    This API has been deprecated, but is maintained for backward compatibility.
142    Please see NEXUS_Tuner_Tune.
143
144See Also:
145    NEXUS_Tuner_Tune
146***************************************************************************/
147NEXUS_Error NEXUS_Tuner_SetFrequency(
148    NEXUS_TunerHandle handle,
149    NEXUS_TunerMode mode,               /* Tuner Mode */
150    unsigned frequency                  /* In Hz */
151    );
152
153/***************************************************************************
154Summary:
155    Initialize current tuner
156***************************************************************************/
157void NEXUS_Tuner_Init(
158    NEXUS_TunerHandle tuner
159    );
160
161/***************************************************************************
162Summary:
163    Tuner Status
164***************************************************************************/
165typedef struct NEXUS_TunerStatus
166{
167    uint32_t centerIf;      /* In Hz */
168    int32_t ifShift;        /* In Hz */
169
170    unsigned frequency;     /* In Hz */
171    bool spectrumInverted;  /* true if spectrum is inverted, false otherwise */
172    int adcPgaGain;         /* in 1/10 dB, desired ADC PGA Gain based on
173        bandwidth, demodulation, mode (for example DVB-T/ISDB-T for OFDM),
174        and frequency, valid only when adcPgaGainReadingSupported of
175        NEXUS_TunerAttributes is true */
176} NEXUS_TunerStatus;
177
178/***************************************************************************
179Summary:
180    Get current tuner status
181***************************************************************************/
182void NEXUS_Tuner_GetStatus(
183    NEXUS_TunerHandle tuner,
184    NEXUS_TunerStatus *pStatus  /* [out] */
185    );
186
187/***************************************************************************
188Summary:
189    Tuning Parameters
190***************************************************************************/
191typedef struct NEXUS_TunerTuneSettings
192{
193    NEXUS_TunerMode mode;
194
195    union
196    {
197        struct
198        {
199            NEXUS_FrontendQamMode qamMode;
200            NEXUS_FrontendQamAnnex annex;
201        } qam;
202        struct
203        {
204            NEXUS_FrontendVsbMode vsbMode;
205        } vsb;
206        struct
207        {
208            NEXUS_FrontendOfdmMode ofdmMode;
209        } ofdm;
210        struct
211        {
212            NEXUS_VideoFormat videoFormat;
213        } analog;
214    } modeSettings;
215
216    unsigned frequency; /* In Hz */
217} NEXUS_TunerTuneSettings;
218
219/***************************************************************************
220Summary:
221    Get default settings for a particular tuner mode
222***************************************************************************/
223void NEXUS_Tuner_GetDefaultTuneSettings(
224    NEXUS_TunerMode mode,
225    NEXUS_TunerTuneSettings *pSettings  /* [out] */
226    );
227
228/***************************************************************************
229Summary:
230    Tune a tuner device
231***************************************************************************/
232NEXUS_Error NEXUS_Tuner_Tune(
233    NEXUS_TunerHandle tuner,
234    const NEXUS_TunerTuneSettings *pSettings
235    );
236
237/***************************************************************************
238Summary:
239    Tuner Settings
240***************************************************************************/
241typedef struct NEXUS_TunerSettings
242{
243    unsigned top;           /* In Hz. */
244    unsigned ifFrequency;   /* In Hz. */
245    unsigned bandwidth;     /* In Hz. */
246} NEXUS_TunerSettings;
247
248/***************************************************************************
249Summary:
250    Get the current settings for a tuner.
251***************************************************************************/
252void NEXUS_Tuner_GetSettings(
253    NEXUS_TunerHandle tuner,
254    NEXUS_TunerSettings *pSettings  /* [out] */
255    );
256
257/***************************************************************************
258Summary:
259    Set the current settings for a tuner.
260***************************************************************************/
261NEXUS_Error NEXUS_Tuner_SetSettings(
262    NEXUS_TunerHandle tuner,
263    const NEXUS_TunerSettings *pSettings
264    );
265
266/***************************************************************************
267Summary:
268    Close a tuner handle
269***************************************************************************/
270void NEXUS_Tuner_Close(
271    NEXUS_TunerHandle handle
272    );
273
274/***************************************************************************
275Summary:
276    Tuner attributes, static information
277***************************************************************************/
278typedef struct NEXUS_TunerAttributes
279{
280    struct
281    {
282        uint32_t major;
283        uint32_t minor;
284    } version;
285    bool powerLevelReadingSupported; /* true if NEXUS_Tuner_ReadPowerLevel() is
286        supported, false otherwise. */
287    bool adcPgaGainReadingSupported; /* true if NEXUS_TunerStatus.adcPgaGain is
288        meaningful, false otherwise. */
289} NEXUS_TunerAttributes;
290
291/***************************************************************************
292Summary:
293    Get the attributes (static information) of a tuner.
294***************************************************************************/
295void NEXUS_Tuner_GetAttributes(
296    NEXUS_TunerHandle tuner,
297    NEXUS_TunerAttributes *pAttributes /* [out] */
298    );
299
300/***************************************************************************
301Summary:
302    Read tuner RF input power level
303
304Description:
305    This API is supported only when powerLevelReadingSupported of
306    NEXUS_TunerAttributes is true. If it is not, this API returns
307    NEXUS_NOT_SUPPORTED.
308
309See Also:
310    NEXUS_TunerAttributes, NEXUS_Tuner_GetAttributes
311***************************************************************************/
312NEXUS_Error NEXUS_Tuner_ReadPowerLevel(
313    NEXUS_TunerHandle handle,
314    int *pPowerLevel /* [out] RF input power level in 1/10 dBm */
315    );
316
317#ifdef __cplusplus
318}
319#endif
320
321#endif /* #ifndef NEXUS_TUNER_H__ */
322
Note: See TracBrowser for help on using the repository browser.