source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/xpt/7552/bxpt_pcr.h

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

first commit

  • Property svn:executable set to *
File size: 27.8 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, 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: bxpt_pcr.h $
11 * $brcm_Revision: Hydra_Software_Devel/7 $
12 * $brcm_Date: 9/12/11 4:36p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_pcr.h $
19 *
20 * Hydra_Software_Devel/7   9/12/11 4:36p gmullen
21 * SW7344-193: Merged changes to Hydra
22 *
23 * Hydra_Software_Devel/SW7344-193/1   9/7/11 4:34p gmullen
24 * SW7344-193: Added tri-state logic to jitter API
25 *
26 * Hydra_Software_Devel/6   8/22/11 5:45p gmullen
27 * SW7231-319: Merged to Hydra branch
28 *
29 * Hydra_Software_Devel/SW7231-319/1   8/16/11 2:15p gmullen
30 * SW7231-319: Initial support for B0
31 *
32 * Hydra_Software_Devel/5   5/16/11 4:58p gmullen
33 * SW7408-284: Added support for jitter adjust in PCR hw to PI
34 *
35 * Hydra_Software_Devel/4   11/8/10 4:02p gmullen
36 * SW7422-20: PI can now generate the required INT IDs
37 *
38 * Hydra_Software_Devel/3   10/27/10 2:08p gmullen
39 * SW7422-20: Added BXPT_PCR_TimeRef_eHD_DVI_H1 and
40 * BXPT_PCR_TimeRef_eHD_DVI_V1 as placeholders
41 *
42 * Hydra_Software_Devel/2   10/27/10 12:03p gmullen
43 * SW7422-20: Ported to 7422
44 *
45 * Hydra_Software_Devel/1   10/25/10 2:09p gmullen
46 * SW7425-15: Moved srcs to base2 folder
47 *
48 * Hydra_Software_Devel/1   10/8/10 2:57p gmullen
49 * SW7425-15: Added header files
50 *
51 * Hydra_Software_Devel/20   9/2/10 10:26a gmullen
52 * SW35230-2: Fixed incorrect timebase mapping in enum
53 *
54 * Hydra_Software_Devel/19   11/18/09 2:38p gmullen
55 * SW35230-2: eHD_DVI_V0/V1 is supported on the 35230
56 *
57 * Hydra_Software_Devel/18   6/17/09 6:46p gmullen
58 * PR56110: Added support.xpt/7550/uif_image/a0
59 *
60 * Hydra_Software_Devel/17   5/11/09 5:11p piyushg
61 * PR53746: Added xpt interface for retrieving phase error at isr time
62 * BXPT_PCR_GetPhaseError_isr().
63 *
64 * Hydra_Software_Devel/16   4/7/09 5:25p piyushg
65 * PR52986: Add support for 7635
66 * Added directory element "7635".
67 *
68 * Hydra_Software_Devel/15   11/26/08 4:14p gmullen
69 * PR47755: Added support for 7420.
70 *
71 * Hydra_Software_Devel/14   11/10/08 9:07a gmullen
72 * PR48128: Added playback support for 7325/7335. Removed redundant code.
73 *
74 * Hydra_Software_Devel/13   9/12/08 2:21p gmullen
75 * PR46659: Added 3556/3548 B0 support
76 *
77 * Hydra_Software_Devel/12   9/12/08 11:27a gmullen
78 * PR46659: Added B0 support
79 *
80 * Hydra_Software_Devel/11   8/8/08 5:47p gmullen
81 * PR45362: Merged SanJose_CDI_Devel changes to Hydra_Software_Devel
82 *
83 * Hydra_Software_Devel/10   4/10/08 3:36p gmullen
84 * PR38954: Updated number of playbacks, added HDDVI support to PCR API,
85 * and added packetizer support.
86 *
87 * Hydra_Software_Devel/9   2/5/08 8:19a gmullen
88 * PR39329: Added ISR version of GetLastPcr.
89 *
90 * Hydra_Software_Devel/8   8/15/07 4:56p gmullen
91 * PR34082: Removed incorrect comment from description of
92 * BXPT_PCR_XptStreamPcrCfg
93 *
94 * Hydra_Software_Devel/7   8/15/07 4:52p gmullen
95 * PR34082: Added filter coefficients to BXPT_PCR_XptStreamPcrCfg struct.
96 *
97 * Hydra_Software_Devel/6   7/18/07 1:38p gmullen
98 * PR33106: Added BXPT_PCR_SetCenterFrequency()
99 *
100 * Hydra_Software_Devel/5   11/10/06 5:47p katrep
101 * PR25737: Added BXPT_PCR_SetTimeRefTrackRange API.
102 *
103 * Hydra_Software_Devel/4   8/18/06 10:13a gmullen
104 * PR23345: Added MaxPcrError to Get/SetSettings calls.
105 *
106 * Hydra_Software_Devel/3   8/8/06 6:36p gmullen
107 * PR15309: Added proto for BXPT_PCR_GetTimeBaseFreqRefDefaults
108 *
109 * Hydra_Software_Devel/2   8/2/06 3:56p gmullen
110 * PR23137: Added support for playback data to PCR block.
111 *
112 * Hydra_Software_Devel/3   9/26/05 4:40p gmullen
113 * PR15309: Removed support for loading user STCs. That support is now in
114 * bxpt_pcr_offset.c
115 *
116 * Hydra_Software_Devel/2   8/4/05 8:14a gmullen
117 * PR15309: Added PCR support.
118 *
119 * Hydra_Software_Devel/1   5/13/05 1:27p gmullen
120 * PR15309: First draft of XPT PI.
121 *
122 ***************************************************************************/
123
124#ifndef BXPT_PCR_H__
125#define BXPT_PCR_H__
126
127#include "bxpt.h"
128#include "bchp_xpt_dpcr0.h"
129
130#ifdef __cplusplus
131extern "C"{
132#endif
133
134/*=************************ Module Overview ********************************
135<verbatim>
136Overview:
137</verbatim>
138***************************************************************************/
139
140/***************************************************************************
141Summary:
142        The opaque handle for a PCR module.
143Description:
144        This structure represents the PCR handle. It is created at BXPT_PCR_Open
145***************************************************************************/
146typedef struct BXPT_P_PcrHandle_Impl *BXPT_PCR_Handle;
147
148/***************************************************************************
149Summary:
150        Time base frequency reference control configuration.  It is for non-transport
151        timebase reference.
152Description:
153        The members in the structure controls the frequency of a timebase reference.
154        It appies to analog references and the internal reference. This is not for
155        timebase pulse frequency which is controlled in rate managers of different
156        hardware blocks.
157***************************************************************************/
158typedef struct BXPT_PCR_TimebaseFreqRefConfig
159{
160        uint32_t Prescale;       /*     frequency control parm*/
161        uint32_t Inc;            /*     frequency control parm*/
162        uint8_t FiltA;                  /* integrator leak. */ 
163        uint8_t FiltB;                  /* loop gain. */       
164        uint8_t FiltC;                  /* direct path gain. */ 
165}
166BXPT_PCR_TimebaseFreqRefConfig;
167
168/***************************************************************************
169Summary:
170Different format for the packet timestamps supported by the PCR block. 
171***************************************************************************/
172typedef enum 
173{
174    BXPT_PCR_JitterTimestampMode_e32 = 0,       /* 32 bit timestamp */
175    BXPT_PCR_JitterTimestampMode_e28_4P = 1,    /* 28 bit timestamp with 4 bit parity.*/
176    BXPT_PCR_JitterTimestampMode_e30_2U = 2,     /* 30 bit timstamp with 2 user bits. */
177    BXPT_PCR_JitterTimestampMode_eAuto,         /* Do not change the current (global) setting. */
178    BXPT_PCR_JitterTimestampMode_eMax
179}
180BXPT_PCR_JitterTimestampMode;
181
182/***************************************************************************
183Summary:
184***************************************************************************/
185typedef enum 
186{
187    BXPT_PCR_JitterCorrection_eEnable = 0, 
188    BXPT_PCR_JitterCorrection_eDisable = 1,
189    BXPT_PCR_JitterCorrection_eAuto,        /* Do not change the current (global) setting. */
190    BXPT_PCR_JitterCorrection_eMax
191}
192BXPT_PCR_JitterCorrection;
193
194/***************************************************************************
195Summary:
196Configuration for PCR module when transport stream is timebase reference.
197
198Description:
199This structure covers pcr pid, stream source, PcrSendEn, and sendmode
200configurations when locking to a transport stream.
201 
202If jitter adjust is enabled, the jitter adjustment block is supposed to be
203programmed to match with the Playback timestamp format (i.e. 32-bit, 28-bit
204or 30-bit formats). This tells the jitter calculation hardware whether to use
205all 32-bits of the timestamp, or to ignore the upper 4 bits of the timestamp
206(4-bit parity + 28-bit, or 2-bit User + 30-bit). The 32-bit support in the
207DPCR is for both binary and Mod-300. The hardware uses the Packet type (MPEG
208or 130 byte) to decide whether timestamp mode is Mod-300 or binary.
209 
210NOTE!! that timestamp mode and PCR type must match for jitter calculation to
211work correctly, i.e. if it is MPEG stream with PCRs then the timestamps must
212also be Mod-300. This means we can't use jitter adjustment for MPEG stream
213with PCRs but with binary/DLNA timestamps.
214***************************************************************************/
215typedef struct BXPT_PCR_XptStreamPcrCfg
216{
217    uint32_t PidChannel;                                /* PCR PID channel */
218        uint32_t MaxPcrError;                     /* Maximum PCR error thredhold*/
219
220    /*
221    ** Note: these params are unique in that the hw setting is *global* to all bxpt_pcr instances.
222    ** Thus, changing one param here will affect other blocks. This isn't a problem in the usage
223    ** cases the hw engineers know about, but it requires some care by sw. These params are
224    ** tri-state, as follows. _eAuto should be selected, unless the user knows this block must
225    ** have a unique setting. At some point in the future, these params may no longer be global.
226    ** 
227    ** The tri-state values are:
228    **      _eAuto - Do not change the existing global setting.
229    **      _eEnable or _eDisable for PbJitterDisable and LiveJitterDisable.
230    **      _e32, etc for JitterTimestamp.
231    */
232    BXPT_PCR_JitterTimestampMode JitterTimestamp; 
233    BXPT_PCR_JitterCorrection PbJitterDisable;
234    BXPT_PCR_JitterCorrection LiveJitterDisable;
235
236        BXPT_PCR_TimebaseFreqRefConfig TimebaseCfg;             /* Customized filter coefficients. */
237}
238BXPT_PCR_XptStreamPcrCfg;
239
240/***************************************************************************
241Summary:
242        Configurations for modifying the rate of the STC extension counter.
243Description:
244        The members in the structure sets the rate control of STC extension. 
245***************************************************************************/
246typedef struct BXPT_PCR_STCExtRateConfig
247{
248        uint32_t Prescale;       /*     frequency control parm*/
249        uint32_t Inc;            /*     frequency control parm*/
250}
251BXPT_PCR_STCExtRateConfig;
252
253/***************************************************************************
254Summary:
255        Timebase references     for all the sources that a timebase can lock to.
256Description:
257        This enum represents all the time references that timebase
258        may lock to.
259***************************************************************************/
260typedef enum BXPT_PCR_TimeRef
261{
262        BXPT_PCR_TimeRef_eI656_Hl = 3,                  /* Lock to Hsync from ITU656 input 0  */
263        BXPT_PCR_TimeRef_eI656_Vl = 4,                  /* Lock to Vsync from ITU656 input 0  */
264        BXPT_PCR_TimeRef_eI656_Fl = 5,                  /* Lock to Fsync from ITU656 input 0  */
265        BXPT_PCR_TimeRef_eI2S0 = 6,                             /* Lock to I2S input #0  */
266        BXPT_PCR_TimeRef_eHD_DVI_H0 = 11,               /* Hsync from HD DVI input 0 */
267        BXPT_PCR_TimeRef_eHD_DVI_V0 = 12,               /* Vsync from HD DVI input 0 */
268        BXPT_PCR_TimeRef_eInternal = 14,                /* Lock to Internal Reference which has a period of 16384 cycles at 27MHz */
269        BXPT_PCR_TimeRef_eXpt = 15,                             /* Lock to transport PCR values */
270
271    /* Not available on all chips. Check your hw docs. */
272        BXPT_PCR_TimeRef_eSPDIF = 18,                   /* SPDIF input 1 */
273        BXPT_PCR_TimeRef_eMaiIn = 19,                   /* Frame Sync from DVP_HR */
274
275        BXPT_PCR_TimeRef_eMax = 100,                    /* Max value, marks the end of the supported inputs. */
276
277    /* These are placeholders, in case hw for HD DVI input 1 is added in the future. */
278        BXPT_PCR_TimeRef_eHD_DVI_H1 = 101,              /* Hsync from HD DVI input 1 */
279        BXPT_PCR_TimeRef_eHD_DVI_V1 = 102               /* Vsync from HD DVI input 1 */
280}
281BXPT_PCR_TimeRef;
282
283/***************************************************************************
284Summary:
285        Timebase references     possible track Range values
286Description:
287***************************************************************************/
288typedef enum BXPT_PCR_RefTrackRange
289{
290    BXPT_PCR_TrackRange_PPM_8 = 0,
291    BXPT_PCR_TrackRange_PPM_15,
292    BXPT_PCR_TrackRange_PPM_30,
293    BXPT_PCR_TrackRange_PPM_61,
294    BXPT_PCR_TrackRange_PPM_122,
295    BXPT_PCR_TrackRange_PPM_244
296
297}BXPT_PCR_RefTrackRange;
298
299/***************************************************************************
300Summary:
301Valid error clamping ranges for the phase error input.
302***************************************************************************/
303typedef enum BXPT_PCR_PhaseErrorClampRange
304{
305    BXPT_PCR_PhaseErrorClampRange_e22_8mS = 5,          /* +/- 22.8 mS */
306    BXPT_PCR_PhaseErrorClampRange_e11_4mS = 4,          /* +/- 11.4 mS */
307    BXPT_PCR_PhaseErrorClampRange_e5_7mS = 3,           /* +/- 5.7 mS */
308    BXPT_PCR_PhaseErrorClampRange_e2_8mS = 2,           /* +/- 2.8 mS */
309    BXPT_PCR_PhaseErrorClampRange_e1_4mS = 1,           /* +/- 1.4 mS */
310    BXPT_PCR_PhaseErrorClampRange_e0_7mS = 0            /* +/- -0.7 mS */
311}
312BXPT_PCR_PhaseErrorClampRange;
313
314
315/***************************************************************************
316Summary:
317        Defaultsettings PCR modules
318Description:
319        This structure represents the default settings for a pcr module.
320***************************************************************************/
321typedef struct BXPT_PCR_DefSettings
322{
323        uint32_t MaxPcrError;   /* Maximum PCR error thredhold*/
324        bool PcrTwoErrReaquireEn; /* control of re-acquisition of PCR when TWO_PCR_ERROR occurs */
325}
326BXPT_PCR_DefSettings;
327
328/***************************************************************************
329Summary:
330        Return the number of Pcr channels.
331Description:
332        This function returns the number of pcr channels supported.
333Returns:
334    BERR_SUCCESS                - returns the number of Pcr channel.
335    BERR_INVALID_PARAMETER      - Bad input parameter
336****************************************************************************/
337BERR_Code BXPT_PCR_GetTotalChannels(
338        BXPT_Handle hXpt,           /* [in] The transport handle */
339        unsigned int *TotalChannels     /* [out] The number of Pcr channels. */
340    );
341
342/***************************************************************************
343Summary:
344        Returns the Pcr channel default settings.
345
346Description:
347        This function gets the default settings for a given channel and places
348        them in a structure. The default settings shall be retrieved and changed
349        before channel openings. The values are set at channel openings.
350Returns:
351    BERR_SUCCESS                - Retrieved Pcr defaults.
352    BERR_INVALID_PARAMETER      - Bad input parameter
353****************************************************************************/
354BERR_Code BXPT_PCR_GetChannelDefSettings(
355        BXPT_Handle hXpt,                       /* [in] The transport handle - need chip info */
356        unsigned int WhichPcr,                                          /* [in] Which pcr module */
357        BXPT_PCR_DefSettings *pcrSettings       /* [out] The default settings of a pcr module */
358        );
359
360/***************************************************************************
361Summary:
362        Open a Pcr channel for a given PCR module
363Description:
364        This functions obtains a PCR handle. Sets default settings,
365        enable the PCR_TWO_ERROR interrupt.
366Returns:
367    BERR_SUCCESS                - if successful
368    BERR_OUT_OF_DEVICE_MEMORY   - Memory failure (should not happen)
369    BERR_INVALID_PARAMETER      - Bad input parameter
370***************************************************************************/
371BERR_Code BXPT_PCR_Open(
372        BXPT_Handle hXpt,                                  /* [in] The transport handle*/
373        unsigned int WhichPcr,                     /* [in] Which pcr module */
374        BXPT_PCR_DefSettings *pcrSettings, /* [in] The default setting */
375        BXPT_PCR_Handle *hPcr                      /* [out] The pcr handle */
376        );
377
378/***************************************************************************
379Summary:
380        Close a Pcr channel.
381Description:
382        This function closes the pcr channel by disabling PCR and sets back to
383        default settings.
384Returns:
385    BERR_SUCCESS                - if successful
386    BERR_OUT_OF_DEVICE_MEMORY   - Memory failure (should not happen)
387    BERR_INVALID_PARAMETER      - Bad input parameter
388***************************************************************************/
389BERR_Code BXPT_PCR_Close(
390        BXPT_PCR_Handle hPcr     /* [in] The pcr handle */
391);
392
393/***************************************************************************
394Summary:
395        Gets PCR configuration when PCR is locking to a transport stream
396Description:
397        This functions gets the current setting of the PCR configuration. It includes
398        PCR Pid, stream source, SEND_EN, and send mode for Video.
399Returns:
400    BERR_SUCCESS                - if successful
401    BERR_OUT_OF_DEVICE_MEMORY   - Memory failure (should not happen)
402    BERR_INVALID_PARAMETER      - Bad input parameter
403***************************************************************************/
404BERR_Code       BXPT_PCR_GetStreamPcrConfig( 
405        BXPT_PCR_Handle hPcr,                                             /* [in] The pcr handle */
406        BXPT_PCR_XptStreamPcrCfg *PcrCfg             /* [out] Transport source configuration */
407        );
408
409/***************************************************************************
410Summary:
411Sets PCR configuration when PCR is locking to a transport stream
412
413Description:
414This functions sets Pids, stream source, SEND_EN and timebase reference to
415transport stream and puts the PCR module into acqusition mode.
416
417For 7401B0 and later devices, the PCR block can accept data from
418playback channels by setting PcrCfg->eStreamSelect = BXPT_DataSource_ePlayback
419
420Returns:
421    BERR_SUCCESS                - if successful
422    BERR_OUT_OF_DEVICE_MEMORY   - Memory failure (should not happen)
423    BERR_INVALID_PARAMETER      - Bad input parameter
424***************************************************************************/
425BERR_Code       BXPT_PCR_SetStreamPcrConfig( 
426        BXPT_PCR_Handle hPcr,                                            /* [in] The pcr handle */
427        const BXPT_PCR_XptStreamPcrCfg *PcrCfg       /* [in] Transport source configuration */
428        );
429
430/***************************************************************************
431Summary:
432Sets PCR configuration when PCR is locking to a transport stream.  This
433function is  only be to used from within an ISR.
434
435Description:
436This functions sets Pids, stream source, SEND_EN and timebase reference to
437transport stream and puts the PCR module into acqusition mode.
438
439For 7401B0 and later devices, the PCR block can accept data from
440playback channels by setting PcrCfg->eStreamSelect = BXPT_DataSource_ePlayback
441
442Returns:
443    BERR_SUCCESS                - if successful
444    BERR_OUT_OF_DEVICE_MEMORY   - Memory failure (should not happen)
445    BERR_INVALID_PARAMETER      - Bad input parameter
446***************************************************************************/
447BERR_Code       BXPT_PCR_SetStreamPcrConfig_isr( 
448        BXPT_PCR_Handle hPcr,                                            /* [in] The pcr handle */
449        const BXPT_PCR_XptStreamPcrCfg *PcrCfg       /* [in] Transport source configuration */
450        );
451
452
453/***************************************************************************
454Summary:
455XPT interface for retrieving phase error at isr time
456
457Returns:
458    BERR_SUCCESS                - if successful
459***************************************************************************/
460BERR_Code   BXPT_PCR_GetPhaseError_isr( 
461    BXPT_PCR_Handle hPcr,             
462    int32_t *p_error
463    );
464
465/***************************************************************************
466Summary:
467        controls modifying the rate of the STC extension counter.
468Description:
469        This function configures the pre-scale and increment parameters of the
470        PCR STC EXT control register. The PCR_INC_VAL (M) and PCR_PRESCALE (N)
471        can be used to alter the rate of the STC counter to 27 MHz * M/(N+1).
472        For example, to run the STC counter at 18 MHz, (i.e. 2/3 of the normal rate),
473        program M=2 and N=2.
474Returns:
475    BERR_SUCCESS                - if successful
476    BERR_INVALID_PARAMETER      - Bad input parameter
477***************************************************************************/
478BERR_Code       BXPT_PCR_SetStcExtRateControl( 
479        BXPT_PCR_Handle hPcr,                                        /* [in] The pcr handle */
480        const BXPT_PCR_STCExtRateConfig  *StcExtRateCfg /* [in] Stc extension rate control configuration */
481        );     
482
483/***************************************************************************
484Summary:
485        enables PCR processing on PCR_PID and puts PCR into an acquisition mode.
486Description:
487        This function enables PCR processing on PCR_PID. Writing a "1" to Valid bit
488        also puts the PCR module into an acquisition mode.
489Returns:
490    BERR_SUCCESS                - if successful
491    BERR_INVALID_PARAMETER      - Bad input parameter
492***************************************************************************/
493void    BXPT_PCR_RefreshPcrPid( 
494        BXPT_PCR_Handle hPcr                       /*[in] The pcr handle  */
495        );
496
497/***************************************************************************
498Summary:
499        Gets the last PCR captured in last PCR Hi/Lo registers.
500Description:
501        This function reads the values from PCR_LAST_PCR_HI/LO registers.
502Returns:
503    BERR_SUCCESS                - if successful
504    BERR_INVALID_PARAMETER      - Bad input parameter
505***************************************************************************/
506BERR_Code       BXPT_PCR_GetLastPcr( 
507        BXPT_PCR_Handle hPcr,                     /* [in] The pcr handle */
508        uint32_t *p_pcrHi,                        /* [out] Upper bits of PCR*/
509        uint32_t *p_pcrLo                         /* [out] Bit9-LSB of base bit[0-8]-extension*/
510        );
511
512/***************************************************************************
513Summary:
514        ISR version of BXPT_PCR_GetLastPcr.
515Description:
516        This function reads the values from PCR_LAST_PCR_HI/LO registers. It is
517        callable from within an ISR context.
518Returns:
519    BERR_SUCCESS                - if successful
520    BERR_INVALID_PARAMETER      - Bad input parameter
521***************************************************************************/
522BERR_Code       BXPT_PCR_GetLastPcr_isr( 
523        BXPT_PCR_Handle hPcr,                     
524        uint32_t *p_pcrHi,                       
525        uint32_t *p_pcrLo                         
526        );
527
528/***************************************************************************
529Summary:
530        Gets the STC counter values
531Description:
532        This function read the PCR STC counters from STC_HI/LO registers
533Returns:
534    BERR_SUCCESS                - if successful
535    BERR_INVALID_PARAMETER      - Bad input parameter
536***************************************************************************/
537BERR_Code       BXPT_PCR_GetStc( 
538        BXPT_PCR_Handle hPcr,                    /* [in] The pcr handle */
539        uint32_t *p_stcHi,                       /* [out] Upper bits of STC*/
540        uint32_t *p_stcLo                        /* [out] bit9-LSB of base bit[0-8]-extension*/
541        );
542
543/***************************************************************************
544Summary:
545        Sets non-transport source for a timebase reference and configures frequency
546        control for the reference.
547Description:
548        This function sets a timebase locking to a non transport source and sets
549        the frequency control for the reference.  It is recommanded to use
550        BXPT_PCR_GetfreqRefConfig before calling this function to preserve
551        the default values of frequency control if no intention to change the
552        frequency.
553Returns:
554    BERR_SUCCESS                - if successful
555    BERR_INVALID_PARAMETER      - Bad input parameter
556***************************************************************************/
557BERR_Code       BXPT_PCR_ConfigNonStreamTimeBase( 
558        BXPT_PCR_Handle hPcr,                                         /* [in] The pcr handle */
559        BXPT_PCR_TimeRef  eNonStreamTimeBaseCfg,      /* [in] Non transport source configuration */
560        BXPT_PCR_TimebaseFreqRefConfig *Timebasefreq  /* [in] Non transport source frequency config */
561        );                                                                               
562
563/***************************************************************************
564Summary:
565        Gets timebase reference frequency control. It is for non transport time
566        references.
567Description:
568        This function gets the pre-scale and increment parameters of the
569        DPCR_REF_PCR control register.
570Returns:
571    BERR_SUCCESS                - if successful
572        BERR_INVALID_PARAMETER      - Bad input parameter
573***************************************************************************/
574BERR_Code       BXPT_PCR_GetfreqRefConfig( 
575        BXPT_PCR_Handle hPcr,                                                   /* [in] The pcr handle */
576        BXPT_PCR_TimebaseFreqRefConfig  *TimebaseFreqConfig /* [out] Non transport source configuration */
577        );     
578
579/***************************************************************************
580Summary:
581        Isr version of enabling PCR processing on PCR_PID and putting PCR into
582        an acquisition mode.
583Description:
584        This function enables PCR processing on PCR_PID. Writing a "1" to Valid bit
585        also puts the PCR module into an acquisition mode.
586Returns:
587    BERR_SUCCESS                - if successful
588    BERR_INVALID_PARAMETER      - Bad input parameter
589***************************************************************************/
590void BXPT_PCR_RefreshPcrPid_isr( 
591        BXPT_PCR_Handle hPcr                       /*[in] The pcr handle  */
592        );
593
594/***************************************************************************
595Summary:
596Freeze integration loop.
597
598Description:
599Stop loop tracking by freezing the integrator. Useful for cases like analog
600decode. The integrator can be un-frozen by setting the Freeze argument to
601false.
602
603Returns:
604        void
605***************************************************************************/
606void BXPT_PCR_FreezeIntegrator( 
607        BXPT_PCR_Handle hPcr,    /* [in] The pcr handle  */
608        bool Freeze                              /* [in] Freeze integrator if true, run if false. */
609        );
610
611/***************************************************************************
612Summary:
613Set the center frequency.
614
615Description:
616Set the absolute center frequency of the timebase relative to the crytal. A
617value of 0x400000 will generate a timebase of 27MHz. Changing the center
618frequency by one bit will change the timebase by about 3.8 ppm.
619
620Returns:
621        void
622***************************************************************************/
623void BXPT_PCR_SetCenterFrequency( 
624        BXPT_PCR_Handle hPcr,           /* [in] The pcr handle  */
625        uint32_t CenterFreq                     /* [in] Center frequency */
626        );
627
628/***************************************************************************
629Summary:
630Get default values for locking to the given timebase reference.
631
632Description:
633Return default values for the loop gain constants, pcr increment, and
634prescale. These defaults are tailored to the given timebase reference. These
635defaults may be used in a subsequent call to BXPT_PCR_ConfigNonStreamTimeBase.
636
637Returns:
638    BERR_SUCCESS                - if successful
639    BERR_INVALID_PARAMETER      - Bad input parameter
640***************************************************************************/
641BERR_Code       BXPT_PCR_GetTimeBaseFreqRefDefaults( 
642        BXPT_PCR_Handle hPcr,                                         
643        BXPT_PCR_TimeRef TimeBase, 
644        BXPT_PCR_TimebaseFreqRefConfig *Def
645        );
646
647/***************************************************************************
648Summary:
649Set the time base tracking range in the PCR block.
650
651Description:
652The timebase has a limited tracking range. The tracking range is centered on
653the crystal reference  + pcr center. Note that changes to the tracking range
654may cause sudden changes to the timebase, and may affect the video output quality.
655
656Returns:
657    BERR_SUCCESS                - if successful
658    BERR_INVALID_PARAMETER      - Bad input parameter
659***************************************************************************/
660void BXPT_PCR_SetTimeRefTrackRange( 
661        BXPT_PCR_Handle hPcr,                                         
662        BXPT_PCR_RefTrackRange TrackRange
663        );
664
665/***************************************************************************
666Summary:
667Set the phase error clamp range for the phase error input to the loop filter
668
669Description:
670
671Returns:
672    BERR_SUCCESS                - if successful
673    BERR_INVALID_PARAMETER      - Bad input parameter
674***************************************************************************/
675void BXPT_PCR_SetPhaseErrorClampRange( 
676        BXPT_PCR_Handle hPcr,                                         
677        BXPT_PCR_PhaseErrorClampRange ClampRange
678        );
679
680/***************************************************************************
681Summary:
682Enumeration of all supported interrupts in a Rave context.
683****************************************************************************/
684typedef enum BXPT_PCR_IntName
685{
686    /* Set whenever a PCR is detected */
687    BXPT_PCR_IntName_ePhaseCompare = BCHP_XPT_DPCR0_INTR_STATUS_REG_PHASE_CMP_INT_SHIFT,               
688
689    /* Set whenever 2 consecutive PCR errors are seen in the stream. */
690    BXPT_PCR_IntName_eTwoPcrErrors = BCHP_XPT_DPCR0_INTR_STATUS_REG_TWO_PCR_ERROR_SHIFT, 
691                 
692    BXPT_PCR_IntName_eMax   /* Marks the end of the supported interrutps */
693}
694BXPT_PCR_IntName;
695
696/***************************************************************************
697Summary:
698Generate the interrupt ID for the requested interrupt name.
699 
700Description:
701Prevents the app from having to do it directly.
702
703Returns:
704    BERR_SUCCESS                - if successful
705    BERR_INVALID_PARAMETER      - Bad input parameter
706***************************************************************************/
707BERR_Code BXPT_PCR_GetIntId(
708    unsigned WhichPcr,          /* Which PCR block. Same value as used in BXPT_PCR_Open() */
709    BXPT_PCR_IntName Name,      /* The interrupt in question. */
710    BINT_Id *IntId              /* IntId suitable for the BINT module. */
711   );
712
713#ifdef __cplusplus
714}
715#endif
716
717#endif
Note: See TracBrowser for help on using the repository browser.