| 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_satellite.h $ |
|---|
| 39 | * $brcm_Revision: 31 $ |
|---|
| 40 | * $brcm_Date: 11/11/11 3:50p $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: Frontend Satellite |
|---|
| 44 | * Generic APIs for satelitte tuning. |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /nexus/modules/frontend/common/include/nexus_frontend_satellite.h $ |
|---|
| 49 | * |
|---|
| 50 | * 31 11/11/11 3:50p mphillip |
|---|
| 51 | * SW7346-516: Merge to main |
|---|
| 52 | * |
|---|
| 53 | * SW7346-516/1 11/8/11 5:18p mphillip |
|---|
| 54 | * SW7346-516: Allow diseqc to be powered down separately |
|---|
| 55 | * |
|---|
| 56 | * 30 2/16/11 1:04p erickson |
|---|
| 57 | * SW7420-1491: add nelem required with nelem_out |
|---|
| 58 | * |
|---|
| 59 | * 29 2/15/11 2:13p erickson |
|---|
| 60 | * SW7420-1491: change to preferred nelem_out attribute |
|---|
| 61 | * |
|---|
| 62 | * 28 11/16/10 2:20p erickson |
|---|
| 63 | * SW7405-4968: add NEXUS_FrontendSatelliteSettings.networkSpec |
|---|
| 64 | * |
|---|
| 65 | * 27 11/9/10 3:13p erickson |
|---|
| 66 | * SW7405-4968: add NEXUS_FrontendSatelliteNetworkSpec, update 4506 and |
|---|
| 67 | * 73xx Open |
|---|
| 68 | * |
|---|
| 69 | * 26 10/7/10 9:43a erickson |
|---|
| 70 | * SW7325-820: fix sign of NEXUS_FrontendSatelliteStatus.agf |
|---|
| 71 | * |
|---|
| 72 | * 25 8/20/09 12:57p erickson |
|---|
| 73 | * PR57471: convert to NEXUS_FrontendSatelliteStatusError enum |
|---|
| 74 | * |
|---|
| 75 | * 24 8/12/09 3:07p erickson |
|---|
| 76 | * PR57471: added NEXUS_FrontendSatelliteStatus.statusAvailable |
|---|
| 77 | * |
|---|
| 78 | * 23 8/12/09 10:38a erickson |
|---|
| 79 | * PR57598: added NEXUS_FrontendDiseqcStatus.sendStatus |
|---|
| 80 | * |
|---|
| 81 | * 22 7/31/09 2:40p erickson |
|---|
| 82 | * PR57239: added NEXUS_Frontend_ReadSatelliteRegister and |
|---|
| 83 | * NEXUS_Frontend_WriteSatelliteRegister |
|---|
| 84 | * |
|---|
| 85 | * 21 7/30/09 5:05p erickson |
|---|
| 86 | * PR57175: sync up NEXUS_FrontendDiseqcMessageStatus with AST PI. |
|---|
| 87 | * |
|---|
| 88 | * 20 7/21/09 3:21p erickson |
|---|
| 89 | * PR56834: deprecated NEXUS_FrontendSatelliteStatus.lnaStatus for all sat |
|---|
| 90 | * demods except 4501 |
|---|
| 91 | * |
|---|
| 92 | * 19 7/14/09 10:40a erickson |
|---|
| 93 | * PR56791: added NEXUS_FrontendDiseqcSettings.replyDisabled |
|---|
| 94 | * |
|---|
| 95 | * 18 7/13/09 4:47p erickson |
|---|
| 96 | * PR56773: added NEXUS_FrontendDiseqcStatus |
|---|
| 97 | * |
|---|
| 98 | * 17 7/13/09 3:48p erickson |
|---|
| 99 | * PR56509: add NEXUS_FrontendDiseqcSettings.lnbEnabled |
|---|
| 100 | * |
|---|
| 101 | * 16 6/29/09 9:38a erickson |
|---|
| 102 | * PR56408: added NEXUS_Frontend_ResetDiseqc |
|---|
| 103 | * |
|---|
| 104 | * 15 6/24/09 9:31a erickson |
|---|
| 105 | * PR53078: added NEXUS_FrontendSatelliteStatus.agf |
|---|
| 106 | * |
|---|
| 107 | * 14 6/16/09 3:54p jgarrett |
|---|
| 108 | * PR 55888: Adding envelope mode |
|---|
| 109 | * |
|---|
| 110 | * 13 6/9/09 9:03a erickson |
|---|
| 111 | * PR54416: fix bad merge |
|---|
| 112 | * |
|---|
| 113 | * 12 6/4/09 10:27a erickson |
|---|
| 114 | * PR54416: merge |
|---|
| 115 | * |
|---|
| 116 | * 11 5/26/09 12:16p erickson |
|---|
| 117 | * PR55403: added NEXUS_FrontendDiseqcToneBurst |
|---|
| 118 | * |
|---|
| 119 | * PR54416/3 6/3/09 3:56p jtna |
|---|
| 120 | * PR54416: allow freqRange=0 and expose peakpower in peakscan |
|---|
| 121 | * |
|---|
| 122 | * PR54416/2 5/21/09 6:03p jtna |
|---|
| 123 | * PR54416: improve naming |
|---|
| 124 | * |
|---|
| 125 | * PR54416/1 5/15/09 7:47p jtna |
|---|
| 126 | * PR54416: nexus support for satellite scanning |
|---|
| 127 | * |
|---|
| 128 | * 10 5/11/09 4:29p erickson |
|---|
| 129 | * PR53078: added NEXUS_FrontendSatelliteStatus.timeElapsed |
|---|
| 130 | * |
|---|
| 131 | * 9 4/2/09 2:29p erickson |
|---|
| 132 | * PR53078: satellite api additions |
|---|
| 133 | * |
|---|
| 134 | * 8 3/5/09 10:42a jgarrett |
|---|
| 135 | * PR 52817: Converting offset values to signed |
|---|
| 136 | * |
|---|
| 137 | * 7 2/9/09 5:04p jgarrett |
|---|
| 138 | * PR 50837: Merge to main branch |
|---|
| 139 | * |
|---|
| 140 | * PR50837/1 1/29/09 10:37a jgarrett |
|---|
| 141 | * PR 50837: Adding ifOffset |
|---|
| 142 | * |
|---|
| 143 | * 6 12/18/08 6:37p jgarrett |
|---|
| 144 | * PR 49983: Adding more status members |
|---|
| 145 | * |
|---|
| 146 | * 5 11/14/08 6:58p jgarrett |
|---|
| 147 | * PR 48985: Adding turbo and ldpc options |
|---|
| 148 | * |
|---|
| 149 | * 4 2/12/08 2:34p jgarrett |
|---|
| 150 | * PR 39009: Unifying status |
|---|
| 151 | * |
|---|
| 152 | * 3 1/23/08 8:37p vobadm |
|---|
| 153 | * PR35457: update docs |
|---|
| 154 | * |
|---|
| 155 | * 2 1/23/08 5:16p erickson |
|---|
| 156 | * PR35457: update docs |
|---|
| 157 | * |
|---|
| 158 | * 1 1/18/08 2:19p jgarrett |
|---|
| 159 | * PR 38808: Merging to main branch |
|---|
| 160 | * |
|---|
| 161 | * Nexus_Devel/2 10/5/07 5:51p jgarrett |
|---|
| 162 | * PR 35551: successful build |
|---|
| 163 | * |
|---|
| 164 | * Nexus_Devel/1 10/4/07 2:41p jgarrett |
|---|
| 165 | * PR 35551: Adding initial version |
|---|
| 166 | * |
|---|
| 167 | ***************************************************************************/ |
|---|
| 168 | #ifndef NEXUS_FRONTEND_SATELLITE_H__ |
|---|
| 169 | #define NEXUS_FRONTEND_SATELLITE_H__ |
|---|
| 170 | |
|---|
| 171 | #ifdef __cplusplus |
|---|
| 172 | extern "C" { |
|---|
| 173 | #endif |
|---|
| 174 | |
|---|
| 175 | /*************************************************************************** |
|---|
| 176 | Summary: |
|---|
| 177 | Satellite acquisition modes |
|---|
| 178 | ***************************************************************************/ |
|---|
| 179 | typedef enum NEXUS_FrontendSatelliteMode |
|---|
| 180 | { |
|---|
| 181 | NEXUS_FrontendSatelliteMode_eDvb, |
|---|
| 182 | NEXUS_FrontendSatelliteMode_eDss, |
|---|
| 183 | NEXUS_FrontendSatelliteMode_eDcii, |
|---|
| 184 | NEXUS_FrontendSatelliteMode_eQpskTurbo, |
|---|
| 185 | NEXUS_FrontendSatelliteMode_eTurboQpsk=NEXUS_FrontendSatelliteMode_eQpskTurbo, |
|---|
| 186 | NEXUS_FrontendSatelliteMode_e8pskTurbo, |
|---|
| 187 | NEXUS_FrontendSatelliteMode_eTurbo8psk=NEXUS_FrontendSatelliteMode_e8pskTurbo, |
|---|
| 188 | NEXUS_FrontendSatelliteMode_eTurbo, |
|---|
| 189 | NEXUS_FrontendSatelliteMode_eQpskLdpc, |
|---|
| 190 | NEXUS_FrontendSatelliteMode_e8pskLdpc, |
|---|
| 191 | NEXUS_FrontendSatelliteMode_eLdpc, |
|---|
| 192 | NEXUS_FrontendSatelliteMode_eBlindAcquisition, |
|---|
| 193 | NEXUS_FrontendSatelliteMode_eMax |
|---|
| 194 | } NEXUS_FrontendSatelliteMode; |
|---|
| 195 | |
|---|
| 196 | /*************************************************************************** |
|---|
| 197 | Summary: |
|---|
| 198 | Satellite spectral inversion |
|---|
| 199 | ***************************************************************************/ |
|---|
| 200 | typedef enum NEXUS_FrontendSatelliteInversion |
|---|
| 201 | { |
|---|
| 202 | NEXUS_FrontendSatelliteInversion_eScan, |
|---|
| 203 | NEXUS_FrontendSatelliteInversion_eNormal, |
|---|
| 204 | NEXUS_FrontendSatelliteInversion_eI, |
|---|
| 205 | NEXUS_FrontendSatelliteInversion_eQ, |
|---|
| 206 | NEXUS_FrontendSatelliteInversion_eMax |
|---|
| 207 | } NEXUS_FrontendSatelliteInversion; |
|---|
| 208 | |
|---|
| 209 | /*************************************************************************** |
|---|
| 210 | Summary: |
|---|
| 211 | Satellite code rate |
|---|
| 212 | ***************************************************************************/ |
|---|
| 213 | typedef struct NEXUS_FrontendSatelliteCodeRate |
|---|
| 214 | { |
|---|
| 215 | unsigned numerator; /* If 0, value is scanned */ |
|---|
| 216 | unsigned denominator; /* If 0, value is scanned */ |
|---|
| 217 | unsigned bitsPerSymbol; /* x1000. If 0, uses the default. For example, 2050 is 2.05 */ |
|---|
| 218 | } NEXUS_FrontendSatelliteCodeRate; |
|---|
| 219 | |
|---|
| 220 | /*************************************************************************** |
|---|
| 221 | Summary: |
|---|
| 222 | Satellite network spec |
|---|
| 223 | ***************************************************************************/ |
|---|
| 224 | typedef enum NEXUS_FrontendSatelliteNetworkSpec |
|---|
| 225 | { |
|---|
| 226 | NEXUS_FrontendSatelliteNetworkSpec_eDefault = 0, |
|---|
| 227 | NEXUS_FrontendSatelliteNetworkSpec_eCustom1, |
|---|
| 228 | NEXUS_FrontendSatelliteNetworkSpec_eEuro, |
|---|
| 229 | NEXUS_FrontendSatelliteNetworkSpec_eMax |
|---|
| 230 | } NEXUS_FrontendSatelliteNetworkSpec; |
|---|
| 231 | |
|---|
| 232 | /*************************************************************************** |
|---|
| 233 | Summary: |
|---|
| 234 | Settings used for NEXUS_Frontend_TuneSatellite |
|---|
| 235 | ***************************************************************************/ |
|---|
| 236 | typedef struct NEXUS_FrontendSatelliteSettings |
|---|
| 237 | { |
|---|
| 238 | NEXUS_FrontendSatelliteMode mode; |
|---|
| 239 | NEXUS_FrontendSatelliteCodeRate codeRate; |
|---|
| 240 | NEXUS_FrontendSatelliteInversion spectralInversion; |
|---|
| 241 | unsigned frequency; /* In Hz */ |
|---|
| 242 | unsigned symbolRate; /* In Baud */ |
|---|
| 243 | int carrierOffset; /* In Hz */ |
|---|
| 244 | unsigned searchRange; /* In Hz */ |
|---|
| 245 | int32_t ifOffset; /* In Hz */ |
|---|
| 246 | NEXUS_FrontendSatelliteNetworkSpec networkSpec; |
|---|
| 247 | |
|---|
| 248 | /* The following settings map into the demod's 32 bit acq_ctl control word */ |
|---|
| 249 | bool pnData; |
|---|
| 250 | bool prbs15; /* true: PRBS-15, false: PRBS-23 */ |
|---|
| 251 | bool nyquist20; /* true: nyquist20, false: nyquist35 */ |
|---|
| 252 | bool bertEnable; |
|---|
| 253 | bool pnDataInvert; |
|---|
| 254 | bool bertResyncDisable; |
|---|
| 255 | bool reacquireDisable; |
|---|
| 256 | bool dciiSplit; |
|---|
| 257 | bool dciiSplitQ; |
|---|
| 258 | bool oQpsk; |
|---|
| 259 | bool rsDisable; |
|---|
| 260 | bool ldpcPilot; /* This option applies only for LDPC modes (low density parity check) */ |
|---|
| 261 | bool ldpcPilotPll; /* This option applies only for LDPC modes only if ldpcPilot is true */ |
|---|
| 262 | bool ldpcPilotScan; |
|---|
| 263 | bool tunerTestMode; |
|---|
| 264 | bool toneSearchMode; |
|---|
| 265 | bool signalDetectMode; |
|---|
| 266 | bool bypassTune; |
|---|
| 267 | bool bypassAcquire; |
|---|
| 268 | |
|---|
| 269 | NEXUS_CallbackDesc lockCallback; /* This callback will be called when lock status changes */ |
|---|
| 270 | } NEXUS_FrontendSatelliteSettings; |
|---|
| 271 | |
|---|
| 272 | /*************************************************************************** |
|---|
| 273 | Summary: |
|---|
| 274 | Initialize a satellite settings structure to defaults |
|---|
| 275 | ***************************************************************************/ |
|---|
| 276 | void NEXUS_Frontend_GetDefaultSatelliteSettings( |
|---|
| 277 | NEXUS_FrontendSatelliteSettings *pSettings /* [out] */ |
|---|
| 278 | ); |
|---|
| 279 | |
|---|
| 280 | /*************************************************************************** |
|---|
| 281 | Summary: |
|---|
| 282 | Initialize a satellite settings structure to defaults for a specific mode |
|---|
| 283 | ***************************************************************************/ |
|---|
| 284 | void NEXUS_Frontend_GetDefaultSatelliteSettingsForMode( |
|---|
| 285 | NEXUS_FrontendSatelliteMode mode, |
|---|
| 286 | NEXUS_FrontendSatelliteSettings *pSettings /* [out] */ |
|---|
| 287 | ); |
|---|
| 288 | |
|---|
| 289 | /*************************************************************************** |
|---|
| 290 | Summary: |
|---|
| 291 | Tune to a satellite channel |
|---|
| 292 | ***************************************************************************/ |
|---|
| 293 | NEXUS_Error NEXUS_Frontend_TuneSatellite( |
|---|
| 294 | NEXUS_FrontendHandle handle, |
|---|
| 295 | const NEXUS_FrontendSatelliteSettings *pSettings |
|---|
| 296 | ); |
|---|
| 297 | |
|---|
| 298 | /*************************************************************************** |
|---|
| 299 | Summary: |
|---|
| 300 | Type of error encountered when reading status. |
|---|
| 301 | ***************************************************************************/ |
|---|
| 302 | typedef enum NEXUS_FrontendSatelliteStatusError |
|---|
| 303 | { |
|---|
| 304 | NEXUS_FrontendSatelliteStatusError_eNone, |
|---|
| 305 | NEXUS_FrontendSatelliteStatusError_eI2cNoAck, |
|---|
| 306 | NEXUS_FrontendSatelliteStatusError_eHabTimeout, |
|---|
| 307 | NEXUS_FrontendSatelliteStatusError_eGetChannelStatusError, |
|---|
| 308 | NEXUS_FrontendSatelliteStatusError_eMax |
|---|
| 309 | } NEXUS_FrontendSatelliteStatusError; |
|---|
| 310 | |
|---|
| 311 | /*************************************************************************** |
|---|
| 312 | Summary: |
|---|
| 313 | Satellite tuning status |
|---|
| 314 | ***************************************************************************/ |
|---|
| 315 | typedef struct NEXUS_FrontendSatelliteStatus |
|---|
| 316 | { |
|---|
| 317 | NEXUS_FrontendSatelliteSettings settings; /* Settings provided at last call to NEXUS_Frontend_TuneSatellite. */ |
|---|
| 318 | |
|---|
| 319 | NEXUS_FrontendSatelliteStatusError statusError; /* Returns a recognized failure. NEXUS_Frontend_GetSatelliteStatus will return NEXUS_SUCCESS so this statusError |
|---|
| 320 | can be retrieved. */ |
|---|
| 321 | |
|---|
| 322 | NEXUS_FrontendSatelliteMode mode; /* Mode */ |
|---|
| 323 | NEXUS_FrontendSatelliteCodeRate codeRate; /* Code rate detected */ |
|---|
| 324 | NEXUS_FrontendSatelliteInversion spectralInversion; /* Spectral inversion status */ |
|---|
| 325 | unsigned frequency; /* actual tuner frequency */ |
|---|
| 326 | |
|---|
| 327 | bool tunerLocked; /* true if the tuner is locked */ |
|---|
| 328 | bool demodLocked; /* true if the demodulator is locked */ |
|---|
| 329 | bool bertLocked; /* true if the BER tester is locked. If so, see berEstimate. */ |
|---|
| 330 | |
|---|
| 331 | unsigned channel; /* Channel number */ |
|---|
| 332 | unsigned symbolRate; /* In baud */ |
|---|
| 333 | int symbolRateError; /* In baud */ |
|---|
| 334 | |
|---|
| 335 | int carrierOffset; /* In Hz */ |
|---|
| 336 | int carrierError; /* In Hz */ |
|---|
| 337 | unsigned sampleClock; /* In Hz */ |
|---|
| 338 | unsigned outputBitRate; /* Output bit rate in bps */ |
|---|
| 339 | |
|---|
| 340 | unsigned ifAgcLevel; /* IF AGC level in units of 1/10 percent */ |
|---|
| 341 | unsigned rfAgcLevel; /* tuner AGC level in units of 1/10 percent */ |
|---|
| 342 | unsigned intAgcLevel; /* Internal AGC level in units of 1/10 percent */ |
|---|
| 343 | unsigned snrEstimate; /* SNR in 1/100 dB */ |
|---|
| 344 | unsigned berEstimate; /* Bit error rate as log10 of 0.0-1.0 range. |
|---|
| 345 | 1.0 => 100% => 0 |
|---|
| 346 | 0.1 => 10% => -1 |
|---|
| 347 | 0.01 => 1% => -2 |
|---|
| 348 | 0 => 0% => 1 (special value for NONE) |
|---|
| 349 | If bertLocked == false, it's set to 1. */ |
|---|
| 350 | |
|---|
| 351 | unsigned fecPhase; /* 0, 90, 180, 270 */ |
|---|
| 352 | unsigned fecCorrected; /* cumulative block correctable errors */ |
|---|
| 353 | unsigned fecUncorrected; /* cumulative block uncorrectable errors */ |
|---|
| 354 | unsigned fecClean; /* cumulative clean block count */ |
|---|
| 355 | unsigned bitErrCorrected; /* cumulative bit correctable errors */ |
|---|
| 356 | unsigned reacquireCount; /* cumulative reacquisition count */ |
|---|
| 357 | unsigned berErrors; /* BER error count - valid if bertLocked is true */ |
|---|
| 358 | unsigned preViterbiErrorCount; /* accumulated pre-Viterbi error count */ |
|---|
| 359 | unsigned mpegErrors; /* mpeg frame error count */ |
|---|
| 360 | unsigned mpegCount; /* total mpeg frame count */ |
|---|
| 361 | unsigned ifAgc; /* if agc value from hw unmodified */ |
|---|
| 362 | unsigned rfAgc; /* rf agc value from hw unmodified */ |
|---|
| 363 | int agf; /* AGF integrator value */ |
|---|
| 364 | |
|---|
| 365 | /* Deprecated. lnaStatus is only populated for BCM4501 frontends. See NEXUS_Frontend_Get73xxLnaStatus. */ |
|---|
| 366 | struct |
|---|
| 367 | { |
|---|
| 368 | unsigned intConfig; |
|---|
| 369 | unsigned extConfig; |
|---|
| 370 | unsigned version; |
|---|
| 371 | unsigned agc0; |
|---|
| 372 | unsigned agc1; |
|---|
| 373 | } lnaStatus; /* deprecated */ |
|---|
| 374 | |
|---|
| 375 | struct { |
|---|
| 376 | uint16_t chipId; |
|---|
| 377 | uint8_t chipVersion; |
|---|
| 378 | uint32_t bondingOption; |
|---|
| 379 | uint8_t apMicrocodeVersion; |
|---|
| 380 | uint8_t hostConfigurationVersion; |
|---|
| 381 | } version; /* hardware, firmware and software version information */ |
|---|
| 382 | |
|---|
| 383 | unsigned timeElapsed; /* time elapsed in milliseconds since the last call to NEXUS_Frontend_ResetStatus. |
|---|
| 384 | the elapsed time is measured at the same time that the rest of the values in NEXUS_FrontendSatelliteStatus are captured. */ |
|---|
| 385 | } NEXUS_FrontendSatelliteStatus; |
|---|
| 386 | |
|---|
| 387 | /*************************************************************************** |
|---|
| 388 | Summary: |
|---|
| 389 | Get the status of a satellite tuner |
|---|
| 390 | |
|---|
| 391 | Description: |
|---|
| 392 | This function will return an error code only if it's unable to get any status because of an unknown failure. |
|---|
| 393 | In some cases, the type of status error is recognized as a specific type of failure, NEXUS_FrontendSatelliteStatus.statusError is |
|---|
| 394 | set and the function returns NEXUS_SUCCESS. |
|---|
| 395 | ***************************************************************************/ |
|---|
| 396 | NEXUS_Error NEXUS_Frontend_GetSatelliteStatus( |
|---|
| 397 | NEXUS_FrontendHandle handle, |
|---|
| 398 | NEXUS_FrontendSatelliteStatus *pStatus /* [out] */ |
|---|
| 399 | ); |
|---|
| 400 | |
|---|
| 401 | /*************************************************************************** |
|---|
| 402 | Summary: |
|---|
| 403 | DiSEqC voltage |
|---|
| 404 | ***************************************************************************/ |
|---|
| 405 | typedef enum NEXUS_FrontendDiseqcVoltage |
|---|
| 406 | { |
|---|
| 407 | NEXUS_FrontendDiseqcVoltage_e13v, |
|---|
| 408 | NEXUS_FrontendDiseqcVoltage_e18v, |
|---|
| 409 | NEXUS_FrontendDiseqcVoltage_eMax |
|---|
| 410 | } NEXUS_FrontendDiseqcVoltage; |
|---|
| 411 | |
|---|
| 412 | /*************************************************************************** |
|---|
| 413 | Summary: |
|---|
| 414 | DiSEqC tone burst |
|---|
| 415 | ***************************************************************************/ |
|---|
| 416 | typedef enum NEXUS_FrontendDiseqcToneBurst { |
|---|
| 417 | NEXUS_FrontendDiseqcToneBurst_eNone, |
|---|
| 418 | NEXUS_FrontendDiseqcToneBurst_eUnmodulated, |
|---|
| 419 | NEXUS_FrontendDiseqcToneBurst_eNominal, |
|---|
| 420 | NEXUS_FrontendDiseqcToneBurst_eMax |
|---|
| 421 | } NEXUS_FrontendDiseqcToneBurst; |
|---|
| 422 | |
|---|
| 423 | /*************************************************************************** |
|---|
| 424 | Summary: |
|---|
| 425 | DiSEqC tone burst |
|---|
| 426 | ***************************************************************************/ |
|---|
| 427 | typedef enum NEXUS_FrontendDiseqcToneMode { |
|---|
| 428 | NEXUS_FrontendDiseqcToneMode_eTone, |
|---|
| 429 | NEXUS_FrontendDiseqcToneMode_eEnvelope, |
|---|
| 430 | NEXUS_FrontendDiseqcToneMode_eMax |
|---|
| 431 | } NEXUS_FrontendDiseqcToneMode; |
|---|
| 432 | |
|---|
| 433 | /*************************************************************************** |
|---|
| 434 | Summary: |
|---|
| 435 | DiSEqC Settings for tone and voltage control |
|---|
| 436 | ***************************************************************************/ |
|---|
| 437 | typedef struct NEXUS_FrontendDiseqcSettings |
|---|
| 438 | { |
|---|
| 439 | bool lnbEnabled; /* if true, LNBP voltage (low noise blocker power) is enabled, otherwise LNBP voltage is zero volt */ |
|---|
| 440 | |
|---|
| 441 | NEXUS_FrontendDiseqcVoltage voltage; |
|---|
| 442 | bool toneEnabled; |
|---|
| 443 | NEXUS_FrontendDiseqcToneBurst toneBurst; |
|---|
| 444 | NEXUS_FrontendDiseqcToneMode toneMode; |
|---|
| 445 | |
|---|
| 446 | bool replyDisabled; |
|---|
| 447 | |
|---|
| 448 | bool enabled; /* If set to false, power down the diseqc core. */ |
|---|
| 449 | } NEXUS_FrontendDiseqcSettings; |
|---|
| 450 | |
|---|
| 451 | /*************************************************************************** |
|---|
| 452 | Summary: |
|---|
| 453 | Get the current DiSEqC settings for a satellite tuner |
|---|
| 454 | ***************************************************************************/ |
|---|
| 455 | void NEXUS_Frontend_GetDiseqcSettings( |
|---|
| 456 | NEXUS_FrontendHandle handle, |
|---|
| 457 | NEXUS_FrontendDiseqcSettings *pSettings /* [out] */ |
|---|
| 458 | ); |
|---|
| 459 | |
|---|
| 460 | /*************************************************************************** |
|---|
| 461 | Summary: |
|---|
| 462 | Set the current DiSEqC settings for a satellite tuner |
|---|
| 463 | ***************************************************************************/ |
|---|
| 464 | NEXUS_Error NEXUS_Frontend_SetDiseqcSettings( |
|---|
| 465 | NEXUS_FrontendHandle handle, |
|---|
| 466 | const NEXUS_FrontendDiseqcSettings *pSettings |
|---|
| 467 | ); |
|---|
| 468 | |
|---|
| 469 | /*************************************************************************** |
|---|
| 470 | Summary: |
|---|
| 471 | DiSEqC message transmission status |
|---|
| 472 | ***************************************************************************/ |
|---|
| 473 | typedef enum NEXUS_FrontendDiseqcMessageStatus |
|---|
| 474 | { |
|---|
| 475 | NEXUS_FrontendDiseqcMessageStatus_eSuccess = 0, /* no error */ |
|---|
| 476 | NEXUS_FrontendDiseqcMessageStatus_eRxOverflow, |
|---|
| 477 | NEXUS_FrontendDiseqcMessageStatus_eRxReplyTimeout, |
|---|
| 478 | NEXUS_FrontendDiseqcMessageStatus_eRxParityError, |
|---|
| 479 | NEXUS_FrontendDiseqcMessageStatus_eAcwTimeout, |
|---|
| 480 | NEXUS_FrontendDiseqcMessageStatus_eBusy, |
|---|
| 481 | NEXUS_FrontendDiseqcMessageStatus_eMax |
|---|
| 482 | } NEXUS_FrontendDiseqcMessageStatus; |
|---|
| 483 | |
|---|
| 484 | /*************************************************************************** |
|---|
| 485 | Summary: |
|---|
| 486 | DiSEqC status |
|---|
| 487 | |
|---|
| 488 | Description: |
|---|
| 489 | This retrives the state of hardware, not current software state. |
|---|
| 490 | ***************************************************************************/ |
|---|
| 491 | typedef struct NEXUS_FrontendDiseqcStatus |
|---|
| 492 | { |
|---|
| 493 | bool toneEnabled; /* 22KHz continuous tone present */ |
|---|
| 494 | unsigned voltage; /* voltage estimation */ |
|---|
| 495 | NEXUS_FrontendDiseqcMessageStatus sendStatus; /* last disqec send status. |
|---|
| 496 | same status as NEXUS_Frontend_GetDiseqcReply's pStatus out parameter. |
|---|
| 497 | use this if no reply buffer is needed. */ |
|---|
| 498 | } NEXUS_FrontendDiseqcStatus; |
|---|
| 499 | |
|---|
| 500 | /*************************************************************************** |
|---|
| 501 | Summary: |
|---|
| 502 | Get the current DiSEqC status |
|---|
| 503 | ***************************************************************************/ |
|---|
| 504 | NEXUS_Error NEXUS_Frontend_GetDiseqcStatus( |
|---|
| 505 | NEXUS_FrontendHandle handle, |
|---|
| 506 | NEXUS_FrontendDiseqcStatus *pStatus /* [out] */ |
|---|
| 507 | ); |
|---|
| 508 | |
|---|
| 509 | /*************************************************************************** |
|---|
| 510 | Summary: |
|---|
| 511 | Send a DiSEqC message |
|---|
| 512 | |
|---|
| 513 | Description: |
|---|
| 514 | This routine will send the number of bytes specified in a DiSEqC message. |
|---|
| 515 | The callback provided will be called when the transfer is complete, at |
|---|
| 516 | which point the reply/status can be read. |
|---|
| 517 | ***************************************************************************/ |
|---|
| 518 | NEXUS_Error NEXUS_Frontend_SendDiseqcMessage( |
|---|
| 519 | NEXUS_FrontendHandle handle, |
|---|
| 520 | const uint8_t *pSendData, /* attr{nelem=sendDataSize} */ |
|---|
| 521 | size_t sendDataSize, /* In Bytes */ |
|---|
| 522 | const NEXUS_CallbackDesc *pSendComplete /* Callback will be received when message status is ready */ |
|---|
| 523 | ); |
|---|
| 524 | |
|---|
| 525 | /*************************************************************************** |
|---|
| 526 | Summary: |
|---|
| 527 | Reset DiSEqC |
|---|
| 528 | |
|---|
| 529 | Description: |
|---|
| 530 | This routine will reset the diseqc. |
|---|
| 531 | ***************************************************************************/ |
|---|
| 532 | NEXUS_Error NEXUS_Frontend_ResetDiseqc( |
|---|
| 533 | NEXUS_FrontendHandle handle, |
|---|
| 534 | uint8_t options |
|---|
| 535 | ); |
|---|
| 536 | |
|---|
| 537 | /*************************************************************************** |
|---|
| 538 | Summary: |
|---|
| 539 | Read a DiSEqC message reply |
|---|
| 540 | |
|---|
| 541 | Description: |
|---|
| 542 | This routine will read up to the number of bytes specified from a DiSEqC |
|---|
| 543 | message reply. Any remaining bytes will be discarded. |
|---|
| 544 | ***************************************************************************/ |
|---|
| 545 | NEXUS_Error NEXUS_Frontend_GetDiseqcReply( |
|---|
| 546 | NEXUS_FrontendHandle handle, |
|---|
| 547 | NEXUS_FrontendDiseqcMessageStatus *pStatus, |
|---|
| 548 | uint8_t *pReplyBuffer, /* [out] attr{nelem=replyBufferSize;nelem_out=pReplyLength} */ |
|---|
| 549 | size_t replyBufferSize, /* in bytes */ |
|---|
| 550 | size_t *pReplyLength /* [out] */ |
|---|
| 551 | ); |
|---|
| 552 | |
|---|
| 553 | /*************************************************************************** |
|---|
| 554 | Summary: |
|---|
| 555 | Send a DiSEqC Auto Control Word |
|---|
| 556 | ***************************************************************************/ |
|---|
| 557 | NEXUS_Error NEXUS_Frontend_SendDiseqcAcw( |
|---|
| 558 | NEXUS_FrontendHandle handle, |
|---|
| 559 | uint8_t codeWord |
|---|
| 560 | ); |
|---|
| 561 | |
|---|
| 562 | /*************************************************************************** |
|---|
| 563 | Summary: |
|---|
| 564 | Reads from the configuration space. |
|---|
| 565 | ***************************************************************************/ |
|---|
| 566 | NEXUS_Error NEXUS_Frontend_ReadSatelliteConfig( |
|---|
| 567 | NEXUS_FrontendHandle handle, |
|---|
| 568 | unsigned id, /* configuration parameter ID */ |
|---|
| 569 | void *buffer, /* [out] attr{nelem=bufferSize} bytes to read */ |
|---|
| 570 | unsigned bufferSize /* size of buffer in bytes */ |
|---|
| 571 | ); |
|---|
| 572 | |
|---|
| 573 | /*************************************************************************** |
|---|
| 574 | Summary: |
|---|
| 575 | Writes to the configuration space. |
|---|
| 576 | ***************************************************************************/ |
|---|
| 577 | NEXUS_Error NEXUS_Frontend_WriteSatelliteConfig( |
|---|
| 578 | NEXUS_FrontendHandle handle, |
|---|
| 579 | unsigned id, /* configuration parameter ID */ |
|---|
| 580 | const void *buffer, /* attr{nelem=bufferSize} bytes to write */ |
|---|
| 581 | unsigned bufferSize /* size of buffer in bytes */ |
|---|
| 582 | ); |
|---|
| 583 | |
|---|
| 584 | /*************************************************************************** |
|---|
| 585 | Summary: |
|---|
| 586 | Satellite peak scan settings |
|---|
| 587 | ***************************************************************************/ |
|---|
| 588 | typedef struct NEXUS_FrontendSatellitePeakscanSettings { |
|---|
| 589 | unsigned frequency; /* tuner frequency in Hz */ |
|---|
| 590 | unsigned minSymbolRate; /* minimum symbol rate in sym/sec */ |
|---|
| 591 | unsigned maxSymbolRate; /* maximum symbol rate in sym/sec */ |
|---|
| 592 | unsigned frequencyRange; /* search range in Hz. freq -/+freqRange will be searched */ |
|---|
| 593 | unsigned frequencyStep; /* tuner step frequency in Hz */ |
|---|
| 594 | NEXUS_CallbackDesc peakscanCallback; /* this callback will be called when the peak scan finishes */ |
|---|
| 595 | } NEXUS_FrontendSatellitePeakscanSettings; |
|---|
| 596 | |
|---|
| 597 | /*************************************************************************** |
|---|
| 598 | Summary: |
|---|
| 599 | Get default satellite peak scan settings |
|---|
| 600 | ***************************************************************************/ |
|---|
| 601 | void NEXUS_Frontend_GetDefaultSatellitePeakscanSettings( |
|---|
| 602 | NEXUS_FrontendSatellitePeakscanSettings *pSettings /* [out] */ |
|---|
| 603 | ); |
|---|
| 604 | |
|---|
| 605 | /*************************************************************************** |
|---|
| 606 | Summary: |
|---|
| 607 | Minimum and maximum values for NEXUS_FrontendSatellitePeakscanSettings.freq |
|---|
| 608 | ***************************************************************************/ |
|---|
| 609 | #define NEXUS_SATELLITE_PEAKSCAN_MIN_FREQ 250000000UL |
|---|
| 610 | #define NEXUS_SATELLITE_PEAKSCAN_MAX_FREQ 2150000000UL |
|---|
| 611 | |
|---|
| 612 | /*************************************************************************** |
|---|
| 613 | Summary: |
|---|
| 614 | Perform satellite peak scan |
|---|
| 615 | ***************************************************************************/ |
|---|
| 616 | NEXUS_Error NEXUS_Frontend_SatellitePeakscan( |
|---|
| 617 | NEXUS_FrontendHandle handle, |
|---|
| 618 | const NEXUS_FrontendSatellitePeakscanSettings *pSettings |
|---|
| 619 | ); |
|---|
| 620 | |
|---|
| 621 | /*************************************************************************** |
|---|
| 622 | Summary: |
|---|
| 623 | Satellite peak scan result |
|---|
| 624 | ***************************************************************************/ |
|---|
| 625 | typedef struct NEXUS_FrontendSatellitePeakscanResult { |
|---|
| 626 | unsigned peakFrequency; /* peak frequency. null if no peak frequency was found for given peak scan settings */ |
|---|
| 627 | unsigned symbolRate; /* symbol rate corresponding to peak frequency */ |
|---|
| 628 | unsigned lastFrequency; /* last frequency scanned before scan was terminated */ |
|---|
| 629 | unsigned peakPower; /* power corresponding to peakFrequency */ |
|---|
| 630 | } NEXUS_FrontendSatellitePeakscanResult; |
|---|
| 631 | |
|---|
| 632 | /*************************************************************************** |
|---|
| 633 | Summary: |
|---|
| 634 | Get results of satellite peak scan |
|---|
| 635 | ***************************************************************************/ |
|---|
| 636 | NEXUS_Error NEXUS_Frontend_GetSatellitePeakscanResult( |
|---|
| 637 | NEXUS_FrontendHandle handle, |
|---|
| 638 | NEXUS_FrontendSatellitePeakscanResult *pResult /* [out] */ |
|---|
| 639 | ); |
|---|
| 640 | |
|---|
| 641 | /*************************************************************************** |
|---|
| 642 | Summary: |
|---|
| 643 | Read a satellite demod register |
|---|
| 644 | ***************************************************************************/ |
|---|
| 645 | NEXUS_Error NEXUS_Frontend_ReadSatelliteRegister( |
|---|
| 646 | NEXUS_FrontendHandle handle, |
|---|
| 647 | uint32_t address, |
|---|
| 648 | uint32_t *pValue /* [out] */ |
|---|
| 649 | ); |
|---|
| 650 | |
|---|
| 651 | /*************************************************************************** |
|---|
| 652 | Summary: |
|---|
| 653 | Write a satellite demod register |
|---|
| 654 | ***************************************************************************/ |
|---|
| 655 | NEXUS_Error NEXUS_Frontend_WriteSatelliteRegister( |
|---|
| 656 | NEXUS_FrontendHandle handle, |
|---|
| 657 | uint32_t address, |
|---|
| 658 | uint32_t value |
|---|
| 659 | ); |
|---|
| 660 | |
|---|
| 661 | #ifdef __cplusplus |
|---|
| 662 | } |
|---|
| 663 | #endif |
|---|
| 664 | |
|---|
| 665 | #endif /* #ifndef NEXUS_FRONTEND_SATELLITE_H__ */ |
|---|
| 666 | |
|---|