| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2010, 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: bsettop_tuner.h $ |
|---|
| 11 | * $brcm_Revision: 22 $ |
|---|
| 12 | * $brcm_Date: 8/5/10 10:25a $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /BSEAV/api/include/bsettop_tuner.h $ |
|---|
| 19 | * |
|---|
| 20 | * 22 8/5/10 10:25a jgarrett |
|---|
| 21 | * SW7550-512: Merge to main branch |
|---|
| 22 | * |
|---|
| 23 | * SW7550-512/1 8/5/10 3:03p nitinb |
|---|
| 24 | * SW7550-512: Added enum value btuner_ofdm_mode_dvbt2 |
|---|
| 25 | * |
|---|
| 26 | * 21 6/4/10 11:07a vsilyaev |
|---|
| 27 | * SW7550-236: Extended QAM status |
|---|
| 28 | * |
|---|
| 29 | * SW7550-236/3 5/21/10 3:04p pinglong |
|---|
| 30 | * SW7550-236: move the postRsBer calculation to info_status.cpp |
|---|
| 31 | * |
|---|
| 32 | * SW7550-236/2 4/21/10 9:54p pinglong |
|---|
| 33 | * SW7550-236: It's not right for some item for status page of brutus. |
|---|
| 34 | * |
|---|
| 35 | * SW7550-236/1 4/16/10 7:59p pinglong |
|---|
| 36 | * SW7550-236: It's not right for some item for status page of brutus. |
|---|
| 37 | * |
|---|
| 38 | * 20 2/5/10 1:51p mphillip |
|---|
| 39 | * CR7550-115: Add QAM/DVB-C support for 7550 |
|---|
| 40 | * |
|---|
| 41 | * 19 12/11/09 4:57p mphillip |
|---|
| 42 | * SW7550-112: Merge 7550 changes to main branch |
|---|
| 43 | * |
|---|
| 44 | * Refsw_7550/1 11/23/09 2:36p chengli |
|---|
| 45 | * SW7550-64: add enum btuner_ofdm_mode |
|---|
| 46 | * |
|---|
| 47 | * 18 6/30/09 12:33p vsilyaev |
|---|
| 48 | * PR 56070: Changed units of dsChannelPower field |
|---|
| 49 | * |
|---|
| 50 | * 17 12/18/08 6:36p jgarrett |
|---|
| 51 | * PR 49983: Adding more items to btuner_sds_status |
|---|
| 52 | * |
|---|
| 53 | * 16 11/14/08 5:32p jgarrett |
|---|
| 54 | * PR 48985: Separating turbo and ldpc modes |
|---|
| 55 | * |
|---|
| 56 | * 15 10/15/08 5:26p vsilyaev |
|---|
| 57 | * PR47842: BER calculation software implementation |
|---|
| 58 | * |
|---|
| 59 | * PROD_DSG_REFSW_Devel/1 10/14/08 7:40p anilmm |
|---|
| 60 | * PR47842: BER calculation software implementation |
|---|
| 61 | * |
|---|
| 62 | * 14 1/31/08 5:15p jgarrett |
|---|
| 63 | * PR 39180: Adding ofdm tuning |
|---|
| 64 | * |
|---|
| 65 | * 13 2/22/07 4:41p vsilyaev |
|---|
| 66 | * PR 26335: Added diseqc_message for the diseq configuration |
|---|
| 67 | * |
|---|
| 68 | * 12 1/30/07 10:32a vsilyaev |
|---|
| 69 | * PR26409: add btuner_qam_us_mode_docsis |
|---|
| 70 | * |
|---|
| 71 | * PROD_TRINITY_REFSW_Devel/1 1/29/07 6:35p haisongw |
|---|
| 72 | * PR26409: add btuner_qam_us_mode_docsis |
|---|
| 73 | * |
|---|
| 74 | * 11 10/5/06 1:54p dlwin |
|---|
| 75 | * PR 24762: add two moreAnnex mode for CableCARD OOB DS |
|---|
| 76 | * |
|---|
| 77 | * 8 9/11/06 12:11p dlwin |
|---|
| 78 | * PR 24033: Updated with additional mode of operation for Qam upstream |
|---|
| 79 | * |
|---|
| 80 | * 7 8/31/06 2:44p dlwin |
|---|
| 81 | * PR 24033: Create new public API for Qam Upstream |
|---|
| 82 | * |
|---|
| 83 | * 6 5/3/06 10:02a erickson |
|---|
| 84 | * PR19790: added LDPC support |
|---|
| 85 | * |
|---|
| 86 | * 5 5/20/05 8:33a dlwin |
|---|
| 87 | * PR 15503: Add support getting Block correctable/uncorrectable and |
|---|
| 88 | * corrected error count. |
|---|
| 89 | * |
|---|
| 90 | * 4 4/8/05 1:43p erickson |
|---|
| 91 | * PR14721: added lock_callback and wait_for_lock to all digital tune |
|---|
| 92 | * params |
|---|
| 93 | * |
|---|
| 94 | * 3 3/28/05 1:58p erickson |
|---|
| 95 | * PR14613: updated notes on linein id |
|---|
| 96 | * |
|---|
| 97 | * 2 2/12/05 11:07a dlwin |
|---|
| 98 | * Merge down for release 2005_REFSW_MERGETOMAIN: |
|---|
| 99 | * |
|---|
| 100 | * Irvine_BSEAVSW_Devel/44 2/10/05 3:15p erickson |
|---|
| 101 | * PR13823: updated comments |
|---|
| 102 | * |
|---|
| 103 | * Irvine_BSEAVSW_Devel/43 11/4/04 2:29p erickson |
|---|
| 104 | * PR13169: updated docs on int/ext_agc_level to normalize along all |
|---|
| 105 | * platforms |
|---|
| 106 | * |
|---|
| 107 | * Irvine_BSEAVSW_Devel/42 10/25/04 11:52a vsilyaev |
|---|
| 108 | * PR 12576: Added colorspace for analog video. |
|---|
| 109 | * |
|---|
| 110 | * Irvine_BSEAVSW_Devel/41 9/16/04 3:36p erickson |
|---|
| 111 | * PR11081: added box_detect and deinterlacer to bdecode_window_settings |
|---|
| 112 | * and comb_filter to banalog_params |
|---|
| 113 | * |
|---|
| 114 | * Irvine_BSEAVSW_Devel/40 7/15/04 5:13p erickson |
|---|
| 115 | * PR11682: added btuner_tune_oob |
|---|
| 116 | * |
|---|
| 117 | * Irvine_BSEAVSW_Devel/39 7/14/04 3:14p erickson |
|---|
| 118 | * PR11682: added notes on btuner ids |
|---|
| 119 | * |
|---|
| 120 | * Irvine_BSEAVSW_Devel/38 7/14/04 2:36p erickson |
|---|
| 121 | * PR11682: added QAM OOB api support |
|---|
| 122 | * |
|---|
| 123 | * Irvine_BSEAVSW_Devel/37 2/3/04 8:08p vsilyaev |
|---|
| 124 | * PR 9465: changed if_freq in VSB parameters to be unsigned. |
|---|
| 125 | * |
|---|
| 126 | * Irvine_BSEAVSW_Devel/36 1/26/04 8:56p vsilyaev |
|---|
| 127 | * PR 9465: Added VSB support |
|---|
| 128 | * |
|---|
| 129 | * Irvine_BSEAVSW_Devel/35 12/19/03 4:38p vsilyaev |
|---|
| 130 | * PR 8850: Fixing build of legacy code after merge. |
|---|
| 131 | * |
|---|
| 132 | * Irvine_BSEAVSW_Devel/Irvine_BSEAVSW_Devel_7038/1 12/4/03 1:27p erickson |
|---|
| 133 | * PR8850: initial Brutus support on 7038 |
|---|
| 134 | * |
|---|
| 135 | * Irvine_BSEAVSW_Devel/33 11/20/03 10:44a erickson |
|---|
| 136 | * PR8582: converted BER to be log10 of ber_estimate. This gives the |
|---|
| 137 | * correct range of information. |
|---|
| 138 | * |
|---|
| 139 | * Irvine_BSEAVSW_Devel/32 11/20/03 9:38a erickson |
|---|
| 140 | * PR8582: fixed ber_estimate |
|---|
| 141 | * |
|---|
| 142 | * Irvine_BSEAVSW_Devel/31 11/19/03 4:57p erickson |
|---|
| 143 | * PR8583: resolved some naming issues, especially bvideo_format |
|---|
| 144 | * |
|---|
| 145 | * Irvine_BSEAVSW_Devel/30 11/7/03 4:28p erickson |
|---|
| 146 | * PR8583: removing, fixing or implementing TODO's |
|---|
| 147 | * |
|---|
| 148 | * Irvine_BSEAVSW_Devel/29 11/7/03 1:32a erickson |
|---|
| 149 | * PR8582: changed qam ds status structure in order to get FEC corr/uncorr |
|---|
| 150 | * values |
|---|
| 151 | * |
|---|
| 152 | * Irvine_BSEAVSW_Devel/28 11/4/03 2:42p erickson |
|---|
| 153 | * documentation changes |
|---|
| 154 | * |
|---|
| 155 | * Irvine_BSEAVSW_Devel/27 11/3/03 12:51p erickson |
|---|
| 156 | * normalized constellation for 73xx. Need to test on other platforms. |
|---|
| 157 | * |
|---|
| 158 | * Irvine_BSEAVSW_Devel/26 10/31/03 12:17p erickson |
|---|
| 159 | * added some comments |
|---|
| 160 | * |
|---|
| 161 | * Irvine_BSEAVSW_Devel/25 10/31/03 11:58a erickson |
|---|
| 162 | * settop api changes after internal review |
|---|
| 163 | * |
|---|
| 164 | * Irvine_BSEAVSW_Devel/24 10/28/03 11:26a erickson |
|---|
| 165 | * settop api reworks after internal design view |
|---|
| 166 | * |
|---|
| 167 | * Irvine_BSEAVSW_Devel/23 10/22/03 11:49a erickson |
|---|
| 168 | * settop api pass-through type conversion |
|---|
| 169 | * |
|---|
| 170 | * Irvine_BSEAVSW_Devel/22 10/22/03 11:22a erickson |
|---|
| 171 | * settop api pass-through type conversion |
|---|
| 172 | * |
|---|
| 173 | * Irvine_BSEAVSW_Devel/21 10/1/03 10:06a erickson |
|---|
| 174 | * fixed docjet errors |
|---|
| 175 | * |
|---|
| 176 | * Irvine_BSEAVSW_Devel/20 9/30/03 1:13a erickson |
|---|
| 177 | * updated docjet documentation |
|---|
| 178 | * |
|---|
| 179 | * Irvine_BSEAVSW_Devel/19 9/17/03 5:03p erickson |
|---|
| 180 | * updated documentation for DocJet |
|---|
| 181 | * |
|---|
| 182 | * Irvine_BSEAVSW_Devel/18 8/22/03 1:22p erickson |
|---|
| 183 | * fixed comment |
|---|
| 184 | * |
|---|
| 185 | * Irvine_BSEAVSW_Devel/17 8/21/03 4:30p erickson |
|---|
| 186 | * added analog status for video_present |
|---|
| 187 | * |
|---|
| 188 | * Irvine_BSEAVSW_Devel/16 8/21/03 9:36a erickson |
|---|
| 189 | * implemented get_soft_decisions and qam status |
|---|
| 190 | * |
|---|
| 191 | * Irvine_BSEAVSW_Devel/15 8/19/03 11:54a erickson |
|---|
| 192 | * initial brutus bringup in progress |
|---|
| 193 | * |
|---|
| 194 | * Irvine_BSEAVSW_Devel/14 8/18/03 11:02a erickson |
|---|
| 195 | * initial bringup for brutus 7320, still in progress |
|---|
| 196 | * |
|---|
| 197 | * Irvine_BSEAVSW_Devel/13 8/12/03 9:43a erickson |
|---|
| 198 | * changes after pre-review meeting |
|---|
| 199 | * |
|---|
| 200 | * Irvine_BSEAVSW_Devel/12 7/30/03 2:35p vsilyaev |
|---|
| 201 | * Moved some header files to the bsettop_types.h |
|---|
| 202 | * |
|---|
| 203 | * Irvine_BSEAVSW_Devel/11 7/30/03 2:08p erickson |
|---|
| 204 | * removed all return value comments because we're standardized and they |
|---|
| 205 | * add nothing |
|---|
| 206 | * |
|---|
| 207 | * Irvine_BSEAVSW_Devel/10 7/29/03 6:03p erickson |
|---|
| 208 | * more rework |
|---|
| 209 | * |
|---|
| 210 | * Irvine_BSEAVSW_Devel/9 7/28/03 4:43p erickson |
|---|
| 211 | * more comment work |
|---|
| 212 | * |
|---|
| 213 | * Irvine_BSEAVSW_Devel/8 7/25/03 8:14p vsilyaev |
|---|
| 214 | * Removed _impl suffix. |
|---|
| 215 | * |
|---|
| 216 | * Irvine_BSEAVSW_Devel/7 7/25/03 4:22p erickson |
|---|
| 217 | * in the middle of rework, does not compile |
|---|
| 218 | * |
|---|
| 219 | * Irvine_BSEAVSW_Devel/6 7/22/03 7:09p vsilyaev |
|---|
| 220 | * Renamed qpsk to sds. |
|---|
| 221 | * |
|---|
| 222 | * Irvine_BSEAVSW_Devel/5 7/9/03 5:19p erickson |
|---|
| 223 | * rework for new bband_t model |
|---|
| 224 | * |
|---|
| 225 | * Irvine_BSEAVSW_Devel/4 6/24/03 5:29p vsilyaev |
|---|
| 226 | * Renamed btumer_MPEG to bsettop_MPEG. |
|---|
| 227 | * |
|---|
| 228 | * Irvine_BSEAVSW_Devel/3 6/20/03 5:56p vsilyaev |
|---|
| 229 | * Added field to store 'special' pids. |
|---|
| 230 | * |
|---|
| 231 | * Irvine_BSEAVSW_Devel/2 6/16/03 8:18p vsilyaev |
|---|
| 232 | * Added pseudo for baseband tuner. |
|---|
| 233 | * |
|---|
| 234 | * Irvine_BSEAVSW_Devel/1 6/13/03 3:08p vsilyaev |
|---|
| 235 | * SetTop reference API. |
|---|
| 236 | * |
|---|
| 237 | * |
|---|
| 238 | ***************************************************************************/ |
|---|
| 239 | #ifndef BSETTOP_TUNER_H__ |
|---|
| 240 | #define BSETTOP_TUNER_H__ |
|---|
| 241 | |
|---|
| 242 | #ifdef __cplusplus |
|---|
| 243 | extern "C" |
|---|
| 244 | { |
|---|
| 245 | #endif |
|---|
| 246 | |
|---|
| 247 | /*=************* |
|---|
| 248 | The tuner inteface represents the front-end of the set-top box. |
|---|
| 249 | For digital signals, the tuner API performs both tuning and |
|---|
| 250 | acquisition functions. |
|---|
| 251 | |
|---|
| 252 | If you tune an analog signal, you will get a bstream_t handle which you can decode or encode. |
|---|
| 253 | |
|---|
| 254 | If you tune (and acquire) a digital signal, you will get a bband_t handle which you can scan |
|---|
| 255 | for message data (bmessage_t) or combine with already-known mpeg data form a digital stream. See bstream_open for details. |
|---|
| 256 | |
|---|
| 257 | ****************/ |
|---|
| 258 | |
|---|
| 259 | /* |
|---|
| 260 | Summary: |
|---|
| 261 | Open a tuner. |
|---|
| 262 | |
|---|
| 263 | Description: |
|---|
| 264 | On most platforms, the tuner_id is simply an index of the tuners. |
|---|
| 265 | |
|---|
| 266 | On platforms with more frontend options (e.g. 97038), please see bsettop_ids.txt |
|---|
| 267 | for documentation on special numbers. |
|---|
| 268 | */ |
|---|
| 269 | btuner_t btuner_open( |
|---|
| 270 | bobject_t tuner_id /* handle used to identify a particular tuner */ |
|---|
| 271 | ); |
|---|
| 272 | |
|---|
| 273 | /* |
|---|
| 274 | Summary: |
|---|
| 275 | Close a tuner. |
|---|
| 276 | */ |
|---|
| 277 | void btuner_close( |
|---|
| 278 | btuner_t tuner /* handle returned by btuner_open */ |
|---|
| 279 | ); |
|---|
| 280 | |
|---|
| 281 | |
|---|
| 282 | /* |
|---|
| 283 | Summary: |
|---|
| 284 | QAM annex. |
|---|
| 285 | */ |
|---|
| 286 | typedef enum btuner_qam_annex { |
|---|
| 287 | btuner_qam_annex_a, /* Used for PAL */ |
|---|
| 288 | btuner_qam_annex_b, /* Used for NTSC */ |
|---|
| 289 | btuner_qam_oob_annex_a, /* legacy OOB mode for DAVIC support. When this mode is selected, |
|---|
| 290 | btuner_qam_mode is ignored. */ |
|---|
| 291 | btuner_qam_oob_dvs167 = btuner_qam_oob_annex_a,/* annex A is also called DVS167*/ |
|---|
| 292 | btuner_qam_oob_dvs178, /* legacy OOB mode for DVS178. When this mode is selected, |
|---|
| 293 | btuner_qam_mode is ignored. */ |
|---|
| 294 | btuner_qam_oob_pod_annex_a, /* CableCARD OOB mode for DAVIC support. When this mode is selected, |
|---|
| 295 | btuner_qam_mode is ignored. */ |
|---|
| 296 | btuner_qam_oob_pod_dvs167 = btuner_qam_oob_pod_annex_a,/* annex A is also called DVS167*/ |
|---|
| 297 | btuner_qam_oob_pod_dvs178 /* CableCARD OOB mode for DVS178. When this mode is selected, |
|---|
| 298 | btuner_qam_mode is ignored. */ |
|---|
| 299 | } btuner_qam_annex; |
|---|
| 300 | |
|---|
| 301 | /* |
|---|
| 302 | Summary: |
|---|
| 303 | Supported QAM modes. |
|---|
| 304 | */ |
|---|
| 305 | typedef enum btuner_qam_mode { |
|---|
| 306 | btuner_qam_mode_16 = 16, |
|---|
| 307 | btuner_qam_mode_32 = 32, |
|---|
| 308 | btuner_qam_mode_64 = 64, |
|---|
| 309 | btuner_qam_mode_128 = 128, |
|---|
| 310 | btuner_qam_mode_256 = 256, |
|---|
| 311 | btuner_qam_mode_1024 = 1024 |
|---|
| 312 | } btuner_qam_mode; |
|---|
| 313 | |
|---|
| 314 | /* |
|---|
| 315 | Summary: |
|---|
| 316 | Colorspace for analog video |
|---|
| 317 | */ |
|---|
| 318 | typedef enum btuner_analog_colorspace { |
|---|
| 319 | btuner_analog_colorspace_rgb, |
|---|
| 320 | btuner_analog_colorspace_yprpb |
|---|
| 321 | } btuner_analog_colorspace; |
|---|
| 322 | |
|---|
| 323 | /* |
|---|
| 324 | Summary: |
|---|
| 325 | spectrum setting for QAM |
|---|
| 326 | */ |
|---|
| 327 | typedef enum btuner_qam_spectral_inversion { |
|---|
| 328 | btuner_qam_spectral_inversion_auto, |
|---|
| 329 | btuner_qam_spectral_inversion_noinverted, |
|---|
| 330 | btuner_qam_spectral_inversion_inverted |
|---|
| 331 | } btuner_qam_spectral_inversion; |
|---|
| 332 | |
|---|
| 333 | /*************************************************************************** |
|---|
| 334 | Summary: |
|---|
| 335 | Enumeration for receiver bandwidth |
|---|
| 336 | ****************************************************************************/ |
|---|
| 337 | typedef enum btuner_qam_bandwidth |
|---|
| 338 | { |
|---|
| 339 | btuner_qam_bandwidth_5Mhz, |
|---|
| 340 | btuner_qam_bandwidth_6Mhz, |
|---|
| 341 | btuner_qam_bandwidth_7Mhz, |
|---|
| 342 | btuner_qam_bandwidth_8Mhz, |
|---|
| 343 | btuner_qam_bandwidth_Max |
|---|
| 344 | } btuner_qam_bandwidth; |
|---|
| 345 | |
|---|
| 346 | |
|---|
| 347 | /* |
|---|
| 348 | Summary: |
|---|
| 349 | QAM parameters to be passed to btuner_tune_qam(). |
|---|
| 350 | */ |
|---|
| 351 | typedef struct btuner_qam_params { |
|---|
| 352 | btuner_qam_mode mode; |
|---|
| 353 | unsigned symbol_rate; /* Baud */ |
|---|
| 354 | btuner_qam_annex annex; |
|---|
| 355 | btuner_qam_spectral_inversion spectrum; |
|---|
| 356 | bool wait_for_lock; |
|---|
| 357 | bsettop_callback lock_callback; /* called when the tuner comes in or out |
|---|
| 358 | of lock. call btuner_get_qam_status to determine |
|---|
| 359 | the state. */ |
|---|
| 360 | void *callback_context; /* passed as parameter to lock_callback */ |
|---|
| 361 | bool auto_acquire; /* True = Enable, False = Disable. */ |
|---|
| 362 | btuner_qam_bandwidth bandwidth; /* Tuner frequency bandwidth. */ |
|---|
| 363 | bool enable_power_measurement; /* True = enables calculation of downstream channel power for some frontends like 31xx. For others it is always enabled. False = Disable. */ |
|---|
| 364 | } btuner_qam_params; |
|---|
| 365 | |
|---|
| 366 | /* |
|---|
| 367 | Summary: |
|---|
| 368 | Receiver bandwidth |
|---|
| 369 | */ |
|---|
| 370 | typedef enum btuner_ofdm_bandwidth |
|---|
| 371 | { |
|---|
| 372 | btuner_ofdm_bandwidth_5Mhz=5, /* Selects 5 MHz */ |
|---|
| 373 | btuner_ofdm_bandwidth_6Mhz, /* Selects 6 MHz */ |
|---|
| 374 | btuner_ofdm_bandwidth_7Mhz, /* Selects 7 MHz */ |
|---|
| 375 | btuner_ofdm_bandwidth_8Mhz /* Selects 8 MHz */ |
|---|
| 376 | }btuner_ofdm_bandwidth; |
|---|
| 377 | |
|---|
| 378 | /* |
|---|
| 379 | Summary: |
|---|
| 380 | Receiver CCI (CoChannel Interference Filter) Mode |
|---|
| 381 | */ |
|---|
| 382 | typedef enum btuner_ofdm_cci_mode |
|---|
| 383 | { |
|---|
| 384 | btuner_ofdm_cci_mode_none, /* No CCI selected */ |
|---|
| 385 | btuner_ofdm_cci_mode_auto /* Auto Selection */ |
|---|
| 386 | }btuner_ofdm_cci_mode; |
|---|
| 387 | /* |
|---|
| 388 | Summary: |
|---|
| 389 | |
|---|
| 390 | DVB-T can hierarchically encode streams. A low-priority stream can |
|---|
| 391 | be embedded within a high priority stream. Receivers with good reception |
|---|
| 392 | conditions may be able to receive both streams, but receivers with poor |
|---|
| 393 | reception conditions may only be able to receive the high priority stream. |
|---|
| 394 | |
|---|
| 395 | */ |
|---|
| 396 | typedef enum btuner_ofdm_priority |
|---|
| 397 | { |
|---|
| 398 | btuner_ofdm_priority_high, |
|---|
| 399 | btuner_ofdm_priority_low |
|---|
| 400 | }btuner_ofdm_priority; |
|---|
| 401 | |
|---|
| 402 | /* |
|---|
| 403 | Summary: |
|---|
| 404 | |
|---|
| 405 | ISDB-T is a kind of OFDM modulation technology. It is needed to differentiate |
|---|
| 406 | ISDB-T and DVB-T in the channel map. |
|---|
| 407 | |
|---|
| 408 | */ |
|---|
| 409 | typedef enum btuner_ofdm_mode |
|---|
| 410 | { |
|---|
| 411 | btuner_ofdm_mode_dvbt, |
|---|
| 412 | btuner_ofdm_mode_dvbt2, |
|---|
| 413 | btuner_ofdm_mode_isdbt |
|---|
| 414 | }btuner_ofdm_mode; |
|---|
| 415 | |
|---|
| 416 | |
|---|
| 417 | /* Summary: |
|---|
| 418 | OFDM parameters to be passed to btuner_tune_ofdm(). |
|---|
| 419 | */ |
|---|
| 420 | typedef struct btuner_ofdm_params { |
|---|
| 421 | btuner_ofdm_bandwidth bandwidth; /* Signal Bandwidth */ |
|---|
| 422 | btuner_ofdm_cci_mode cci_mode; /* CCI Mode */ |
|---|
| 423 | btuner_ofdm_priority priority; /* priority */ |
|---|
| 424 | btuner_ofdm_mode mode; /* OFDM mode: dvbt or isdbt */ |
|---|
| 425 | bool wait_for_lock; |
|---|
| 426 | bsettop_callback lock_callback; /* called when the tuner comes in or out |
|---|
| 427 | of lock. call btuner_get_qam_status to determine |
|---|
| 428 | the state. */ |
|---|
| 429 | void *callback_context; /* passed as parameter to lock_callback */ |
|---|
| 430 | }btuner_ofdm_params; |
|---|
| 431 | |
|---|
| 432 | /* |
|---|
| 433 | Summary: |
|---|
| 434 | Required to initialize QAM parameters to defaults |
|---|
| 435 | */ |
|---|
| 436 | void btuner_qam_params_init( |
|---|
| 437 | btuner_qam_params *qam, /* [out] */ |
|---|
| 438 | btuner_t tuner /* required for possible resource-dependent defaults */ |
|---|
| 439 | ); |
|---|
| 440 | |
|---|
| 441 | /* |
|---|
| 442 | Summary: |
|---|
| 443 | Required to initialize DVB-T/OFDM demod parameters to defaults |
|---|
| 444 | */ |
|---|
| 445 | void btuner_ofdm_params_init( |
|---|
| 446 | btuner_ofdm_params *ofdm, /* [out] */ |
|---|
| 447 | btuner_t tuner /* required for possible resource-dependent defaults */ |
|---|
| 448 | ); |
|---|
| 449 | |
|---|
| 450 | /* |
|---|
| 451 | Summary: |
|---|
| 452 | Analog parameters passed to btuner_tune_rf() and btuner_tune_linein(). |
|---|
| 453 | */ |
|---|
| 454 | typedef struct btuner_analog_params { |
|---|
| 455 | bvideo_format video_format; /* format of the source video */ |
|---|
| 456 | unsigned audio_rate; /* sample rate bits for PCM audio in units of |
|---|
| 457 | bits per second. 32000, 44100, 48000 supported. */ |
|---|
| 458 | boutput_rf_btsc_mode btsc_mode; /* BTSC decoder selection. This doesn't affect |
|---|
| 459 | pass-through. It selects what program will be |
|---|
| 460 | converted to PCM for encoding or output from |
|---|
| 461 | the DACs. */ |
|---|
| 462 | bool comb_filter; /* If true, the 3d comb filter is allowed to be |
|---|
| 463 | used if available and appropriate. */ |
|---|
| 464 | btuner_analog_colorspace colorspace; /* input colorspace, applicable only for |
|---|
| 465 | certain type of inputs, e.g. component */ |
|---|
| 466 | } btuner_analog_params; |
|---|
| 467 | |
|---|
| 468 | /* |
|---|
| 469 | Summary: |
|---|
| 470 | Required to initialize btuner_analog_params to defaults. |
|---|
| 471 | */ |
|---|
| 472 | void btuner_analog_params_init( |
|---|
| 473 | btuner_analog_params *analog, /* [out] */ |
|---|
| 474 | btuner_t tuner /* required for possible resource-dependent defaults */ |
|---|
| 475 | ); |
|---|
| 476 | |
|---|
| 477 | /* |
|---|
| 478 | Summary: |
|---|
| 479 | Operation Mode for OutOfBand upstream |
|---|
| 480 | */ |
|---|
| 481 | typedef enum btuner_qam_us_mode { |
|---|
| 482 | btuner_qam_us_mode_annexa,/* Upstream mode for Annex A*/ |
|---|
| 483 | btuner_qam_us_mode_dvs167 = btuner_qam_us_mode_annexa,/* Annex A is also called DVS 167*/ |
|---|
| 484 | btuner_qam_us_mode_dvs178,/* Upstream mode for DVS178*/ |
|---|
| 485 | btuner_qam_us_mode_pod_annexa,/* Upstream mode for CableCARD Annex A*/ |
|---|
| 486 | btuner_qam_us_mode_pod_dvs167 = btuner_qam_us_mode_pod_annexa,/* Annex A is also called DVS 167*/ |
|---|
| 487 | btuner_qam_us_mode_pod_dvs178, /* Upstream mode for CableCARD DVS178*/ |
|---|
| 488 | btuner_qam_us_mode_docsis /* Upstream mode for Docsis*/ |
|---|
| 489 | } btuner_qam_us_mode; |
|---|
| 490 | |
|---|
| 491 | /* |
|---|
| 492 | Summary: |
|---|
| 493 | QPSK parameters to be passed to btuner_tune_us(). |
|---|
| 494 | */ |
|---|
| 495 | typedef struct btuner_qam_us_params { |
|---|
| 496 | btuner_qam_us_mode mode; /* Operation Mode*/ |
|---|
| 497 | unsigned symbol_rate; /* Baud */ |
|---|
| 498 | unsigned power_level; /* Power Level in dBmV */ |
|---|
| 499 | } btuner_qam_us_params; |
|---|
| 500 | |
|---|
| 501 | /* |
|---|
| 502 | Summary: |
|---|
| 503 | Required to initialize Upstream parameters to defaults |
|---|
| 504 | */ |
|---|
| 505 | void btuner_qam_us_params_init( |
|---|
| 506 | btuner_qam_us_params *us_param, /* [out] */ |
|---|
| 507 | btuner_t tuner /* required for possible resource-dependent defaults */ |
|---|
| 508 | ); |
|---|
| 509 | |
|---|
| 510 | /* |
|---|
| 511 | Summary: |
|---|
| 512 | DISEQC polarity for btuner_sds_params. |
|---|
| 513 | */ |
|---|
| 514 | typedef enum btuner_sds_diseqc_polarity { |
|---|
| 515 | btuner_sds_diseqc_polarity_13v = 13, |
|---|
| 516 | btuner_sds_diseqc_polarity_18v = 18 |
|---|
| 517 | } btuner_sds_diseqc_polarity; |
|---|
| 518 | |
|---|
| 519 | /* |
|---|
| 520 | Summary: |
|---|
| 521 | SDS acquisition mode. |
|---|
| 522 | */ |
|---|
| 523 | typedef enum btuner_sds_mode { |
|---|
| 524 | btuner_sds_mode_qpsk_dvb, |
|---|
| 525 | btuner_sds_mode_qpsk_dss, |
|---|
| 526 | btuner_sds_mode_qpsk_dcii, |
|---|
| 527 | btuner_sds_mode_qpsk_turbo, |
|---|
| 528 | btuner_sds_mode_8psk_turbo, |
|---|
| 529 | btuner_sds_mode_turbo_qpsk=btuner_sds_mode_qpsk_turbo, |
|---|
| 530 | btuner_sds_mode_turbo_8psk=btuner_sds_mode_8psk_turbo, |
|---|
| 531 | btuner_sds_mode_turbo, |
|---|
| 532 | btuner_sds_mode_qpsk_ldpc, |
|---|
| 533 | btuner_sds_mode_8psk_ldpc, |
|---|
| 534 | btuner_sds_mode_ldpc |
|---|
| 535 | } btuner_sds_mode; |
|---|
| 536 | |
|---|
| 537 | /* |
|---|
| 538 | Summary: |
|---|
| 539 | SDS spectral inversion mode. |
|---|
| 540 | */ |
|---|
| 541 | typedef enum btuner_sds_spectral_inversion { |
|---|
| 542 | btuner_sds_spectral_inversion_scan, /* Scan the stream for the value */ |
|---|
| 543 | btuner_sds_spectral_inversion_normal, |
|---|
| 544 | btuner_sds_spectral_inversion_i, |
|---|
| 545 | btuner_sds_spectral_inversion_q |
|---|
| 546 | } btuner_sds_spectral_inversion; |
|---|
| 547 | |
|---|
| 548 | /* |
|---|
| 549 | Summary: |
|---|
| 550 | Code rate of the sds stream. |
|---|
| 551 | */ |
|---|
| 552 | typedef struct btuner_sds_coderate { |
|---|
| 553 | unsigned num; /* numerator of the code rate fraction. |
|---|
| 554 | If 0, the code rate is scanned. */ |
|---|
| 555 | unsigned denom; /* denominator of the code rate fraction. |
|---|
| 556 | If 0, the code rate is scanned. */ |
|---|
| 557 | unsigned bits_per_symbol; /* x1000. If 0, it uses the default. |
|---|
| 558 | For instance 2050 is 2.05. */ |
|---|
| 559 | } btuner_sds_coderate; |
|---|
| 560 | |
|---|
| 561 | /* |
|---|
| 562 | Summary: |
|---|
| 563 | Satellite downstream parameters to be passed to btuner_tune_sds |
|---|
| 564 | */ |
|---|
| 565 | typedef struct btuner_sds_params { |
|---|
| 566 | btuner_sds_mode mode; |
|---|
| 567 | btuner_sds_coderate coderate; |
|---|
| 568 | unsigned symbol_rate; /* Baud */ |
|---|
| 569 | unsigned carrier_offset; /* Hz */ |
|---|
| 570 | btuner_sds_spectral_inversion spinv; |
|---|
| 571 | unsigned search_range; /* Hz */ |
|---|
| 572 | bool diseqc_tone; /* on/off */ |
|---|
| 573 | bool ldpc_pilot; /* This option applies only for LDPC modes (low density parity check) */ |
|---|
| 574 | bool ldpc_pilot_pll; /* This option applies only for LDPC modes if ldpc_pilot is true */ |
|---|
| 575 | btuner_sds_diseqc_polarity diseqc_polarity; |
|---|
| 576 | |
|---|
| 577 | bool wait_for_lock; /* if true, the tune function will not return until locked or until a certain timeout */ |
|---|
| 578 | bsettop_callback lock_callback; /* called when the tuner comes in or out |
|---|
| 579 | of lock. call btuner_get_sds_status to determine |
|---|
| 580 | the state. */ |
|---|
| 581 | void *callback_context; /* passed as parameter to lock_callback */ |
|---|
| 582 | |
|---|
| 583 | /* NOTE: This diseqc API is under development. It may change. */ |
|---|
| 584 | struct { |
|---|
| 585 | bool enabled; /* if true, send a diseqc message */ |
|---|
| 586 | bool tone_burst; |
|---|
| 587 | uint8_t diseqc_sat_number; |
|---|
| 588 | } diseqc_message; |
|---|
| 589 | } btuner_sds_params; |
|---|
| 590 | |
|---|
| 591 | /* |
|---|
| 592 | Summary: |
|---|
| 593 | Required to initialize SDS parameters to defaults |
|---|
| 594 | */ |
|---|
| 595 | void btuner_sds_params_init( |
|---|
| 596 | btuner_sds_params *sds, /* [out] */ |
|---|
| 597 | btuner_t tuner /* required for possible resource-dependent defaults */ |
|---|
| 598 | ); |
|---|
| 599 | |
|---|
| 600 | |
|---|
| 601 | typedef enum btuner_vsb_mode { |
|---|
| 602 | btuner_vsb_mode_vsb8=8, /* 8-VSB */ |
|---|
| 603 | btuner_vsb_mode_vsb16=16 /* 16-VSB */ |
|---|
| 604 | } btuner_vsb_mode; |
|---|
| 605 | |
|---|
| 606 | typedef struct btuner_vsb_params { |
|---|
| 607 | btuner_vsb_mode mode; |
|---|
| 608 | unsigned if_freq; /* IF Frequency in Hz */ |
|---|
| 609 | unsigned symbol_rate; /* Baud */ |
|---|
| 610 | signed symbol_rate_offset; /* Baud */ |
|---|
| 611 | signed if_freq_offset; /* IF Frequency offset in Hz */ |
|---|
| 612 | signed ntsc_offset; /* Hz */ |
|---|
| 613 | |
|---|
| 614 | bool wait_for_lock; |
|---|
| 615 | bsettop_callback lock_callback; /* called when the tuner comes in or out |
|---|
| 616 | of lock. call btuner_get_vsb_status to determine |
|---|
| 617 | the state. */ |
|---|
| 618 | void *callback_context; /* passed as parameter to lock_callback */ |
|---|
| 619 | } btuner_vsb_params; |
|---|
| 620 | |
|---|
| 621 | /* |
|---|
| 622 | Summary: |
|---|
| 623 | Required to initialize VSB parameters to defaults |
|---|
| 624 | */ |
|---|
| 625 | void btuner_vsb_params_init( |
|---|
| 626 | btuner_vsb_params *vsb, /* [out] */ |
|---|
| 627 | btuner_t tuner /* required for possible resource-dependent defaults */ |
|---|
| 628 | ); |
|---|
| 629 | |
|---|
| 630 | |
|---|
| 631 | /* |
|---|
| 632 | Summary: |
|---|
| 633 | Open a line-in object. |
|---|
| 634 | |
|---|
| 635 | Description: |
|---|
| 636 | The linein_id has a platform specific meaning. The number of lineinputs are |
|---|
| 637 | enumerated in bsettop_ids.txt. |
|---|
| 638 | */ |
|---|
| 639 | btuner_linein_t btuner_linein_open(bobject_t linein_id); |
|---|
| 640 | |
|---|
| 641 | /* |
|---|
| 642 | Summary: |
|---|
| 643 | Tune and acquire QAM downstream band. |
|---|
| 644 | */ |
|---|
| 645 | bband_t btuner_tune_qam( |
|---|
| 646 | btuner_t tuner, |
|---|
| 647 | unsigned freq, /* RF center frequency in Hz */ |
|---|
| 648 | const btuner_qam_params *params /* parameters needed to tune and acquire */ |
|---|
| 649 | ); |
|---|
| 650 | |
|---|
| 651 | /* |
|---|
| 652 | Summary: |
|---|
| 653 | Tune and acquire out-of-band stream. |
|---|
| 654 | |
|---|
| 655 | Description: |
|---|
| 656 | We re-use the btuner_qam_params structure, but the btuner_qam_mode is ignored. |
|---|
| 657 | This returns b_ok if lock was obtained. |
|---|
| 658 | */ |
|---|
| 659 | bresult |
|---|
| 660 | btuner_tune_oob( |
|---|
| 661 | btuner_t tuner, |
|---|
| 662 | unsigned freq, /* RF center frequency in Hz */ |
|---|
| 663 | const btuner_qam_params *params /* parameters needed to tune and acquire */ |
|---|
| 664 | ); |
|---|
| 665 | |
|---|
| 666 | |
|---|
| 667 | /* |
|---|
| 668 | Summary: |
|---|
| 669 | Tune QAM/QPSK Upstream. |
|---|
| 670 | */ |
|---|
| 671 | bresult |
|---|
| 672 | btuner_tune_qam_us( |
|---|
| 673 | btuner_t tuner, |
|---|
| 674 | unsigned freq, /* RF center frequency in Hz */ |
|---|
| 675 | const btuner_qam_us_params *params /* parameters needed to tune */ |
|---|
| 676 | ); |
|---|
| 677 | |
|---|
| 678 | /* |
|---|
| 679 | Summary: |
|---|
| 680 | Tune and acquire a satellite downstream band |
|---|
| 681 | */ |
|---|
| 682 | bband_t btuner_tune_sds( |
|---|
| 683 | btuner_t tuner, |
|---|
| 684 | unsigned freq, /* RF center frequency in Hz */ |
|---|
| 685 | const btuner_sds_params *params /* parameters needed to tune and acquire */ |
|---|
| 686 | ); |
|---|
| 687 | |
|---|
| 688 | /* |
|---|
| 689 | Summary: |
|---|
| 690 | Tune and acquire a VSB downstream band |
|---|
| 691 | */ |
|---|
| 692 | bband_t btuner_tune_vsb( |
|---|
| 693 | btuner_t tuner, |
|---|
| 694 | unsigned freq, /* RF center frequency in Hz */ |
|---|
| 695 | const btuner_vsb_params *params /* parameters needed to tune and acquire */ |
|---|
| 696 | ); |
|---|
| 697 | |
|---|
| 698 | /* |
|---|
| 699 | Summary: |
|---|
| 700 | Tune and acquire a BVD-T downstream band |
|---|
| 701 | */ |
|---|
| 702 | bband_t |
|---|
| 703 | btuner_tune_ofdm( |
|---|
| 704 | btuner_t tuner, |
|---|
| 705 | unsigned freq, /* RF center frequency in Hz */ |
|---|
| 706 | const btuner_ofdm_params* params /* parameters needed to tune and acquire */ |
|---|
| 707 | ); |
|---|
| 708 | |
|---|
| 709 | |
|---|
| 710 | /* |
|---|
| 711 | Summary: |
|---|
| 712 | Tune rf (analog cable). |
|---|
| 713 | */ |
|---|
| 714 | bstream_t btuner_tune_rf( |
|---|
| 715 | btuner_t tuner, |
|---|
| 716 | unsigned carrierfreq, /* RF frequency for the tuner in Hz */ |
|---|
| 717 | const btuner_analog_params *params /* parameters for the analog video source */ |
|---|
| 718 | ); |
|---|
| 719 | |
|---|
| 720 | /* |
|---|
| 721 | Summary: |
|---|
| 722 | Tune line-in |
|---|
| 723 | */ |
|---|
| 724 | bstream_t btuner_tune_linein( |
|---|
| 725 | btuner_t tuner, |
|---|
| 726 | btuner_linein_t linein, /* which linein to select */ |
|---|
| 727 | const btuner_analog_params *params /* parameters for the analog video source */ |
|---|
| 728 | ); |
|---|
| 729 | |
|---|
| 730 | /* |
|---|
| 731 | Summary: |
|---|
| 732 | Status information returned by btuner_get_analog_status(). |
|---|
| 733 | */ |
|---|
| 734 | typedef struct btuner_analog_status { |
|---|
| 735 | bool video_present; |
|---|
| 736 | } btuner_analog_status; |
|---|
| 737 | |
|---|
| 738 | /* |
|---|
| 739 | Summary: |
|---|
| 740 | Get status of an analog signal on a tuner. |
|---|
| 741 | */ |
|---|
| 742 | bresult btuner_get_analog_status( |
|---|
| 743 | btuner_t tuner, |
|---|
| 744 | btuner_analog_status *status /* [out] */ |
|---|
| 745 | ); |
|---|
| 746 | |
|---|
| 747 | |
|---|
| 748 | /* |
|---|
| 749 | Summary: |
|---|
| 750 | QAM status returned by btuner_get_qam_status. |
|---|
| 751 | */ |
|---|
| 752 | typedef struct btuner_qam_status { |
|---|
| 753 | bool fec_lock; /* Is the FEC locked? */ |
|---|
| 754 | bool qam_lock; /* Do we have QAM lock? */ |
|---|
| 755 | unsigned symbol_rate; /* Baud. received symbol rate (in-band) */ |
|---|
| 756 | unsigned snr_estimate; /* snr estimate in dB (in-Band). x256 */ |
|---|
| 757 | unsigned int_agc_level;/* IF AGC level in units of 1/10 percent */ |
|---|
| 758 | unsigned ext_agc_level;/* tuner AGC level in units of 1/10 percent */ |
|---|
| 759 | int ber_estimate; /* Bit error rate as log10 of 0.0-1.0 range. |
|---|
| 760 | 1.0 => 100% => 0 |
|---|
| 761 | 0.1 => 10% => -1 |
|---|
| 762 | 0.01 => 1% => -2 |
|---|
| 763 | 0 => 0% => 1 (special value for NONE) */ |
|---|
| 764 | int freq_err; /* carrier offset in Hz */ |
|---|
| 765 | int freq_er2; /* ###@@@derotator offset in Hz */ |
|---|
| 766 | unsigned fec_corr_cnt; /* cumulative FEC correctable errors */ |
|---|
| 767 | unsigned fec_uncorr_cnt;/* cumulative FEC uncorrectable errors */ |
|---|
| 768 | int dsChannelPower; /* OCAP DPM support for video channels in 10s of dBmv. */ |
|---|
| 769 | unsigned mainTap; /* Channel main tap coefficient */ |
|---|
| 770 | int equalizerGain; /* Channel equalizer gain value in dBm */ |
|---|
| 771 | unsigned postRsBer; /* OCAP requires postRsBER for all DS channels. postRsBer will be reset on every channel change. Same units as ber_estimate*/ |
|---|
| 772 | unsigned postRsBerElapsedTime; /* postRsBER over this time. In units of seconds */ |
|---|
| 773 | unsigned fec_clean_cnt; |
|---|
| 774 | btuner_qam_annex annex; |
|---|
| 775 | } btuner_qam_status; |
|---|
| 776 | |
|---|
| 777 | /* |
|---|
| 778 | Summary: |
|---|
| 779 | Get QAM demodulation status. |
|---|
| 780 | */ |
|---|
| 781 | bresult btuner_get_qam_status( |
|---|
| 782 | btuner_t tuner, |
|---|
| 783 | btuner_qam_status *status /* [out] */ |
|---|
| 784 | ); |
|---|
| 785 | |
|---|
| 786 | /* |
|---|
| 787 | Summary: |
|---|
| 788 | Upstream status returned by btuner_get_us_status. |
|---|
| 789 | */ |
|---|
| 790 | typedef struct btuner_qam_us_status { |
|---|
| 791 | btuner_qam_us_mode mode; /* Operation Mode*/ |
|---|
| 792 | unsigned symbol_rate; /* Baud */ |
|---|
| 793 | unsigned power_level; /* Power Level in dBmV*/ |
|---|
| 794 | unsigned freq; /* Frequency in Hz */ |
|---|
| 795 | } btuner_qam_us_status; |
|---|
| 796 | |
|---|
| 797 | /* |
|---|
| 798 | Summary: |
|---|
| 799 | Get Upstream status. |
|---|
| 800 | */ |
|---|
| 801 | bresult btuner_get_qam_us_status( |
|---|
| 802 | btuner_t tuner, |
|---|
| 803 | btuner_qam_us_status *status /* [out] Current status of the Upstream mod*/ |
|---|
| 804 | ); |
|---|
| 805 | |
|---|
| 806 | /* |
|---|
| 807 | Summary: |
|---|
| 808 | Summary of sds acquisition returned by btuner_get_sds_status. |
|---|
| 809 | */ |
|---|
| 810 | typedef struct btuner_sds_status { |
|---|
| 811 | btuner_sds_coderate coderate; |
|---|
| 812 | btuner_sds_spectral_inversion spectral_inversion; |
|---|
| 813 | unsigned sample_frequency; /* Hz */ |
|---|
| 814 | unsigned carrier_error; /* carrier error in Hz */ |
|---|
| 815 | unsigned output_bit_rate; /* output bit rate in bps */ |
|---|
| 816 | unsigned snr_estimate; /* SNR in dB x256 */ |
|---|
| 817 | unsigned ber_estimate; /* Bit error rate as log10 of 0.0-1.0 range. |
|---|
| 818 | 1.0 => 100% => 0 |
|---|
| 819 | 0.1 => 10% => -1 |
|---|
| 820 | 0.01 => 1% => -2 |
|---|
| 821 | 0 => 0% => 1 (special value for NONE) |
|---|
| 822 | If bert_locked == false, it's set to 1. */ |
|---|
| 823 | unsigned input_power; /* input power estimate in dB x256 */ |
|---|
| 824 | unsigned fec_phase; /* 0, 90, 180, 270 */ |
|---|
| 825 | unsigned rs_corr; /* cumulative RS correctable errors */ |
|---|
| 826 | unsigned rs_uncorr; /* cumulative RS uncorrectable errors */ |
|---|
| 827 | unsigned fec_corr; /* cumulative FEC correctable errors */ |
|---|
| 828 | unsigned fec_uncorr; /* cumulative FEC uncorrectable errors */ |
|---|
| 829 | unsigned fec_clean; /* cumulative FEC clean */ |
|---|
| 830 | unsigned ber_errors; /* BER error count */ |
|---|
| 831 | unsigned pre_viterbi_error_count; /* accumulated pre-Viterbi error count */ |
|---|
| 832 | unsigned mpeg_errors; /* mpeg frame error count */ |
|---|
| 833 | unsigned mpeg_count; /* total mpeg frame count */ |
|---|
| 834 | unsigned if_agc; /* if agc value from hw unmodified */ |
|---|
| 835 | unsigned rf_agc; /* rf agc value from hw unmodified */ |
|---|
| 836 | struct { |
|---|
| 837 | unsigned int_config; /* info from lna status */ |
|---|
| 838 | unsigned ext_config; /* info from lna status */ |
|---|
| 839 | unsigned version; /* info from lna status */ |
|---|
| 840 | unsigned agc0; /* info from lna status */ |
|---|
| 841 | unsigned agc1; /* info from lna status */ |
|---|
| 842 | } lnaStatus; |
|---|
| 843 | unsigned tuner_freq; /* tuner frequency */ |
|---|
| 844 | unsigned channel; /* channel */ |
|---|
| 845 | bool rs_locked; /* is it locked? */ |
|---|
| 846 | bool vit_locked; /* is it locked? */ |
|---|
| 847 | bool bert_locked; /* is BER tester locked? If so, see ber_estimate. */ |
|---|
| 848 | } btuner_sds_status; |
|---|
| 849 | |
|---|
| 850 | /* |
|---|
| 851 | Summary: |
|---|
| 852 | Get the status of SDS demodulation |
|---|
| 853 | */ |
|---|
| 854 | bresult btuner_get_sds_status( |
|---|
| 855 | btuner_t tuner, |
|---|
| 856 | btuner_sds_status *status /* [out] Current status of the SDS demod */ |
|---|
| 857 | ); |
|---|
| 858 | |
|---|
| 859 | |
|---|
| 860 | |
|---|
| 861 | typedef struct btuner_vsb_status { |
|---|
| 862 | btuner_vsb_mode mode; /* modulation */ |
|---|
| 863 | bool receiver_lock; /* true if the receiver is locked */ |
|---|
| 864 | bool fec_lock; /* true if the FEC is locked */ |
|---|
| 865 | bool opll_lock; /* true if the output PLL is locked */ |
|---|
| 866 | |
|---|
| 867 | unsigned symbol_rate; /* standard symbol rate in Baud */ |
|---|
| 868 | unsigned symbol_rate_offset; /* symbol rate offset in Baud */ |
|---|
| 869 | signed symbol_rate_error; /* symbol rate error in Baud */ |
|---|
| 870 | |
|---|
| 871 | unsigned if_freq; /* standard IF frequency in Hz */ |
|---|
| 872 | signed if_freq_offset; /* IF frequency offset in Hz */ |
|---|
| 873 | signed if_freq_error; /* IF frequency error in Hz */ |
|---|
| 874 | |
|---|
| 875 | signed ntsc_filter; /* location of NTSC filter notch 1 in Hz */ |
|---|
| 876 | signed ntsc_offset; /* NTSC offset in Hz from host */ |
|---|
| 877 | signed ntsc_error; /* NTSC error in Hz */ |
|---|
| 878 | |
|---|
| 879 | unsigned int_agc_level; /* IF AGC level in units of 1/10 percent */ |
|---|
| 880 | unsigned ext_agc_level; /* tuner AGC level in units of 1/10 percent */ |
|---|
| 881 | unsigned snr_estimate; /* SNR estimate in units of 1/256 dB */ |
|---|
| 882 | |
|---|
| 883 | /* information for these counters are not available from 3510 */ |
|---|
| 884 | unsigned blk_corr; /* cumulative Block correctable errors */ |
|---|
| 885 | unsigned blk_uncorr; /* cumulative Block uncorrectable errors */ |
|---|
| 886 | unsigned err_corr; /* Bit correctable errors */ |
|---|
| 887 | } btuner_vsb_status; |
|---|
| 888 | |
|---|
| 889 | /* |
|---|
| 890 | Summary: |
|---|
| 891 | Get the status of VSB demodulation |
|---|
| 892 | */ |
|---|
| 893 | bresult btuner_get_vsb_status( |
|---|
| 894 | btuner_t tuner, |
|---|
| 895 | btuner_vsb_status *status /* [out] Current status of the SDS demod */ |
|---|
| 896 | ); |
|---|
| 897 | |
|---|
| 898 | typedef struct btuner_ofdm_status { |
|---|
| 899 | bool receiver_lock; /* true if the receiver is locked */ |
|---|
| 900 | bool fec_lock; /* true if the FEC is locked */ |
|---|
| 901 | unsigned carrier_offset; /* Offset of carrier loop in Hz */ |
|---|
| 902 | unsigned timing_offset; /* Offset of timing loop in Hz */ |
|---|
| 903 | int snr; /* SNR value of reciever in 1/100 dB */ |
|---|
| 904 | unsigned blk_corr; /* accumulated corrected blocks by FEC */ |
|---|
| 905 | unsigned blk_uncorr; /* accumlated uncorrected blocks */ |
|---|
| 906 | unsigned blk_clean; /* accumlated clean RS blocks */ |
|---|
| 907 | unsigned acq_count; /* number of reacquisitions performed */ |
|---|
| 908 | |
|---|
| 909 | } btuner_ofdm_status; |
|---|
| 910 | |
|---|
| 911 | /* |
|---|
| 912 | Summary: |
|---|
| 913 | Get the status of DVB-T demodulation |
|---|
| 914 | */ |
|---|
| 915 | bresult btuner_get_ofdm_status( |
|---|
| 916 | btuner_t tuner, |
|---|
| 917 | btuner_ofdm_status *status /* [out] Current status of the SDS demod */ |
|---|
| 918 | ); |
|---|
| 919 | |
|---|
| 920 | /* |
|---|
| 921 | Summary: |
|---|
| 922 | One soft decision returned by btuner_get_soft_decisions. |
|---|
| 923 | */ |
|---|
| 924 | typedef struct btuner_soft_decision { |
|---|
| 925 | int16_t i; |
|---|
| 926 | int16_t q; |
|---|
| 927 | } btuner_soft_decision; |
|---|
| 928 | |
|---|
| 929 | /* |
|---|
| 930 | Summary: |
|---|
| 931 | Get an array of soft decisions for QAM or SDS constellation. |
|---|
| 932 | Description: |
|---|
| 933 | i and q range from 32767 to -32768 for all platforms. |
|---|
| 934 | The precision varies for each platform. |
|---|
| 935 | */ |
|---|
| 936 | bresult btuner_get_soft_decisions( |
|---|
| 937 | btuner_t tuner, |
|---|
| 938 | btuner_soft_decision *data, /* [out,size_is(length)] array of soft decisions */ |
|---|
| 939 | size_t length /* number of btuner_soft_decision's to get */ |
|---|
| 940 | ); |
|---|
| 941 | |
|---|
| 942 | |
|---|
| 943 | #ifdef __cplusplus |
|---|
| 944 | } |
|---|
| 945 | #endif |
|---|
| 946 | |
|---|
| 947 | #endif /* BSETTOP_TUNER_H__ */ |
|---|
| 948 | |
|---|