| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2010 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_vsb.h $ |
|---|
| 39 | * $brcm_Revision: 8 $ |
|---|
| 40 | * $brcm_Date: 9/13/10 5:04p $ |
|---|
| 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_vsb.h $ |
|---|
| 49 | * |
|---|
| 50 | * 8 9/13/10 5:04p jhaberf |
|---|
| 51 | * SW35230-1161: Merging to main branch |
|---|
| 52 | * |
|---|
| 53 | * SW35230-1161/1 9/10/10 11:06a shyi |
|---|
| 54 | * SW35230-1161: Added carrier offset to VSB and QAM status reporting |
|---|
| 55 | * |
|---|
| 56 | * 7 7/20/09 12:47p erickson |
|---|
| 57 | * PR56816: add viterbiErrorRate status and related fields, improve |
|---|
| 58 | * comments |
|---|
| 59 | * |
|---|
| 60 | * 6 5/12/09 9:37a erickson |
|---|
| 61 | * PR54481: add NEXUS_FrontendVsbStatus.timeElapsed |
|---|
| 62 | * |
|---|
| 63 | * 5 5/11/09 4:48p erickson |
|---|
| 64 | * PR54481: add params to NEXUS_FrontendVsbSettings |
|---|
| 65 | * |
|---|
| 66 | * 4 2/12/08 2:34p jgarrett |
|---|
| 67 | * PR 39009: Unifying status |
|---|
| 68 | * |
|---|
| 69 | * 3 1/23/08 8:37p vobadm |
|---|
| 70 | * PR35457: update docs |
|---|
| 71 | * |
|---|
| 72 | * 2 1/23/08 5:16p erickson |
|---|
| 73 | * PR35457: update docs |
|---|
| 74 | * |
|---|
| 75 | * 1 1/18/08 2:19p jgarrett |
|---|
| 76 | * PR 38808: Merging to main branch |
|---|
| 77 | * |
|---|
| 78 | * Nexus_Devel/3 12/20/07 2:30p jgarrett |
|---|
| 79 | * PR 38019: API touchup |
|---|
| 80 | * |
|---|
| 81 | * Nexus_Devel/2 10/10/07 11:29a jgarrett |
|---|
| 82 | * PR 35551: Fixing typo |
|---|
| 83 | * |
|---|
| 84 | * Nexus_Devel/1 10/4/07 2:41p jgarrett |
|---|
| 85 | * PR 35551: Adding initial version |
|---|
| 86 | * |
|---|
| 87 | ***************************************************************************/ |
|---|
| 88 | #ifndef NEXUS_FRONTEND_VSB_H__ |
|---|
| 89 | #define NEXUS_FRONTEND_VSB_H__ |
|---|
| 90 | |
|---|
| 91 | #ifdef __cplusplus |
|---|
| 92 | extern "C" { |
|---|
| 93 | #endif |
|---|
| 94 | |
|---|
| 95 | /*************************************************************************** |
|---|
| 96 | Summary: |
|---|
| 97 | VSB tuning modes |
|---|
| 98 | ***************************************************************************/ |
|---|
| 99 | typedef enum NEXUS_FrontendVsbMode |
|---|
| 100 | { |
|---|
| 101 | NEXUS_FrontendVsbMode_e8, |
|---|
| 102 | NEXUS_FrontendVsbMode_e16, |
|---|
| 103 | NEXUS_FrontendVsbMode_eMax |
|---|
| 104 | } NEXUS_FrontendVsbMode; |
|---|
| 105 | |
|---|
| 106 | /*************************************************************************** |
|---|
| 107 | Summary: |
|---|
| 108 | VSB tuning parameters |
|---|
| 109 | ***************************************************************************/ |
|---|
| 110 | typedef struct NEXUS_FrontendVsbSettings |
|---|
| 111 | { |
|---|
| 112 | NEXUS_FrontendVsbMode mode; /* Modulation Scheme */ |
|---|
| 113 | |
|---|
| 114 | unsigned frequency; /* In Hz */ |
|---|
| 115 | unsigned ifFrequency; /* IF Frequency in Hz */ |
|---|
| 116 | unsigned symbolRate; /* In Baud */ |
|---|
| 117 | |
|---|
| 118 | int ifFrequencyOffset; /* IF Frequency offset in Hz */ |
|---|
| 119 | int symbolRateOffset; /* In Baud */ |
|---|
| 120 | int ntscOffset; /* In Hz */ |
|---|
| 121 | |
|---|
| 122 | bool fastAcquisition; /* True=fast acquisition mode, false=default */ |
|---|
| 123 | bool terrestrial; /* Receiver mode: true=terrestrial, false=cable */ |
|---|
| 124 | |
|---|
| 125 | bool autoAcquire; /* automatically reacquire signal if out of lock */ |
|---|
| 126 | bool ntscSweep; /* enable NTSC canceller */ |
|---|
| 127 | bool rfiSweep; /* enable RFI canceller */ |
|---|
| 128 | |
|---|
| 129 | NEXUS_CallbackDesc lockCallback; /* Callback will be called when lock status changes */ |
|---|
| 130 | } NEXUS_FrontendVsbSettings; |
|---|
| 131 | |
|---|
| 132 | /*************************************************************************** |
|---|
| 133 | Summary: |
|---|
| 134 | Initialize a VSB settings structure to defaults |
|---|
| 135 | ***************************************************************************/ |
|---|
| 136 | void NEXUS_Frontend_GetDefaultVsbSettings( |
|---|
| 137 | NEXUS_FrontendVsbSettings *pSettings |
|---|
| 138 | ); |
|---|
| 139 | |
|---|
| 140 | /*************************************************************************** |
|---|
| 141 | Summary: |
|---|
| 142 | Tune to a VSB channel |
|---|
| 143 | ***************************************************************************/ |
|---|
| 144 | NEXUS_Error NEXUS_Frontend_TuneVsb( |
|---|
| 145 | NEXUS_FrontendHandle handle, |
|---|
| 146 | const NEXUS_FrontendVsbSettings *pSettings |
|---|
| 147 | ); |
|---|
| 148 | |
|---|
| 149 | /*************************************************************************** |
|---|
| 150 | Summary: |
|---|
| 151 | VSB tuning status |
|---|
| 152 | ***************************************************************************/ |
|---|
| 153 | typedef struct NEXUS_FrontendVsbStatus |
|---|
| 154 | { |
|---|
| 155 | NEXUS_FrontendVsbSettings settings; /* Settings provided at last call to NEXUS_Frontend_TuneVsb */ |
|---|
| 156 | |
|---|
| 157 | bool receiverLock; /* true if the receiver is locked */ |
|---|
| 158 | bool fecLock; /* true if the FEC is locked */ |
|---|
| 159 | bool opllLock; /* true if the output PLL is locked */ |
|---|
| 160 | |
|---|
| 161 | unsigned symbolRate; /* standard symbol rate in Baud */ |
|---|
| 162 | int symbolRateError; /* symbol rate error in Baud */ |
|---|
| 163 | |
|---|
| 164 | unsigned ifFrequency; /* standard IF frequency in Hz */ |
|---|
| 165 | int ifFrequencyError; /* IF frequency error in Hz */ |
|---|
| 166 | |
|---|
| 167 | unsigned ifAgcLevel; /* IF AGC level in units of 1/10 percent */ |
|---|
| 168 | unsigned rfAgcLevel; /* tuner AGC level in units of 1/10 percent */ |
|---|
| 169 | unsigned intAgcLevel; /* Internal AGC level in units of 1/10 percent */ |
|---|
| 170 | unsigned snrEstimate; /* SNR estimate in units of 1/100 dB */ |
|---|
| 171 | |
|---|
| 172 | unsigned fecCorrected; /* FEC corrected block count, accumulated since tune or NEXUS_Frontent_ResetStatus */ |
|---|
| 173 | unsigned fecUncorrected; /* FEC uncorrected block count, accumulated since tune or NEXUS_Frontent_ResetStatus */ |
|---|
| 174 | unsigned fecClean; /* FEC clean block count, accumulated since tune or NEXUS_Frontent_ResetStatus */ |
|---|
| 175 | unsigned bitErrCorrected; /* deprecated: cumulative bit correctable errors. same as viterbiUncorrectedBits. */ |
|---|
| 176 | unsigned reacquireCount; /* cumulative reacquisition count */ |
|---|
| 177 | |
|---|
| 178 | unsigned viterbiUncorrectedBits; /* uncorrected error bits output from Viterbi, accumulated since tune or NEXUS_Frontent_ResetStatus. */ |
|---|
| 179 | unsigned viterbiTotalBits; /* total number of bits output from Viterbi, accumulated since tune or NEXUS_Frontent_ResetStatus. */ |
|---|
| 180 | uint32_t viterbiErrorRate; /* viterbi bit error rate (BER) in 1/2147483648 th units. |
|---|
| 181 | Convert to floating point by dividing by 2147483648.0 */ |
|---|
| 182 | |
|---|
| 183 | unsigned timeElapsed; /* time elapsed in milliseconds since the last call to NEXUS_Frontend_ResetStatus. |
|---|
| 184 | the elapsed time is measured at the same time that the rest of the values in NEXUS_FrontendVsbStatus are captured. */ |
|---|
| 185 | int carrierOffset; /* carrier offset in Hz */ |
|---|
| 186 | } NEXUS_FrontendVsbStatus; |
|---|
| 187 | |
|---|
| 188 | /*************************************************************************** |
|---|
| 189 | Summary: |
|---|
| 190 | Get the status of a VSB tuner |
|---|
| 191 | ***************************************************************************/ |
|---|
| 192 | NEXUS_Error NEXUS_Frontend_GetVsbStatus( |
|---|
| 193 | NEXUS_FrontendHandle handle, |
|---|
| 194 | NEXUS_FrontendVsbStatus *pStatus /* [out] */ |
|---|
| 195 | ); |
|---|
| 196 | |
|---|
| 197 | #ifdef __cplusplus |
|---|
| 198 | } |
|---|
| 199 | #endif |
|---|
| 200 | |
|---|
| 201 | #endif /* #ifndef NEXUS_FRONTEND_VSB_H__ */ |
|---|
| 202 | |
|---|