| [2] | 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2005-2012, 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: bthd.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/58 $ |
|---|
| 12 | * $brcm_Date: 2/7/12 5:07p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/thd/bthd.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/58 2/7/12 5:07p atanugul |
|---|
| 21 | * SW3461-144: Change signalstrength units to 1/100th of a dBmV |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/57 2/2/12 6:22p atanugul |
|---|
| 24 | * SW3461-141: Implement new apis for SetAcquireParams, GetAcquireParams |
|---|
| 25 | * and PowerUp |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/56 1/23/12 2:24p atanugul |
|---|
| 28 | * SW3461-136: Fix signalstrength units |
|---|
| 29 | * |
|---|
| 30 | * Hydra_Software_Devel/55 1/19/12 4:59p atanugul |
|---|
| 31 | * SW3461-135: Add auto acquire on tune support for 3461 |
|---|
| 32 | * |
|---|
| 33 | * Hydra_Software_Devel/54 1/13/12 3:25p atanugul |
|---|
| 34 | * SW3461-133: Add SignalLevelPercent and SignalQualityPercent to THD and |
|---|
| 35 | * TC2 PIs |
|---|
| 36 | * |
|---|
| 37 | * Hydra_Software_Devel/53 11/16/11 12:06p atanugul |
|---|
| 38 | * SW3461-79: Add No Signal to GetThdLockStatus() |
|---|
| 39 | * |
|---|
| 40 | * Hydra_Software_Devel/52 10/5/11 5:07p atanugul |
|---|
| 41 | * SW3461-3: Update description for BTHD_GetVersion() and |
|---|
| 42 | * BTHD_GetChipRevision() |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/51 8/12/11 12:35p farshidf |
|---|
| 45 | * SWDTV-8160: add the DQPSK enum |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/50 7/25/11 4:22p farshidf |
|---|
| 48 | * SWDTV-7399: new mode added for GuardMode to support more mode in ISDBT |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/49 6/10/11 12:15p farshidf |
|---|
| 51 | * SW7552-36: add a new flag for ISDBT support |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/48 6/1/11 3:38p atanugul |
|---|
| 54 | * SW3461-5: Add THD support to 3461 |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/47 4/27/11 12:14p farshidf |
|---|
| 57 | * SWDTV-6190: add the Nexus BBS interface |
|---|
| 58 | * |
|---|
| 59 | * Hydra_Software_Devel/46 5/18/10 3:50p farshidf |
|---|
| 60 | * SW7550-440: add GetThdLockStatus |
|---|
| 61 | * |
|---|
| 62 | * Hydra_Software_Devel/SW7550-399/1 5/6/10 6:16p farshidf |
|---|
| 63 | * SW7550-399: add the mini tune while we are lock |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/45 3/2/10 4:26p farshidf |
|---|
| 66 | * SW7550-38: merge from branch auto |
|---|
| 67 | * |
|---|
| 68 | * Hydra_Software_Devel/THD_7550_Auto/3 3/2/10 4:23p farshidf |
|---|
| 69 | * SW7550-38: miss type |
|---|
| 70 | * |
|---|
| 71 | * Hydra_Software_Devel/THD_7550_Auto/2 2/3/10 5:39p farshidf |
|---|
| 72 | * SW7550-38: add the scan mode |
|---|
| 73 | * |
|---|
| 74 | * Hydra_Software_Devel/THD_7550_Auto/1 2/1/10 6:04p farshidf |
|---|
| 75 | * SW7550-38: initinal ISDB-T channel scan |
|---|
| 76 | * |
|---|
| 77 | * Hydra_Software_Devel/44 1/13/10 6:08p dliu |
|---|
| 78 | * SW3556-972: Add optiont to turn off IF AGC |
|---|
| 79 | * |
|---|
| 80 | * Hydra_Software_Devel/43 11/6/09 5:53p farshidf |
|---|
| 81 | * SW7550-38: match Nexus changes |
|---|
| 82 | * |
|---|
| 83 | * Hydra_Software_Devel/42 11/6/09 10:53a farshidf |
|---|
| 84 | * SW7550-38: compile fix |
|---|
| 85 | * |
|---|
| 86 | * Hydra_Software_Devel/41 11/6/09 9:40a farshidf |
|---|
| 87 | * SW7550-38: update the inband and status structure to support ISDB-T |
|---|
| 88 | * |
|---|
| 89 | * Hydra_Software_Devel/40 11/5/09 3:32p farshidf |
|---|
| 90 | * SW7550-38: compile issue |
|---|
| 91 | * |
|---|
| 92 | * Hydra_Software_Devel/39 11/5/09 2:16p farshidf |
|---|
| 93 | * SW7550-38: API changes for 7550 |
|---|
| 94 | * PR41450: remove status event |
|---|
| 95 | * PR41450: move down the timer settings |
|---|
| 96 | * PR41450: remove Dynamic settings |
|---|
| 97 | * PR41450: add the memory look up for BBS dynamic param |
|---|
| 98 | * PR41450: add the update Aquire param settings |
|---|
| 99 | * PR57150: Implement THD under Nexus without the AP |
|---|
| 100 | * |
|---|
| 101 | * Hydra_Software_Devel/38 8/7/09 12:14p katrep |
|---|
| 102 | * PR57520: Checkin the THD code recived from Dallas for phase 6.5 release |
|---|
| 103 | * |
|---|
| 104 | * Hydra_Software_Devel/37 6/17/09 3:32p dliu |
|---|
| 105 | * PR56100: Add IFD agc settings |
|---|
| 106 | * |
|---|
| 107 | * Hydra_Software_Devel/36 5/15/09 3:51p dliu |
|---|
| 108 | * PR53570: Add option for fast/slow acquistion |
|---|
| 109 | * |
|---|
| 110 | * Hydra_Software_Devel/35 5/14/09 10:08p dliu |
|---|
| 111 | * PR55008: Add options to invert delta sigma |
|---|
| 112 | * |
|---|
| 113 | * Hydra_Software_Devel/34 4/27/09 5:25p dliu |
|---|
| 114 | * PR54218: Add instantaneous VitBER |
|---|
| 115 | * |
|---|
| 116 | * Hydra_Software_Devel/33 3/24/09 2:18p dliu |
|---|
| 117 | * PR53540: Add support for SECAM-L (prime) |
|---|
| 118 | * |
|---|
| 119 | * Hydra_Software_Devel/32 3/16/09 1:42p dliu |
|---|
| 120 | * PR53095: Add cell_id to THD status |
|---|
| 121 | * |
|---|
| 122 | * Hydra_Software_Devel/PR57150/7 11/5/09 2:07p farshidf |
|---|
| 123 | * SW7550-38: API changes for 7550 |
|---|
| 124 | * |
|---|
| 125 | * Hydra_Software_Devel/PR57150/6 11/3/09 2:29p farshidf |
|---|
| 126 | * PR41450: remove status event |
|---|
| 127 | * |
|---|
| 128 | * Hydra_Software_Devel/PR57150/5 11/1/09 2:13p farshidf |
|---|
| 129 | * PR41450: move down the timer settings |
|---|
| 130 | * |
|---|
| 131 | * Hydra_Software_Devel/PR57150/4 10/8/09 6:13p farshidf |
|---|
| 132 | * PR41450: remove Dynamic settings |
|---|
| 133 | * |
|---|
| 134 | * Hydra_Software_Devel/PR57150/3 10/7/09 4:59p farshidf |
|---|
| 135 | * PR41450: add the memory look up for BBS dynamic param |
|---|
| 136 | * |
|---|
| 137 | * Hydra_Software_Devel/PR57150/2 9/30/09 3:31p farshidf |
|---|
| 138 | * PR41450: add the update Aquire param settings |
|---|
| 139 | * |
|---|
| 140 | * Hydra_Software_Devel/PR57150/1 7/28/09 2:14p farshidf |
|---|
| 141 | * PR57150: Implement THD under Nexus without the AP |
|---|
| 142 | * |
|---|
| 143 | * Hydra_Software_Devel/31 2/27/09 5:20p dliu |
|---|
| 144 | * PR52629: Add spectrum inversion bit |
|---|
| 145 | * |
|---|
| 146 | * Hydra_Software_Devel/30 2/17/09 10:24a dliu |
|---|
| 147 | * PR52131: Add e to audio deviation enum |
|---|
| 148 | * |
|---|
| 149 | * Hydra_Software_Devel/29 2/16/09 1:44p dliu |
|---|
| 150 | * PR52131: Add medium deviation |
|---|
| 151 | * |
|---|
| 152 | * Hydra_Software_Devel/28 11/24/08 4:30p dliu |
|---|
| 153 | * PR49627: Add high deviation |
|---|
| 154 | * |
|---|
| 155 | * Hydra_Software_Devel/27 11/3/08 3:11p dliu |
|---|
| 156 | * PR48626: Add pre/post RS viterbi error rate |
|---|
| 157 | * |
|---|
| 158 | * Hydra_Software_Devel/26 9/30/08 12:06p dliu |
|---|
| 159 | * PR46516: Add power managment error flag |
|---|
| 160 | * |
|---|
| 161 | * Hydra_Software_Devel/25 9/29/08 2:05p dliu |
|---|
| 162 | * PR46539: Add dynamic power API |
|---|
| 163 | * |
|---|
| 164 | * Hydra_Software_Devel/24 9/17/08 9:48a dliu |
|---|
| 165 | * PR47011: Add no-signal detect flag |
|---|
| 166 | * |
|---|
| 167 | * Hydra_Software_Devel/23 8/13/08 5:04p dliu |
|---|
| 168 | * PR38944: Change SetIfdAudioSettings to pass in const pointer |
|---|
| 169 | * |
|---|
| 170 | * Hydra_Software_Devel/22 8/8/08 2:56p dliu |
|---|
| 171 | * PR38944: Change SetIfdAudioSettings function to use pointers |
|---|
| 172 | * |
|---|
| 173 | * Hydra_Software_Devel/21 8/6/08 4:55p dliu |
|---|
| 174 | * PR38934: Add functions and parameters for AASD |
|---|
| 175 | * |
|---|
| 176 | * Hydra_Software_Devel/20 7/30/08 2:32p dliu |
|---|
| 177 | * PR45192: Change function name |
|---|
| 178 | * |
|---|
| 179 | * Hydra_Software_Devel/19 7/30/08 12:54p dliu |
|---|
| 180 | * PR45192: Add default functions to header |
|---|
| 181 | * |
|---|
| 182 | * Hydra_Software_Devel/18 7/28/08 4:01p dliu |
|---|
| 183 | * PR45192: Add GetDefault functions to api list |
|---|
| 184 | * |
|---|
| 185 | * Hydra_Software_Devel/17 7/25/08 5:43p dliu |
|---|
| 186 | * PR45002: Add QAM Mode and code rate as input parameter to acquire |
|---|
| 187 | * |
|---|
| 188 | * Hydra_Software_Devel/16 7/21/08 4:17p dliu |
|---|
| 189 | * PR45002: Remove timer from open call |
|---|
| 190 | * |
|---|
| 191 | * Hydra_Software_Devel/15 7/21/08 12:55p dliu |
|---|
| 192 | * PR45002: Include TPS info in acquire parameter. Also add timer for IFD |
|---|
| 193 | * acquistion |
|---|
| 194 | * |
|---|
| 195 | * Hydra_Software_Devel/14 6/24/08 3:23p dliu |
|---|
| 196 | * PR38944: Change parameters for GetSoftDecisionBuf to signed values |
|---|
| 197 | * |
|---|
| 198 | * Hydra_Software_Devel/13 6/19/08 3:06p dliu |
|---|
| 199 | * PR38944: Fix compiler warning |
|---|
| 200 | * |
|---|
| 201 | * Hydra_Software_Devel/12 6/19/08 3:05p dliu |
|---|
| 202 | * PR38944: Add code rate and AGC gain to THD Status |
|---|
| 203 | * |
|---|
| 204 | * Hydra_Software_Devel/11 6/13/08 4:36p dliu |
|---|
| 205 | * PR38944: Add more parameters to THD acquire |
|---|
| 206 | * |
|---|
| 207 | * Hydra_Software_Devel/10 5/31/08 12:42p dliu |
|---|
| 208 | * PR38934: Add NICAM status, change parameters of GetSoftDecisionBuf to |
|---|
| 209 | * uint_16 |
|---|
| 210 | * |
|---|
| 211 | * Hydra_Software_Devel/9 5/16/08 10:59a dliu |
|---|
| 212 | * PR38934: Add Pal-I mode. Change enum AudioInput to AnalogInput to |
|---|
| 213 | * better represent the meaning |
|---|
| 214 | * |
|---|
| 215 | * Hydra_Software_Devel/8 5/15/08 12:34p dliu |
|---|
| 216 | * PR38934: Add IFD Status function and GetSoftDecisionBuf function |
|---|
| 217 | * |
|---|
| 218 | * Hydra_Software_Devel/7 5/14/08 2:24p dliu |
|---|
| 219 | * PR38934: Change IFD acquire to its own dedicate function. Also changed |
|---|
| 220 | * input paramters of IFD acquire |
|---|
| 221 | * |
|---|
| 222 | * Hydra_Software_Devel/6 5/7/08 4:42p dliu |
|---|
| 223 | * PR38934: Add 3556 required defines |
|---|
| 224 | * |
|---|
| 225 | * Hydra_Software_Devel/5 3/26/08 5:51p dliu |
|---|
| 226 | * PR40927: Add modulation, transmission mode and guard interval |
|---|
| 227 | * |
|---|
| 228 | * Hydra_Software_Devel/4 2/27/08 10:13a dliu |
|---|
| 229 | * PR36603: Add viterbi counters and do some name rechange |
|---|
| 230 | * |
|---|
| 231 | * Hydra_Software_Devel/3 2/27/08 10:08a dliu |
|---|
| 232 | * PR36603: Add viterbi counters and do some name rechange |
|---|
| 233 | * |
|---|
| 234 | * Hydra_Software_Devel/2 11/6/07 5:36p dliu |
|---|
| 235 | * PR36603: Add GetVersion function |
|---|
| 236 | * |
|---|
| 237 | * Hydra_Software_Devel/1 11/5/07 3:40p dliu |
|---|
| 238 | * PR36603: Initial version |
|---|
| 239 | * |
|---|
| 240 | ***************************************************************************/ |
|---|
| 241 | |
|---|
| 242 | /*================== Module Overview ===================================== |
|---|
| 243 | <verbatim> |
|---|
| 244 | The BTHD (Broadcom Terrestrial Handheld Demodulator) portinginterface (PI) |
|---|
| 245 | controls the RF front-end block on any Broadcom chip that has one or more |
|---|
| 246 | DVB T/H core(s), such as BCM2940. The BTHD PI is responsible for controlling |
|---|
| 247 | the terrestrial tuner, and theterrestrial downstream receiver. |
|---|
| 248 | |
|---|
| 249 | The BTHD PI device is accessed by the handle BTHD_Handle. There is 1 |
|---|
| 250 | BTHD_Handle per Broadcom chip. A BTHD_Handle will have 1 or more channels, |
|---|
| 251 | depending on the number of THD cores present in the Broadcom chip. |
|---|
| 252 | |
|---|
| 253 | The BTHD_Handle shall be proveded the following API |
|---|
| 254 | BTHD_Open |
|---|
| 255 | BTHD_Close |
|---|
| 256 | BTHD_Init |
|---|
| 257 | BTHD_TuneAcquire |
|---|
| 258 | BTHD_GetVersion |
|---|
| 259 | BTHD_GetThdStatus |
|---|
| 260 | BTHD_ResetInbandStatus |
|---|
| 261 | BTHD_GetInterruptEventHandler |
|---|
| 262 | BTHD_HandleInterrupt_isr |
|---|
| 263 | |
|---|
| 264 | The magnum/portinginterface/THD/bthd.h header file defines a standard THDT/H |
|---|
| 265 | front-end API for all Broadcom THD chips. The implementation of the API for |
|---|
| 266 | each chip is in the magnum/portinginterface/thd/<chip> directory. |
|---|
| 267 | |
|---|
| 268 | Interrupt Requirements |
|---|
| 269 | The application needs to call BTHD_HandleInterrupt_isr() when it receives |
|---|
| 270 | the THDT L1 interrupt. |
|---|
| 271 | |
|---|
| 272 | Sample Code |
|---|
| 273 | // |
|---|
| 274 | // NOTE: This is sample code for a system that contains single-channel THDT/H |
|---|
| 275 | // using BCM2940. This code does not do any error checking |
|---|
| 276 | // |
|---|
| 277 | #include "bTHD.h" |
|---|
| 278 | #include "bTHD_3520.h" |
|---|
| 279 | #include "bTHD_3560.h" |
|---|
| 280 | |
|---|
| 281 | static BTHD_Handle hTHD; // handle for BCM3560 THD core |
|---|
| 282 | static BCHP_Handle hCHP; |
|---|
| 283 | static BREG_I2C_Handle hReg; |
|---|
| 284 | |
|---|
| 285 | // These are pointers to AP microcode used in BCM3560/BCM3520. |
|---|
| 286 | // The microcode will vary depending on chip/board/customer, so it is not |
|---|
| 287 | // part of the BTHD PI. |
|---|
| 288 | extern const uint8_t *pBcm3520ApImage; |
|---|
| 289 | extern const uint8_t *pBcm3560ApImage; |
|---|
| 290 | |
|---|
| 291 | void main(void) |
|---|
| 292 | { |
|---|
| 293 | BTHD_Settings settings1, settings2; |
|---|
| 294 | BTHD_InbandParams inbandParams; |
|---|
| 295 | |
|---|
| 296 | // do initialization |
|---|
| 297 | // (get BCHP_Handle, BREG_I2C_Handle, etc) |
|---|
| 298 | ... |
|---|
| 299 | |
|---|
| 300 | // BTHD initialization for BCM2940 |
|---|
| 301 | BTHD_GetDefaultSettings(&settings2); |
|---|
| 302 | settings2.i2c.chipAddr = BCM2940_I2C_ADDR; |
|---|
| 303 | settings2.i2c.interruptEnableFunc = bcm2940_enable_irq; |
|---|
| 304 | settings2.i2c.interruptEnableFuncParam = NULL; |
|---|
| 305 | |
|---|
| 306 | // enable the BCM2940 host interrupt and map that interrupt to a function |
|---|
| 307 | // that will call the BTHD PI function BTHD_HandleInterrupt_isr() |
|---|
| 308 | ... |
|---|
| 309 | |
|---|
| 310 | // start a thread that runs bcm2940_background() |
|---|
| 311 | ... |
|---|
| 312 | |
|---|
| 313 | // download the default Bcm2940 microcode and run the AP |
|---|
| 314 | BTHD_Init(hTHD, NULL); |
|---|
| 315 | |
|---|
| 316 | // tune the tuner |
|---|
| 317 | ... |
|---|
| 318 | |
|---|
| 319 | |
|---|
| 320 | // acquire a DVB-T Channel |
|---|
| 321 | inbandParams.tunerFreq = 500000000; |
|---|
| 322 | inbandParams.bandwidth = BTHD_Bandwidth_8Mhz; |
|---|
| 323 | inbandParams.cciMode = BTHD_CCI_None; |
|---|
| 324 | BTHD_TuneAcquire(hTHD, &inbandParams); |
|---|
| 325 | |
|---|
| 326 | ... |
|---|
| 327 | |
|---|
| 328 | close_THD: |
|---|
| 329 | // disable THD L1 interrupts |
|---|
| 330 | // terminate bcm3520_background task |
|---|
| 331 | ... |
|---|
| 332 | BTHD_Close(hTHD); |
|---|
| 333 | |
|---|
| 334 | program_done: |
|---|
| 335 | ... |
|---|
| 336 | } |
|---|
| 337 | |
|---|
| 338 | // The application must call BTHD_ProcessInterruptEvent() every time the THD |
|---|
| 339 | // interrupt event is set. |
|---|
| 340 | void bcm2940_background() |
|---|
| 341 | { |
|---|
| 342 | // get handle to the BCM3520 interrupt event |
|---|
| 343 | BTHD_GetInterruptEventHandle(hTHD, &event); |
|---|
| 344 | |
|---|
| 345 | while (1) |
|---|
| 346 | { |
|---|
| 347 | BKNI_WaitForEvent(event, BKNI_INFINTE); |
|---|
| 348 | BTHD_ProcessInterruptEvent(hTHD); |
|---|
| 349 | } |
|---|
| 350 | } |
|---|
| 351 | |
|---|
| 352 | |
|---|
| 353 | // This is an example of a callback function for enabling/disabling the L1 |
|---|
| 354 | // interrupt. |
|---|
| 355 | void THD_enable_irq(bool b, void *p) |
|---|
| 356 | { |
|---|
| 357 | if (b) |
|---|
| 358 | CPUINT1_Enable(THD_IRQ); // enable the L1 interrupt |
|---|
| 359 | else |
|---|
| 360 | CPUINT1_Disable(THD_IRQ); // disable the L1 interrupt |
|---|
| 361 | } |
|---|
| 362 | </verbatim> |
|---|
| 363 | ========================================================================*/ |
|---|
| 364 | |
|---|
| 365 | #ifndef BTHD_H__ |
|---|
| 366 | #define BTHD_H__ |
|---|
| 367 | |
|---|
| 368 | #ifdef __cplusplus |
|---|
| 369 | extern "C" { |
|---|
| 370 | #endif |
|---|
| 371 | |
|---|
| 372 | #include "bchp.h" |
|---|
| 373 | #include "bkni.h" |
|---|
| 374 | #include "bint.h" |
|---|
| 375 | #include "btmr.h" |
|---|
| 376 | #include "bmem.h" |
|---|
| 377 | #include "berr_ids.h" |
|---|
| 378 | |
|---|
| 379 | |
|---|
| 380 | /*************************************************************************** |
|---|
| 381 | Summary: |
|---|
| 382 | BTHD error codes |
|---|
| 383 | |
|---|
| 384 | Description: |
|---|
| 385 | |
|---|
| 386 | See Also: |
|---|
| 387 | |
|---|
| 388 | ****************************************************************************/ |
|---|
| 389 | #define BTHD_ERR_MI2C_NO_ACK BERR_MAKE_CODE(BERR_THD_ID, 0x0) /* This is a BERR_Code to indicate no ack from i2c slave device (e.g. tuner). */ |
|---|
| 390 | #define BTHD_ERR_DMA BERR_MAKE_CODE(BERR_THD_ID, 0x1) /* This is a BERR_Code to indicate DMA transfer has failed */ |
|---|
| 391 | #define BTHD_ERR_RFIFO_UNDERRUN BERR_MAKE_CODE(BERR_THD_ID, 0x2) /* This is a BERR_Code to indicate DMA transfer has failed due to read fifo underflow */ |
|---|
| 392 | #define BTHD_ERR_WFIFO_OVERWRITE BERR_MAKE_CODE(BERR_THD_ID, 0x3) /* This is a BERR_Code to indicate DMA transfer has failed due to write fifo overflow */ |
|---|
| 393 | #define BTHD_ERR_COMMAND_TIMEOUT BERR_MAKE_CODE(BERR_THD_ID, 0x4) /* This is a BERR_Code to indicate a command was sent to firmware but was not acknowledged */ |
|---|
| 394 | #define BTHD_ERR_INIT_TIMEOUT BERR_MAKE_CODE(BERR_THD_ID, 0x5) /* This is a BERR_Code to indicate timeout occured while downloading the microcode */ |
|---|
| 395 | #define BTHD_ERR_HAB_NO_ACK BERR_MAKE_CODE(BERR_THD_ID, 0x6) /* This is a BERR_Code to indicate that the HAB command was not processed by AP. */ |
|---|
| 396 | #define BTHD_ERR_HAB_TIMEOUT BERR_MAKE_CODE(BERR_THD_ID, 0x7) /* This is a BERR_Code to indicate an HAB timeout. */ |
|---|
| 397 | #define BTHD_ERR_AP_NOT_INIT BERR_MAKE_CODE(BERR_THD_ID, 0x8) /* This is a BERR_Code to indicate that the AP has failed to initialize. */ |
|---|
| 398 | #define BTHD_ERR_AP_FAIL BERR_MAKE_CODE(BERR_THD_ID, 0x9) /* This is a BERR_Code to indicate that the AP is no longer responding to command */ |
|---|
| 399 | #define BTHD_ERR_HABAV BERR_MAKE_CODE(BERR_THD_ID, 0xa) /* This is a BERR_Code to indicate that the AP did not properly respond to HAB command */ |
|---|
| 400 | #define BTHD_ERR_MEMAV BERR_MAKE_CODE(BERR_THD_ID, 0xb) /* This is a BERR_Code to indicate that the AP failed while accessing memory */ |
|---|
| 401 | #define BTHD_ERR_HAB_ERR BERR_MAKE_CODE(BERR_THD_ID, 0xd) /* This is a BERR_Code to indicate an HAB command format error. */ |
|---|
| 402 | #define BTHD_ERR_AP_COPY BERR_MAKE_CODE(BERR_THD_ID, 0xe) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 403 | #define BTHD_ERR_AP_IRQ BERR_MAKE_CODE(BERR_THD_ID, 0xf) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 404 | #define BTHD_ERR_AP_SCR BERR_MAKE_CODE(BERR_THD_ID, 0x10) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 405 | #define BTHD_ERR_AP_ISB BERR_MAKE_CODE(BERR_THD_ID, 0x11) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 406 | #define BTHD_ERR_AP_WD BERR_MAKE_CODE(BERR_THD_ID, 0x12) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 407 | #define BTHD_ERR_AP_STACK BERR_MAKE_CODE(BERR_THD_ID, 0x13) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 408 | #define BTHD_ERR_AP_BSC BERR_MAKE_CODE(BERR_THD_ID, 0x14) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 409 | #define BTHD_ERR_AP_PLL BERR_MAKE_CODE(BERR_THD_ID, 0x15) /* This is a BERR_Code to indicate AP was unable to boot because PLL did not lock*/ |
|---|
| 410 | #define BTHD_ERR_AP_HABAV BERR_MAKE_CODE(BERR_THD_ID, 11) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 411 | #define BTHD_ERR_HOST_XFER BERR_MAKE_CODE(BERR_THD_ID, 0x16) /* This is a BERR_Code to indicate a host transfer error (underrun/overrun). */ |
|---|
| 412 | #define BTHD_ERR_AP_UNKNOWN BERR_MAKE_CODE(BERR_THD_ID, 0x17) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 413 | #define BTHD_ERR_INVALID_ANALOG_MODES BERR_MAKE_CODE(BERR_THD_ID, 0x18) /* This is a BERR_Code to indicate the video and audio modes selected is not valid */ |
|---|
| 414 | #define BTHD_ERR_POWER_DOWN BERR_MAKE_CODE(BERR_THD_ID, 0x19) /* This is a BERR_Code to indicate a THD api was called while power is not enabled */ |
|---|
| 415 | |
|---|
| 416 | /*************************************************************************** |
|---|
| 417 | Summary: |
|---|
| 418 | BTHD Powerup/Powerdown code |
|---|
| 419 | |
|---|
| 420 | Description: This is used by PowerEnable and PowerDisable function to allow |
|---|
| 421 | the user to select which cores they would like the dynamicly |
|---|
| 422 | control the power. |
|---|
| 423 | |
|---|
| 424 | See Also: |
|---|
| 425 | |
|---|
| 426 | ****************************************************************************/ |
|---|
| 427 | #define BTHD_POWER_AP 0x1 /* This will only power on/off the internal acquistion processor */ |
|---|
| 428 | |
|---|
| 429 | /*************************************************************************** |
|---|
| 430 | Summary: |
|---|
| 431 | The handle for thd module. |
|---|
| 432 | |
|---|
| 433 | Description: |
|---|
| 434 | This is an opaque handle that is used to access the BTHD API. |
|---|
| 435 | |
|---|
| 436 | See Also: |
|---|
| 437 | BTHD_Open() |
|---|
| 438 | |
|---|
| 439 | ****************************************************************************/ |
|---|
| 440 | typedef struct BTHD_P_Handle *BTHD_Handle; |
|---|
| 441 | |
|---|
| 442 | /*************************************************************************** |
|---|
| 443 | Summary: |
|---|
| 444 | Enumeration for analog video modes |
|---|
| 445 | |
|---|
| 446 | Description: |
|---|
| 447 | This enum specifies analog video mode options for the IFD decoder. This |
|---|
| 448 | only applies to IFD core in cases where this PI controls both ofdm and |
|---|
| 449 | analog video receiver. |
|---|
| 450 | |
|---|
| 451 | See Also: |
|---|
| 452 | None. |
|---|
| 453 | |
|---|
| 454 | ****************************************************************************/ |
|---|
| 455 | typedef enum BTHD_AnalogVideoMode { |
|---|
| 456 | BTHD_AnalogVideoMode_eNtsc_M, /* NTSC-M mode. can be combined with BTSC or A2 audio */ |
|---|
| 457 | BTHD_AnalogVideoMode_eNtsc_N, /* NTSC-N mode, can be combined with only BTSC audio */ |
|---|
| 458 | BTHD_AnalogVideoMode_ePal_M, /* PAL-M mode, can be combined with only BTSC audio */ |
|---|
| 459 | BTHD_AnalogVideoMode_ePal_N, /* PAL-N mode, can be combined with only BTSC audio */ |
|---|
| 460 | BTHD_AnalogVideoMode_ePal_I, /* PAL-I mode, can be combined with only NICAM audio */ |
|---|
| 461 | BTHD_AnalogVideoMode_ePal_BGH, /* PAL-B/G/H mode, can be combined with A2 or NICAM audio */ |
|---|
| 462 | BTHD_AnalogVideoMode_ePal_DK, /* PAL-D/K mode, can be combined with NICAM audio only */ |
|---|
| 463 | BTHD_AnalogVideoMode_ePal_DK1, /* PAL-D/K1 mode, can be combined with A2 audio only */ |
|---|
| 464 | BTHD_AnalogVideoMode_ePal_DK2, /* PAL-D/K2 mode, can be combined with A2 audio only */ |
|---|
| 465 | BTHD_AnalogVideoMode_ePal_DK3, /* PAL-D/K3 mode, can be combined with A2 audio only */ |
|---|
| 466 | BTHD_AnalogVideoMode_eSecam_BGH,/* SECAM-B/G/H mode, can be combined with A2 or NICAM audio */ |
|---|
| 467 | BTHD_AnalogVideoMode_eSecam_DK, /* SECAM-D/K mode, can be combined with only NICAM audio */ |
|---|
| 468 | BTHD_AnalogVideoMode_eSecam_L /* SECAM-L mode, can be combined with onl y NICAM audio */ |
|---|
| 469 | } BTHD_AnalogVideoMode; |
|---|
| 470 | |
|---|
| 471 | /*************************************************************************** |
|---|
| 472 | Summary: |
|---|
| 473 | Enumeration for analog audio modes |
|---|
| 474 | |
|---|
| 475 | Description: |
|---|
| 476 | This enum specifies second audio carrier mode options for the IFD decoder. |
|---|
| 477 | This only applies to IFD core in cases where this PI controls both ofdm |
|---|
| 478 | an analog video receiver. Not all video/audio combo are valid, refer to |
|---|
| 479 | each video mode for more options |
|---|
| 480 | |
|---|
| 481 | See Also: |
|---|
| 482 | BTHD_AnalogVideoMode |
|---|
| 483 | |
|---|
| 484 | ****************************************************************************/ |
|---|
| 485 | typedef enum BTHD_AnalogAudioMode { |
|---|
| 486 | BTHD_AnalogAudioMode_eBtsc, /* Selects BTSC audio */ |
|---|
| 487 | BTHD_AnalogAudioMode_eA2, /* Selects A2 audio */ |
|---|
| 488 | BTHD_AnalogAudioMode_eNicam /* Selects NICAM audio */ |
|---|
| 489 | } BTHD_AnalogAudioMode; |
|---|
| 490 | |
|---|
| 491 | /*************************************************************************** |
|---|
| 492 | Summary: |
|---|
| 493 | Enumeration for analog input |
|---|
| 494 | |
|---|
| 495 | Description: |
|---|
| 496 | This enum specifies analog audio input options for the IFD decoder. This |
|---|
| 497 | only applies to IFD core in cases where this PI controls both ofdm and |
|---|
| 498 | analog video receiver. |
|---|
| 499 | |
|---|
| 500 | See Also: |
|---|
| 501 | None. |
|---|
| 502 | |
|---|
| 503 | ****************************************************************************/ |
|---|
| 504 | typedef enum BTHD_AnalogInput { |
|---|
| 505 | BTHD_AnalogInput_eIf = 0, /* Audio input with IF signal */ |
|---|
| 506 | BTHD_AnalogInput_eSif_1 = 0x80 /* Audio input from SIF Channel 1 */ |
|---|
| 507 | } BTHD_AnalogInput; |
|---|
| 508 | |
|---|
| 509 | /*************************************************************************** |
|---|
| 510 | Summary: |
|---|
| 511 | Enum for IFD deviation modes |
|---|
| 512 | |
|---|
| 513 | Description: |
|---|
| 514 | This enum specifies deviation mode for the IFD core |
|---|
| 515 | |
|---|
| 516 | See Also: |
|---|
| 517 | None. |
|---|
| 518 | |
|---|
| 519 | ****************************************************************************/ |
|---|
| 520 | typedef enum BTHD_AnalogAudioDeviation |
|---|
| 521 | { |
|---|
| 522 | BTHD_AnalogAudioDeviation_eNormal, |
|---|
| 523 | BTHD_AnalogAudioDeviation_eMedium, |
|---|
| 524 | BTHD_AnalogAudioDeviation_eHigh |
|---|
| 525 | } BTHD_AnalogAudioDeviation; |
|---|
| 526 | |
|---|
| 527 | /*************************************************************************** |
|---|
| 528 | Summary: |
|---|
| 529 | Enum for IFD acquisition mode |
|---|
| 530 | |
|---|
| 531 | Description: |
|---|
| 532 | This enum specifies whether should speed acquistion but acquire less offsets |
|---|
| 533 | |
|---|
| 534 | See Also: |
|---|
| 535 | None. |
|---|
| 536 | |
|---|
| 537 | ****************************************************************************/ |
|---|
| 538 | typedef enum BTHD_IfdAcquisitionMode |
|---|
| 539 | { |
|---|
| 540 | BTHD_IfdAcquisitionMode_eSlow, |
|---|
| 541 | BTHD_IfdAcquisitionMode_eFast |
|---|
| 542 | } BTHD_IfdAcquisitionMode; |
|---|
| 543 | |
|---|
| 544 | |
|---|
| 545 | /*************************************************************************** |
|---|
| 546 | Summary: |
|---|
| 547 | Enum for THD acquisition mode |
|---|
| 548 | |
|---|
| 549 | Description: |
|---|
| 550 | This enum specifies whether we are in Scan, Manual or Auto mode |
|---|
| 551 | |
|---|
| 552 | See Also: |
|---|
| 553 | None. |
|---|
| 554 | |
|---|
| 555 | ****************************************************************************/ |
|---|
| 556 | typedef enum BTHD_ThdAcquisitionMode |
|---|
| 557 | { |
|---|
| 558 | BTHD_ThdAcquisitionMode_eAuto, |
|---|
| 559 | BTHD_ThdAcquisitionMode_eManual, |
|---|
| 560 | BTHD_ThdAcquisitionMode_eScan |
|---|
| 561 | } BTHD_ThdAcquisitionMode; |
|---|
| 562 | |
|---|
| 563 | /*************************************************************************** |
|---|
| 564 | Summary: |
|---|
| 565 | Enumeration for pga gain. |
|---|
| 566 | |
|---|
| 567 | Description: |
|---|
| 568 | This enum specifies the pga gain. |
|---|
| 569 | |
|---|
| 570 | See Also: |
|---|
| 571 | None. |
|---|
| 572 | |
|---|
| 573 | ****************************************************************************/ |
|---|
| 574 | typedef enum BTHD_PgaGain |
|---|
| 575 | { |
|---|
| 576 | BTHD_PgaGain_e0dB, |
|---|
| 577 | BTHD_PgaGain_e1dB, |
|---|
| 578 | BTHD_PgaGain_e2dB, |
|---|
| 579 | BTHD_PgaGain_e3dB, |
|---|
| 580 | BTHD_PgaGain_e4dB, |
|---|
| 581 | BTHD_PgaGain_e5dB, |
|---|
| 582 | BTHD_PgaGain_e6dB |
|---|
| 583 | } BTHD_PgaGain; |
|---|
| 584 | |
|---|
| 585 | /*************************************************************************** |
|---|
| 586 | Summary: |
|---|
| 587 | Enumeration for Agc Pin Mode |
|---|
| 588 | |
|---|
| 589 | Description: |
|---|
| 590 | This enum specifies the voltage swing of the AGC pin |
|---|
| 591 | |
|---|
| 592 | See Also: |
|---|
| 593 | None. |
|---|
| 594 | |
|---|
| 595 | ****************************************************************************/ |
|---|
| 596 | typedef enum BTHD_AgcPinMode |
|---|
| 597 | { |
|---|
| 598 | BTHD_AgcPinMode_e33V, /* indicates AGC pin goes from 0 to 3.3V */ |
|---|
| 599 | BTHD_AgcPinMode_e25V /* indicates AGC pin goes from 0 to 2.5V */ |
|---|
| 600 | } BTHD_AgcPinMode; |
|---|
| 601 | |
|---|
| 602 | /*************************************************************************** |
|---|
| 603 | Summary: |
|---|
| 604 | Enum for IFD pullin range |
|---|
| 605 | |
|---|
| 606 | Description: |
|---|
| 607 | This enum specifies how much frequency offset the receiver will acquire to |
|---|
| 608 | |
|---|
| 609 | See Also: |
|---|
| 610 | None. |
|---|
| 611 | |
|---|
| 612 | ****************************************************************************/ |
|---|
| 613 | typedef enum BTHD_IfdPullInRange |
|---|
| 614 | { |
|---|
| 615 | BTHD_IfdPullInRange_e32kHz=0, |
|---|
| 616 | BTHD_IfdPullInRange_e250kHz, |
|---|
| 617 | BTHD_IfdPullInRange_e500kHz, |
|---|
| 618 | BTHD_IfdPullInRange_e750kHz, |
|---|
| 619 | BTHD_IfdPullInRange_e1000kHz, |
|---|
| 620 | BTHD_IfdPullInRange_e1100kHz |
|---|
| 621 | } BTHD_IfdPullInRange; |
|---|
| 622 | |
|---|
| 623 | /*************************************************************************** |
|---|
| 624 | Summary: |
|---|
| 625 | Enumeration for Callback types |
|---|
| 626 | |
|---|
| 627 | Description: |
|---|
| 628 | This enumeration defines Callback types. |
|---|
| 629 | |
|---|
| 630 | See Also: |
|---|
| 631 | |
|---|
| 632 | ****************************************************************************/ |
|---|
| 633 | typedef enum BTHD_Callback |
|---|
| 634 | { |
|---|
| 635 | BTHD_Callback_eLockChange, /* Callback to notify application of lock change */ |
|---|
| 636 | BTHD_Callback_eUpdateGain, /* Callback to notify application to update gain */ |
|---|
| 637 | BTHD_Callback_eNoSignal, /* Callback to notify application there is no signal */ |
|---|
| 638 | BTHD_Callback_eAsyncStatusReady, /* Callback to notify application there is no signal */ |
|---|
| 639 | BTHD_Callback_eTuner, /* Callback to tuner regarding a new setting */ |
|---|
| 640 | BTHD_Callback_eLast /* More may be required */ |
|---|
| 641 | } BTHD_Callback; |
|---|
| 642 | |
|---|
| 643 | /*************************************************************************** |
|---|
| 644 | Summary: |
|---|
| 645 | Structure containing IFD agc parameters |
|---|
| 646 | |
|---|
| 647 | Description: |
|---|
| 648 | This structure contains the setting for AGC block |
|---|
| 649 | |
|---|
| 650 | See Also: |
|---|
| 651 | None. |
|---|
| 652 | |
|---|
| 653 | ****************************************************************************/ |
|---|
| 654 | typedef struct BTHD_IfdAgcSettings |
|---|
| 655 | { |
|---|
| 656 | uint16_t top; /* tuner TOP point */ |
|---|
| 657 | BTHD_PgaGain pgaGain; /* pga gain in dB */ |
|---|
| 658 | uint8_t delay; /* Delay in ms that the acquisition script will wait for the AGC hardware to settle */ |
|---|
| 659 | uint8_t rfBandwidth; /* RF AGC band width */ |
|---|
| 660 | uint8_t ifBandwidth; /* IF AGC band width */ |
|---|
| 661 | } BTHD_IfdAgcSettings; |
|---|
| 662 | |
|---|
| 663 | /*************************************************************************** |
|---|
| 664 | Summary: |
|---|
| 665 | Structure containing input parameters to IFD acquire command |
|---|
| 666 | |
|---|
| 667 | Description: |
|---|
| 668 | This structure contains the setting for IFD acquire command |
|---|
| 669 | |
|---|
| 670 | See Also: |
|---|
| 671 | None. |
|---|
| 672 | |
|---|
| 673 | ****************************************************************************/ |
|---|
| 674 | typedef struct BTHD_IfdParams |
|---|
| 675 | { |
|---|
| 676 | BTHD_AnalogVideoMode eVideoMode; /* Selects analog video standards */ |
|---|
| 677 | BTHD_AnalogAudioMode eAudioMode; /* Selects analog audio standards */ |
|---|
| 678 | BTHD_AnalogInput eAnalogInput; /* Select analog input options */ |
|---|
| 679 | uint32_t ifFreqOffset; /* IF Frequency offset */ |
|---|
| 680 | BTHD_AnalogAudioDeviation eAnalogAudioDeviation; /* Selects deviation mode for analog audio */ |
|---|
| 681 | bool bSpectrumInvert; /* Invert input spectrum, only used in SECAM-L mode to get SECAM-L' */ |
|---|
| 682 | BTHD_IfdPullInRange ePullInRange; |
|---|
| 683 | BTHD_IfdAcquisitionMode eAcquisitionMode; /* Faster acquisition */ |
|---|
| 684 | BTHD_IfdAgcSettings agcSettings; |
|---|
| 685 | |
|---|
| 686 | } BTHD_IfdParams; |
|---|
| 687 | |
|---|
| 688 | /***************************************************************************** |
|---|
| 689 | Summary: |
|---|
| 690 | Structure containing host I2C settings |
|---|
| 691 | Description: |
|---|
| 692 | This structure contains the settings for host I2C control. For memory- |
|---|
| 693 | mapped BTHD devices, this structure will not be used. |
|---|
| 694 | See Also: |
|---|
| 695 | BTHD_Settings |
|---|
| 696 | ******************************************************************************/ |
|---|
| 697 | typedef struct BTHD_I2cSettings |
|---|
| 698 | { |
|---|
| 699 | uint16_t chipAddr; /* Bcm2940 i2c chip address, not needed for 3556 */ |
|---|
| 700 | void (*interruptEnableFunc)(bool, void*); /* callback function for enabling/disabling L1 interrupt */ |
|---|
| 701 | void *interruptEnableFuncParam; /* parameter passed to interruptEnableFunc */ |
|---|
| 702 | } BTHD_I2cSettings; |
|---|
| 703 | |
|---|
| 704 | /*************************************************************************** |
|---|
| 705 | Summary: |
|---|
| 706 | Enumeration for receiver deocde method |
|---|
| 707 | |
|---|
| 708 | Description: |
|---|
| 709 | This enum specifies the decode options |
|---|
| 710 | |
|---|
| 711 | See Also: |
|---|
| 712 | None. |
|---|
| 713 | |
|---|
| 714 | ****************************************************************************/ |
|---|
| 715 | typedef enum BTHD_DecodeMode |
|---|
| 716 | { |
|---|
| 717 | BTHD_Decode_Lp, /* Low priority decode */ |
|---|
| 718 | BTHD_Decode_Hp /* High priority decode */ |
|---|
| 719 | } BTHD_DecodeMode; |
|---|
| 720 | |
|---|
| 721 | /*************************************************************************** |
|---|
| 722 | Summary: |
|---|
| 723 | Enumeration for receiver CCI Mode |
|---|
| 724 | |
|---|
| 725 | Description: |
|---|
| 726 | This enum specifies CoChannel Interferece filter options |
|---|
| 727 | |
|---|
| 728 | See Also: |
|---|
| 729 | None. |
|---|
| 730 | |
|---|
| 731 | ****************************************************************************/ |
|---|
| 732 | typedef enum BTHD_CCIMode |
|---|
| 733 | { |
|---|
| 734 | BTHD_CCI_None, /* No CCI selected */ |
|---|
| 735 | BTHD_CCI_Auto /* Auto Selection */ |
|---|
| 736 | } BTHD_CCIMode; |
|---|
| 737 | |
|---|
| 738 | /*************************************************************************** |
|---|
| 739 | Summary: |
|---|
| 740 | Enumeration for receiver bandwidth |
|---|
| 741 | |
|---|
| 742 | Description: |
|---|
| 743 | This enum specifies the bandwidth the channel received |
|---|
| 744 | |
|---|
| 745 | See Also: |
|---|
| 746 | None. |
|---|
| 747 | |
|---|
| 748 | ****************************************************************************/ |
|---|
| 749 | typedef enum BTHD_Bandwidth |
|---|
| 750 | { |
|---|
| 751 | BTHD_Bandwidth_5Mhz=5, /* Selects 5 MHz */ |
|---|
| 752 | BTHD_Bandwidth_6Mhz, /* Selects 5 MHz */ |
|---|
| 753 | BTHD_Bandwidth_7Mhz, /* Selects 5 MHz */ |
|---|
| 754 | BTHD_Bandwidth_8Mhz /* Selects 5 MHz */ |
|---|
| 755 | } BTHD_Bandwidth; |
|---|
| 756 | |
|---|
| 757 | |
|---|
| 758 | /*************************************************************************** |
|---|
| 759 | Summary: |
|---|
| 760 | Enumeration for receiver modulaton type |
|---|
| 761 | |
|---|
| 762 | Description: |
|---|
| 763 | This enum specifies the modulation type of the channel received |
|---|
| 764 | |
|---|
| 765 | See Also: |
|---|
| 766 | None. |
|---|
| 767 | |
|---|
| 768 | ****************************************************************************/ |
|---|
| 769 | typedef enum BTHD_Modulation |
|---|
| 770 | { |
|---|
| 771 | BTHD_Modulation_eDqpsk=0, /* DQPSK Modulation */ |
|---|
| 772 | BTHD_Modulation_eQpsk=4, /* QPSK Modulation */ |
|---|
| 773 | BTHD_Modulation_e16Qam=16, /* 16-QAM Modulation */ |
|---|
| 774 | BTHD_Modulation_e64Qam=64 /* 64-QAM Modulation */ |
|---|
| 775 | } BTHD_Modulation; |
|---|
| 776 | |
|---|
| 777 | |
|---|
| 778 | /*************************************************************************** |
|---|
| 779 | Summary: |
|---|
| 780 | Enumeration for THD pull-in range. |
|---|
| 781 | |
|---|
| 782 | Description: |
|---|
| 783 | This enum specifies the pull-in range of THD core |
|---|
| 784 | |
|---|
| 785 | See Also: |
|---|
| 786 | None. |
|---|
| 787 | |
|---|
| 788 | ****************************************************************************/ |
|---|
| 789 | typedef enum BTHD_PullInRange |
|---|
| 790 | { |
|---|
| 791 | BTHD_PullInRange_eNarrow, /* carrier acquisition range is narrow +/-200kHz */ |
|---|
| 792 | BTHD_PullInRange_eWide /* carrier acquisition range is wide +/-600kHz */ |
|---|
| 793 | } BTHD_PullInRange; |
|---|
| 794 | |
|---|
| 795 | |
|---|
| 796 | /*************************************************************************** |
|---|
| 797 | Summary: |
|---|
| 798 | Enum for inband mode |
|---|
| 799 | |
|---|
| 800 | Description: |
|---|
| 801 | This enum specifies the mode for the inband receiver |
|---|
| 802 | |
|---|
| 803 | See Also: |
|---|
| 804 | None. |
|---|
| 805 | |
|---|
| 806 | ****************************************************************************/ |
|---|
| 807 | typedef enum BTHD_InbandMode |
|---|
| 808 | { |
|---|
| 809 | BTHD_InbandMode_eDvbt, /* DVB-T */ |
|---|
| 810 | BTHD_InbandMode_eIsdbt /* ISDB-T */ |
|---|
| 811 | } BTHD_InbandMode; |
|---|
| 812 | |
|---|
| 813 | |
|---|
| 814 | /*************************************************************************** |
|---|
| 815 | Summary: |
|---|
| 816 | Enumeration for receiver transmission mode |
|---|
| 817 | |
|---|
| 818 | Description: |
|---|
| 819 | This enum specifies the transmission mode of the channel received |
|---|
| 820 | |
|---|
| 821 | See Also: |
|---|
| 822 | None. |
|---|
| 823 | |
|---|
| 824 | ****************************************************************************/ |
|---|
| 825 | typedef enum BTHD_TransmissionMode |
|---|
| 826 | { |
|---|
| 827 | BTHD_TransmissionMode_e2K=2, /* 2K Mode */ |
|---|
| 828 | BTHD_TransmissionMode_e4K=4, /* 4K Mode */ |
|---|
| 829 | BTHD_TransmissionMode_e8K=8 /* 8K Mode */ |
|---|
| 830 | } BTHD_TransmissionMode; |
|---|
| 831 | |
|---|
| 832 | /*************************************************************************** |
|---|
| 833 | Summary: |
|---|
| 834 | Enumeration for receiver guard interval |
|---|
| 835 | |
|---|
| 836 | Description: |
|---|
| 837 | This enum specifies the guard interval of the channel received |
|---|
| 838 | |
|---|
| 839 | See Also: |
|---|
| 840 | None. |
|---|
| 841 | |
|---|
| 842 | ****************************************************************************/ |
|---|
| 843 | typedef enum BTHD_GuardInterval |
|---|
| 844 | { |
|---|
| 845 | BTHD_GuardInterval_e1_32=32, /* Guard 1/32 */ |
|---|
| 846 | BTHD_GuardInterval_e1_16=16, /* Guard 1/16 */ |
|---|
| 847 | BTHD_GuardInterval_e1_8=8, /* Guard 1/8 */ |
|---|
| 848 | BTHD_GuardInterval_e1_4=4 /* Guard 1/4 */ |
|---|
| 849 | } BTHD_GuardInterval; |
|---|
| 850 | |
|---|
| 851 | /*************************************************************************** |
|---|
| 852 | Summary: |
|---|
| 853 | Enumeration for receiver code rate |
|---|
| 854 | |
|---|
| 855 | Description: |
|---|
| 856 | This enum specifies the code rate of the channel received |
|---|
| 857 | |
|---|
| 858 | See Also: |
|---|
| 859 | None. |
|---|
| 860 | |
|---|
| 861 | ****************************************************************************/ |
|---|
| 862 | typedef enum BTHD_CodeRate |
|---|
| 863 | { |
|---|
| 864 | BTHD_CodeRate_e1_2=2, /* Rate 1/2 */ |
|---|
| 865 | BTHD_CodeRate_e2_3=3, /* Rate 2/3 */ |
|---|
| 866 | BTHD_CodeRate_e3_4=4, /* Rate 3/4 */ |
|---|
| 867 | BTHD_CodeRate_e5_6=6, /* Rate 5/6 */ |
|---|
| 868 | BTHD_CodeRate_e7_8=8 /* Rate 7/8 */ |
|---|
| 869 | } BTHD_CodeRate; |
|---|
| 870 | |
|---|
| 871 | /*************************************************************************** |
|---|
| 872 | Summary: |
|---|
| 873 | Enumeration for DVB-T hierarchical mode |
|---|
| 874 | |
|---|
| 875 | Description: |
|---|
| 876 | This enum specifies the hierarchy of the channel received |
|---|
| 877 | |
|---|
| 878 | See Also: |
|---|
| 879 | None. |
|---|
| 880 | |
|---|
| 881 | ****************************************************************************/ |
|---|
| 882 | typedef enum BTHD_Hierarchy |
|---|
| 883 | { |
|---|
| 884 | BTHD_Hierarchy_0=0, /* select hierarchy = 0 */ |
|---|
| 885 | BTHD_Hierarchy_1=1, /* select hierarchy = 1 */ |
|---|
| 886 | BTHD_Hierarchy_2=2, /* select hierarchy = 2 */ |
|---|
| 887 | BTHD_Hierarchy_4=4 /* select hierarchy = 4 */ |
|---|
| 888 | } BTHD_Hierarchy; |
|---|
| 889 | |
|---|
| 890 | /*************************************************************************** |
|---|
| 891 | Summary: |
|---|
| 892 | Enumeration for ISDB-T time interleaving |
|---|
| 893 | |
|---|
| 894 | Description: |
|---|
| 895 | This enum specifies the ISDB-T time interleaving mode |
|---|
| 896 | |
|---|
| 897 | See Also: |
|---|
| 898 | None. |
|---|
| 899 | |
|---|
| 900 | ****************************************************************************/ |
|---|
| 901 | typedef enum BTHD_IsdbtTimeInterleaving |
|---|
| 902 | { |
|---|
| 903 | BTHD_IsdbtTimeInterleaving_0X, |
|---|
| 904 | BTHD_IsdbtTimeInterleaving_1X, |
|---|
| 905 | BTHD_IsdbtTimeInterleaving_2X, |
|---|
| 906 | BTHD_IsdbtTimeInterleaving_3X |
|---|
| 907 | }BTHD_IsdbtTimeInterleaving; |
|---|
| 908 | |
|---|
| 909 | /*************************************************************************** |
|---|
| 910 | Summary: |
|---|
| 911 | Enumeration for NICAM audio recevier current encoder mode |
|---|
| 912 | |
|---|
| 913 | Description: |
|---|
| 914 | This enum specifies the NICAM encoder modes |
|---|
| 915 | |
|---|
| 916 | See Also: |
|---|
| 917 | None. |
|---|
| 918 | |
|---|
| 919 | ****************************************************************************/ |
|---|
| 920 | typedef enum BTHD_NicamEncoderMode |
|---|
| 921 | { |
|---|
| 922 | BTHD_Stereo_BackupFm=1, |
|---|
| 923 | BTHD_DualMono_BackupFm=5, |
|---|
| 924 | BTHD_Stereo_NoBackup=0, |
|---|
| 925 | BTHD_DualMono_NoBackup=4, |
|---|
| 926 | BTHD_MonoData_NoBackup=8, |
|---|
| 927 | BTHD_MonoData_BackupFm=9, |
|---|
| 928 | BTHD_Data_NoBackup=12, |
|---|
| 929 | BTHD_Data_BackupFm=13 |
|---|
| 930 | } BTHD_NicamEncoderMode; |
|---|
| 931 | |
|---|
| 932 | /*************************************************************************** |
|---|
| 933 | Summary: |
|---|
| 934 | Enumeration for receiver mode |
|---|
| 935 | |
|---|
| 936 | Description: |
|---|
| 937 | This enum specifies the receiver modes |
|---|
| 938 | |
|---|
| 939 | See Also: |
|---|
| 940 | None. |
|---|
| 941 | |
|---|
| 942 | ****************************************************************************/ |
|---|
| 943 | typedef enum BTHD_ThdMode |
|---|
| 944 | { |
|---|
| 945 | BTHD_Mode_eAuto = 0, |
|---|
| 946 | BTHD_Mode_eFixed=1, |
|---|
| 947 | BTHD_Mode_ePederstrian=2, |
|---|
| 948 | BTHD_Mode_eMobile=3 |
|---|
| 949 | } BTHD_ThdMode; |
|---|
| 950 | |
|---|
| 951 | |
|---|
| 952 | /*************************************************************************** |
|---|
| 953 | Summary: |
|---|
| 954 | Enumeration for receiver mode |
|---|
| 955 | |
|---|
| 956 | Description: |
|---|
| 957 | This enum specifies the receiver modes |
|---|
| 958 | |
|---|
| 959 | See Also: |
|---|
| 960 | None. |
|---|
| 961 | |
|---|
| 962 | ****************************************************************************/ |
|---|
| 963 | typedef enum BTHD_ModeGuard |
|---|
| 964 | { |
|---|
| 965 | BTHD_ModeGuard_eManual = 0, |
|---|
| 966 | BTHD_ModeGuard_eAuto=1, |
|---|
| 967 | BTHD_ModeGuard_eAutoDvbt=2, |
|---|
| 968 | BTHD_ModeGuard_eAutoIsdbt=3 |
|---|
| 969 | } BTHD_ModeGuard; |
|---|
| 970 | |
|---|
| 971 | /*************************************************************************** |
|---|
| 972 | Summary: |
|---|
| 973 | Enumeration for Lock Status |
|---|
| 974 | |
|---|
| 975 | Description: |
|---|
| 976 | This enumeration represents the lock status of of a THD channel. |
|---|
| 977 | |
|---|
| 978 | See Also: |
|---|
| 979 | |
|---|
| 980 | ****************************************************************************/ |
|---|
| 981 | typedef enum BTHD_LockStatus |
|---|
| 982 | { |
|---|
| 983 | BTHD_LockStatus_eUnlocked, |
|---|
| 984 | BTHD_LockStatus_eLocked, |
|---|
| 985 | BTHD_LockStatus_eNoSignal, |
|---|
| 986 | BTHD_LockStatus_eLast |
|---|
| 987 | } BTHD_LockStatus; |
|---|
| 988 | |
|---|
| 989 | |
|---|
| 990 | /*************************************************************************** |
|---|
| 991 | Summary: |
|---|
| 992 | Structure for inband acquisition |
|---|
| 993 | |
|---|
| 994 | Description: |
|---|
| 995 | This structure contains parameters used for an inband channel acquisition. |
|---|
| 996 | |
|---|
| 997 | See Also: |
|---|
| 998 | BTHD_Bandwidth, BTHD_CCIMode, BTHD_DecodeMode, BTHD_InbandMode |
|---|
| 999 | |
|---|
| 1000 | ****************************************************************************/ |
|---|
| 1001 | typedef struct BTHD_InbandParams |
|---|
| 1002 | { |
|---|
| 1003 | /* Common Parameters */ |
|---|
| 1004 | BTHD_InbandMode mode; /* Selects inband mode (DVB-T or ISDB-T)*/ |
|---|
| 1005 | BTHD_Bandwidth bandwidth; /* Selects bandwidth of input signal */ |
|---|
| 1006 | uint32_t tunerFreq; /* Set the current tuner frequency in Hz */ |
|---|
| 1007 | uint32_t ifFreq; /* Selects IF freqeuncy in Hz, only used in 3556 */ |
|---|
| 1008 | BTHD_CCIMode cciMode; /* Selects co-channel filter options */ |
|---|
| 1009 | BTHD_PullInRange ePullinRange; /* Set wide or narrow carrier acquisition range */ |
|---|
| 1010 | BTHD_ModeGuard eModeGuardAcquire; /* If Manual, caller will provide eTransmissionMode and eGuardInterval, else if true, receiver automatically discovers this info */ |
|---|
| 1011 | BTHD_TransmissionMode eTransmissionMode; /* Manually set the transmission mode. Only used if bModeGuardAcquire=false */ |
|---|
| 1012 | BTHD_GuardInterval eGuardInterval; /* Manually set the guard interval. Only used if bModeGuardAcquire=false */ |
|---|
| 1013 | bool bTuneAcquire; /* This bit directs the Downstream Demodulator to initiate an acquire immediately after its associated WFE or Tuner is tuned. |
|---|
| 1014 | If the bit is set, then the Demodulator will initiate an acquire immediately after the tuner has completed a tune regardless of autoacquire. |
|---|
| 1015 | Note: Unless otherwise indicated, this flag only applies to the Acquisition Processors Internal WFE or Internal Tuner. */ |
|---|
| 1016 | |
|---|
| 1017 | /* DVB-T Specific Parameters */ |
|---|
| 1018 | BTHD_DecodeMode decodeMode; /* Selects the DVB-T hierarchical stream to decode (High Priority or Low Priority) */ |
|---|
| 1019 | bool bTpsAcquire; /* If false, caller will provide the {modulation,high priority code rate, low priority code rate, hierarchy } TPS parameters. Only used if mode-DVB-T */ |
|---|
| 1020 | BTHD_Modulation eModulation; /* Manually set DVB-T modulation type. Only used if mode=DVB-T and bTpsAcquire=false */ |
|---|
| 1021 | BTHD_CodeRate eCodeRateHP; /* Manually set DVB-T high priority code rate. Only used if mode=DVB-T and bTpsAcquire=false */ |
|---|
| 1022 | BTHD_CodeRate eCodeRateLP; /* Manually set DVB-T low priority code rate. Only used if mode=DVB-T and bTpsAcquire=false */ |
|---|
| 1023 | BTHD_Hierarchy eHierarchy; /* Manually set DVB-T hierarchy. Only used if mode=DVB-T and bTpsAcquire=false */ |
|---|
| 1024 | |
|---|
| 1025 | /* ISDB-T Specific Parameters */ |
|---|
| 1026 | bool bTmccAcquire; /* If false, caller will provide the {partial reception, modulation, code rate, time interleaving, number of segments} TMCC parameters. Only used if mode=ISDB-T */ |
|---|
| 1027 | bool bIsdbtPartialReception; /* Manually set ISDB-T partial reception. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1028 | BTHD_Modulation eIsdbtAModulation; /* Manually set ISDB-T Layer A modulation type. Only usedd if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1029 | BTHD_CodeRate eIsdbtACodeRate; /* Manually set ISDB-T Layer A code rate. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1030 | BTHD_IsdbtTimeInterleaving eIsdbtATimeInterleaving; /* Manually set ISDB-T Layer A time interleaving. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1031 | uint32_t eIsdbtASegments; /* Manually set ISDB-T Layer A number of segments. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1032 | BTHD_Modulation eIsdbtBModulation; /* Manually set ISDB-T Layer B modulation type. Only usedd if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1033 | BTHD_CodeRate eIsdbtBCodeRate; /* Manually set ISDB-T Layer B code rate. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1034 | BTHD_IsdbtTimeInterleaving eIsdbtBTimeInterleaving; /* Manually set ISDB-T Layer B time interleaving. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1035 | uint32_t eIsdbtBSegments; /* Manually set ISDB-T Layer B number of segments. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1036 | BTHD_Modulation eIsdbtCModulation; /* Manually set ISDB-T Layer C modulation type. Only usedd if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1037 | BTHD_CodeRate eIsdbtCCodeRate; /* Manually set ISDB-T Layer C code rate. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1038 | BTHD_IsdbtTimeInterleaving eIsdbtCTimeInterleaving; /* Manually set ISDB-T Layer C time interleaving. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1039 | uint32_t eIsdbtCSegments; /* Manually set ISDB-T Layer C number of segments. Only used if mode=ISDB-T and bTmccAcquire=false */ |
|---|
| 1040 | BTHD_ThdAcquisitionMode eAcquisitionMode; |
|---|
| 1041 | } BTHD_InbandParams; |
|---|
| 1042 | |
|---|
| 1043 | |
|---|
| 1044 | /*************************************************************************** |
|---|
| 1045 | Summary: |
|---|
| 1046 | Structure for THD status |
|---|
| 1047 | |
|---|
| 1048 | Description: |
|---|
| 1049 | This structure contains THD status |
|---|
| 1050 | |
|---|
| 1051 | See Also: |
|---|
| 1052 | None. |
|---|
| 1053 | |
|---|
| 1054 | ****************************************************************************/ |
|---|
| 1055 | typedef struct BTHD_THDStatus |
|---|
| 1056 | { |
|---|
| 1057 | /* Common Fields */ |
|---|
| 1058 | BTHD_InbandParams acqParams; /* Input parameters from most recent acquisition */ |
|---|
| 1059 | bool bReceiverLock; /* Receiver lock indicator */ |
|---|
| 1060 | bool bFecLock; /* FEC lock indicator */ |
|---|
| 1061 | bool bNoSignalDetected; /* OFDM signal detected indicator. Should only be used by channel scan as a flag to move on to the next channel */ |
|---|
| 1062 | BTHD_TransmissionMode eTransmissionMode; /* Transmission mode */ |
|---|
| 1063 | BTHD_GuardInterval eGuardInterval; /* Guard interval */ |
|---|
| 1064 | uint32_t ulRFAgc; /* RF Agc value in 1/10 percent */ |
|---|
| 1065 | uint32_t ulIFAgc; /* IF Agc value in 1/10 percent */ |
|---|
| 1066 | int16_t nSignalStrength; /* Signal strength in 1/100th of a dBmV. Not available on BCM3556 */ |
|---|
| 1067 | int32_t lCarrierOffset; /* Carrier offset in Hz */ |
|---|
| 1068 | int32_t lTimingOffset; /* Timing offset in Hz */ |
|---|
| 1069 | int16_t nSnr; /* SNR in 1/256th dB */ |
|---|
| 1070 | bool bSpectrumInverted; /* Spectral inversion indicator */ |
|---|
| 1071 | uint32_t ulReacqCount; /* Number of reacquisitions performed */ |
|---|
| 1072 | bool bValid; /* Indicates status structure returned is valid. When this is false, the application should ignore all status returned */ |
|---|
| 1073 | |
|---|
| 1074 | /* DVB-T Specific Fields */ |
|---|
| 1075 | BTHD_DecodeMode eDecodeMode; /* DVB-T hierarchical decode mode (priority) that was set in the acquire parameters */ |
|---|
| 1076 | BTHD_Modulation eModulation; /* DVB-T modulation type */ |
|---|
| 1077 | BTHD_CodeRate eCodeRate; /* DVB-T code rate */ |
|---|
| 1078 | BTHD_Hierarchy eHierarchy; /* DVB-T hierarchy */ |
|---|
| 1079 | uint16_t nCellId; /* DVB-T cell Id */ |
|---|
| 1080 | |
|---|
| 1081 | uint32_t ulRsCorrectedBlocks; /* DVB-T accumulated corrected RS blocks */ |
|---|
| 1082 | uint32_t ulRsUncorrectedBlocks; /* DVB-T accumlated uncorrected RS blocks */ |
|---|
| 1083 | uint32_t ulRsCleanBlocks; /* DVB-T accumlated clean RS blocks */ |
|---|
| 1084 | uint32_t ulRsTotalBlocks; /* DVB-T accumalted total RS blocks */ |
|---|
| 1085 | uint32_t ulViterbiUncorrectedBits; /* DVB-T accumlated error bits after Viterbi */ |
|---|
| 1086 | uint32_t ulViterbiTotalbits; /* DVB-T accumlated total bits after Viterbi */ |
|---|
| 1087 | uint32_t ulViterbiBer; /* DVB-T Viterbi bit error rate in 1/2147483648 th unit. To calculate the actual rate, take the value and divide by 2147483648 */ |
|---|
| 1088 | uint32_t ulPreViterbiBer; /* DVB-T pre-Viterbi bit error rate in 1/2147483648 th unit. To calculate the actual rate, take the value and divide by 2147483648 */ |
|---|
| 1089 | uint8_t signalLevelPercent; /* Signal Level Percent represents the Signal Strength of the received signal in percent */ |
|---|
| 1090 | uint8_t signalQualityPercent; /* Signal Quality Percent represents the Signal Quality of the received signal in percent */ |
|---|
| 1091 | |
|---|
| 1092 | /* ISDB-T Specific Fields */ |
|---|
| 1093 | bool bIsdbtEWS; /* ISDB-T Emergency Warning System EWS indicator */ |
|---|
| 1094 | bool bIsdbtPartialReception; /* ISDB-T partial reception */ |
|---|
| 1095 | |
|---|
| 1096 | BTHD_Modulation eIsdbtAModulation; /* ISDB-T Layer A modulation type */ |
|---|
| 1097 | BTHD_CodeRate eIsdbtACodeRate; /* ISDB-T Layer A code rate */ |
|---|
| 1098 | BTHD_IsdbtTimeInterleaving eIsdbtATimeInterleaving; /* ISDB-T Layer A time interleaving */ |
|---|
| 1099 | uint32_t eIsdbtASegments; /* ISDB-T Layer A number of segments */ |
|---|
| 1100 | uint32_t ulIsdbtARsCorrectedBlocks; /* ISDB-T Layer A accumulated corrected RS blocks */ |
|---|
| 1101 | uint32_t ulIsdbtARsUncorrectedBlocks; /* ISDB-T Layer A accumlated uncorrected RS blocks */ |
|---|
| 1102 | uint32_t ulIsdbtARsCleanBlocks; /* ISDB-T Layer A accumlated clean RS blocks */ |
|---|
| 1103 | uint32_t ulIsdbtARsTotalBlocks; /* ISDB-T Layer A accumalted total RS blocks */ |
|---|
| 1104 | uint32_t ulIsdbtAViterbiUncorrectedBits; /* ISDB-T Layer A accumlated error bits after Viterbi */ |
|---|
| 1105 | uint32_t ulIsdbtAViterbiTotalbits; /* ISDB-T Layer A accumlated total bits after Viterbi */ |
|---|
| 1106 | |
|---|
| 1107 | BTHD_Modulation eIsdbtBModulation; /* ISDB-T Layer B modulation type */ |
|---|
| 1108 | BTHD_CodeRate eIsdbtBCodeRate; /* ISDB-T Layer B code rate */ |
|---|
| 1109 | BTHD_IsdbtTimeInterleaving eIsdbtBTimeInterleaving; /* ISDB-T Layer B time interleaving */ |
|---|
| 1110 | uint32_t eIsdbtBSegments; /* ISDB-T Layer B number of segments */ |
|---|
| 1111 | uint32_t ulIsdbtBRsCorrectedBlocks; /* ISDB-T Layer B accumulated corrected RS blocks */ |
|---|
| 1112 | uint32_t ulIsdbtBRsUncorrectedBlocks; /* ISDB-T Layer B accumlated uncorrected RS blocks */ |
|---|
| 1113 | uint32_t ulIsdbtBRsCleanBlocks; /* ISDB-T Layer B accumlated clean RS blocks */ |
|---|
| 1114 | uint32_t ulIsdbtBRsTotalBlocks; /* ISDB-T Layer B accumalted total RS blocks */ |
|---|
| 1115 | uint32_t ulIsdbtBViterbiUncorrectedBits; /* ISDB-T Layer B accumlated error bits after Viterbi */ |
|---|
| 1116 | uint32_t ulIsdbtBViterbiTotalbits; /* ISDB-T Layer B accumlated total bits after Viterbi */ |
|---|
| 1117 | |
|---|
| 1118 | BTHD_Modulation eIsdbtCModulation; /* ISDB-T Layer C modulation type */ |
|---|
| 1119 | BTHD_CodeRate eIsdbtCCodeRate; /* ISDB-T Layer C code rate */ |
|---|
| 1120 | BTHD_IsdbtTimeInterleaving eIsdbtCTimeInterleaving; /* ISDB-T Layer C time interleaving */ |
|---|
| 1121 | uint32_t eIsdbtCSegments; /* ISDB-T Layer C number of segments */ |
|---|
| 1122 | uint32_t ulIsdbtCRsCorrectedBlocks; /* ISDB-T Layer C accumulated corrected RS blocks */ |
|---|
| 1123 | uint32_t ulIsdbtCRsUncorrectedBlocks; /* ISDB-T Layer C accumlated uncorrected RS blocks */ |
|---|
| 1124 | uint32_t ulIsdbtCRsCleanBlocks; /* ISDB-T Layer C accumlated clean RS blocks */ |
|---|
| 1125 | uint32_t ulIsdbtCRsTotalBlocks; /* ISDB-T Layer C accumalted total RS blocks */ |
|---|
| 1126 | uint32_t ulIsdbtCViterbiUncorrectedBits; /* ISDB-T Layer C accumlated error bits after Viterbi */ |
|---|
| 1127 | uint32_t ulIsdbtCViterbiTotalbits; /* ISDB-T Layer C accumlated total bits after Viterbi */ |
|---|
| 1128 | } BTHD_THDStatus; |
|---|
| 1129 | |
|---|
| 1130 | /*************************************************************************** |
|---|
| 1131 | Summary: |
|---|
| 1132 | Structure for IFD status |
|---|
| 1133 | |
|---|
| 1134 | Description: |
|---|
| 1135 | This structure contains IFD status |
|---|
| 1136 | |
|---|
| 1137 | See Also: |
|---|
| 1138 | None. |
|---|
| 1139 | |
|---|
| 1140 | ****************************************************************************/ |
|---|
| 1141 | typedef struct BTHD_IfdStatus |
|---|
| 1142 | { |
|---|
| 1143 | BTHD_IfdParams acqParams; /* input parameters from most recent acquisition */ |
|---|
| 1144 | bool bHsyncLocked; /* true if HSYNC is locked */ |
|---|
| 1145 | uint32_t pixCarrFreq; /* pix carrier freq in Hz */ |
|---|
| 1146 | int32_t pixCarrFreqError; /* pix carrier error in Hz */ |
|---|
| 1147 | uint32_t rf_agc; /* AGT_DELTA_SIGMA level in units of 1/10 percent */ |
|---|
| 1148 | uint32_t if_agc; /* AGI_DELTA_SIGMA level in units of 1/10 percent */ |
|---|
| 1149 | bool bNicamLock; /* True if NICAM is locked */ |
|---|
| 1150 | uint32_t ulNicamSnr; /* NICAM slicer SNR */ |
|---|
| 1151 | uint32_t ulNicamParityError; /* Number of parity errors in the current frame */ |
|---|
| 1152 | uint32_t ulNicamErrorCount; /* Number of bit errors in the last 128 frames */ |
|---|
| 1153 | BTHD_NicamEncoderMode eNicamEncoderMode; /* Current NICAM encoder mode */ |
|---|
| 1154 | uint32_t ulAVRatio1Hi; /* AV Ratio in linear units (upper 32 bits) */ |
|---|
| 1155 | uint32_t ulAVRatio1Lo; /* AV Ratio in linear units (lower 32 bits) */ |
|---|
| 1156 | uint32_t ulAVRatio2Hi; /* AV Ratio for 2nd audio carrioer in linear units (upper 32 bits) */ |
|---|
| 1157 | uint32_t ulAVRatio2Lo; /* AV Ratio for 2nd audio carrioer in linear units (lower 32 bits) */ |
|---|
| 1158 | uint32_t ulAudioCarrier2Variance; /* Carrier Average Or Variance Read of 2nd audio carrier */ |
|---|
| 1159 | |
|---|
| 1160 | } BTHD_IfdStatus; |
|---|
| 1161 | |
|---|
| 1162 | /*************************************************************************** |
|---|
| 1163 | Summary: |
|---|
| 1164 | Structure for IFD audio settings |
|---|
| 1165 | |
|---|
| 1166 | Description: |
|---|
| 1167 | This structure is used to change the audio carrier frequency control |
|---|
| 1168 | word. Since there is only a finite set of possible carrier frequency |
|---|
| 1169 | we use the video/audio mode as index to the look up table |
|---|
| 1170 | |
|---|
| 1171 | See Also: |
|---|
| 1172 | None. |
|---|
| 1173 | |
|---|
| 1174 | ****************************************************************************/ |
|---|
| 1175 | typedef struct BTHD_IfdAudioSettings |
|---|
| 1176 | { |
|---|
| 1177 | BTHD_AnalogVideoMode eVideoMode; /* Selects analog video standards */ |
|---|
| 1178 | BTHD_AnalogAudioMode eAudioMode; /* Selects analog audio standards */ |
|---|
| 1179 | uint32_t ulCarrier2DecimationRatio; |
|---|
| 1180 | } BTHD_IfdAudioSettings; |
|---|
| 1181 | |
|---|
| 1182 | /*************************************************************************** |
|---|
| 1183 | Summary: |
|---|
| 1184 | Callback used for event notification. |
|---|
| 1185 | |
|---|
| 1186 | Description: |
|---|
| 1187 | When this PI wants to notify an application, it will call this callback |
|---|
| 1188 | function the callback function is registered. |
|---|
| 1189 | |
|---|
| 1190 | See Also: |
|---|
| 1191 | BTHD_InstallLockStateChangeCallback(), BTHD_InstallInterruptCallback() |
|---|
| 1192 | |
|---|
| 1193 | ****************************************************************************/ |
|---|
| 1194 | typedef BERR_Code (*BTHD_CallbackFunc)(void *pParam ); |
|---|
| 1195 | |
|---|
| 1196 | typedef struct BTHD_Settings BTHD_Settings; |
|---|
| 1197 | |
|---|
| 1198 | |
|---|
| 1199 | /*************************************************************************** |
|---|
| 1200 | Summary: |
|---|
| 1201 | Structure for API function table |
|---|
| 1202 | |
|---|
| 1203 | Description: |
|---|
| 1204 | This structure contains pointers to all public BTHD functions. |
|---|
| 1205 | |
|---|
| 1206 | See Also: |
|---|
| 1207 | None. |
|---|
| 1208 | |
|---|
| 1209 | ****************************************************************************/ |
|---|
| 1210 | typedef struct BTHD_ApiFunctTable |
|---|
| 1211 | { |
|---|
| 1212 | BERR_Code (*Open)(BTHD_Handle *, BCHP_Handle, void*, BINT_Handle, const BTHD_Settings *pDefSettings); |
|---|
| 1213 | BERR_Code (*Close)(BTHD_Handle); |
|---|
| 1214 | BERR_Code (*Init)(BTHD_Handle, const uint8_t *, uint32_t); |
|---|
| 1215 | BERR_Code (*ReadRegister)(BTHD_Handle, uint32_t, uint32_t*); |
|---|
| 1216 | BERR_Code (*WriteRegister)(BTHD_Handle, uint32_t, uint32_t*); |
|---|
| 1217 | BERR_Code (*Mi2cWrite)(BTHD_Handle, uint8_t, uint8_t*, uint8_t); |
|---|
| 1218 | BERR_Code (*Mi2cRead)(BTHD_Handle, uint8_t, uint8_t*, uint8_t, uint8_t*, uint8_t); |
|---|
| 1219 | BERR_Code (*SetAcquireParams)(BTHD_Handle, const BTHD_InbandParams*); |
|---|
| 1220 | BERR_Code (*GetAcquireParams)(BTHD_Handle, BTHD_InbandParams*); |
|---|
| 1221 | BERR_Code (*TuneAcquire)(BTHD_Handle, const BTHD_InbandParams*); |
|---|
| 1222 | BERR_Code (*GetThdStatus)(BTHD_Handle, BTHD_THDStatus *); |
|---|
| 1223 | BERR_Code (*ResetInbandStatus)(BTHD_Handle); |
|---|
| 1224 | BERR_Code (*GetChipRevision)(BTHD_Handle, uint8_t*); |
|---|
| 1225 | BERR_Code (*GetVersion)(BTHD_Handle, uint32_t*, uint32_t*); |
|---|
| 1226 | BERR_Code (*GetInterruptEventHandle)(BTHD_Handle, BKNI_EventHandle*); |
|---|
| 1227 | BERR_Code (*HandleInterrupt_isr)(BTHD_Handle); |
|---|
| 1228 | BERR_Code (*ProcessInterruptEvent)(BTHD_Handle); |
|---|
| 1229 | BERR_Code (*GetLockStateChangeEventHandle)(BTHD_Handle, BKNI_EventHandle*); |
|---|
| 1230 | BERR_Code (*AcquireIfd)(BTHD_Handle, const BTHD_IfdParams*); |
|---|
| 1231 | BERR_Code (*GetIfdStatus)(BTHD_Handle, BTHD_IfdStatus*); |
|---|
| 1232 | BERR_Code (*GetSoftDecisionBuf)(BTHD_Handle, int16_t*, int16_t*); |
|---|
| 1233 | BERR_Code (*GetDefaultInbandParams)(BTHD_InbandParams*); |
|---|
| 1234 | BERR_Code (*GetDefaultIfdParams)(BTHD_IfdParams*); |
|---|
| 1235 | BERR_Code (*ResetIfdStatus)(BTHD_Handle); |
|---|
| 1236 | BERR_Code (*SetIfdAudioSettings)(BTHD_Handle, const BTHD_IfdAudioSettings*); |
|---|
| 1237 | BERR_Code (*GetIfdAudioSettings)(BTHD_Handle, BTHD_IfdAudioSettings*); |
|---|
| 1238 | BERR_Code (*PowerUp)(BTHD_Handle); |
|---|
| 1239 | BERR_Code (*PowerDown)(BTHD_Handle); |
|---|
| 1240 | BERR_Code (*GetEWSEventHandle)(BTHD_Handle, BKNI_EventHandle*); |
|---|
| 1241 | BERR_Code (*GetThdLockStatus)(BTHD_Handle, BTHD_LockStatus *); |
|---|
| 1242 | BERR_Code (*GetBBSInterruptEventHandle)(BTHD_Handle, BKNI_EventHandle*); |
|---|
| 1243 | BERR_Code (*ProcessBBSInterruptEvent)(BTHD_Handle); |
|---|
| 1244 | BERR_Code (*RequestThdAsyncStatus)(BTHD_Handle); |
|---|
| 1245 | BERR_Code (*GetThdAsyncStatus)(BTHD_Handle, BTHD_THDStatus *); |
|---|
| 1246 | BERR_Code (*InstallCallback)(BTHD_Handle, BTHD_Callback, BTHD_CallbackFunc, void *); |
|---|
| 1247 | } BTHD_ApiFunctTable; |
|---|
| 1248 | |
|---|
| 1249 | /*************************************************************************** |
|---|
| 1250 | Summary: |
|---|
| 1251 | Structure for THD settings |
|---|
| 1252 | |
|---|
| 1253 | Description: |
|---|
| 1254 | This structure contains the settings for the BTHD PI. |
|---|
| 1255 | |
|---|
| 1256 | See Also: |
|---|
| 1257 | None. |
|---|
| 1258 | |
|---|
| 1259 | |
|---|
| 1260 | ****************************************************************************/ |
|---|
| 1261 | struct BTHD_Settings |
|---|
| 1262 | { |
|---|
| 1263 | BTHD_I2cSettings i2c; /* i2c settings */ |
|---|
| 1264 | BTHD_ApiFunctTable api; |
|---|
| 1265 | BTMR_Handle hTmr; /* Timer used for IFD acqusition, not need in 2940 */ |
|---|
| 1266 | bool bRfDeltaSigmaInvert; /* Inverts RF delta sigma pin */ |
|---|
| 1267 | bool bIfDeltaSigmaInvert; /* Inverts IF delta sigma pin */ |
|---|
| 1268 | BTHD_AgcPinMode IfAgcPinMode; /* specifis the voltage swing of RF delta sigma pin */ |
|---|
| 1269 | BMEM_Heap_Handle hHeap; |
|---|
| 1270 | bool bIfAgcZero; /* Turns off IF AGC in the chip */ |
|---|
| 1271 | void *hGeneric; /* generic handle can be used for anything */ |
|---|
| 1272 | bool supportIsdbt; |
|---|
| 1273 | }; |
|---|
| 1274 | |
|---|
| 1275 | /****************************************************************************** |
|---|
| 1276 | Summary: |
|---|
| 1277 | Initializes the BTHD API. |
|---|
| 1278 | Description: |
|---|
| 1279 | This function must be called first to get a BTHD_Handle. This handle is |
|---|
| 1280 | used by all other function calls in the BTHD API. |
|---|
| 1281 | Returns: |
|---|
| 1282 | BERR_Code |
|---|
| 1283 | ******************************************************************************/ |
|---|
| 1284 | BERR_Code BTHD_Open( |
|---|
| 1285 | BTHD_Handle *h, /* [out] BTHD handle */ |
|---|
| 1286 | BCHP_Handle hChip, /* [in] chip handle */ |
|---|
| 1287 | void *pReg, /* [in] pointer to register or i2c handle */ |
|---|
| 1288 | BINT_Handle hInterrupt, /* [in] interrupt handle */ |
|---|
| 1289 | const BTHD_Settings *pDefSettings /* [in] default settings */ |
|---|
| 1290 | ); |
|---|
| 1291 | |
|---|
| 1292 | /****************************************************************************** |
|---|
| 1293 | Summary: |
|---|
| 1294 | Closes the BTHD API. |
|---|
| 1295 | Description: |
|---|
| 1296 | This function releases all the resources allocated by BTHD API and disables |
|---|
| 1297 | BCM3520 host interrupts. |
|---|
| 1298 | Returns: |
|---|
| 1299 | BERR_Code |
|---|
| 1300 | ******************************************************************************/ |
|---|
| 1301 | BERR_Code BTHD_Close( |
|---|
| 1302 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1303 | ); |
|---|
| 1304 | |
|---|
| 1305 | |
|---|
| 1306 | /****************************************************************************** |
|---|
| 1307 | Summary: |
|---|
| 1308 | Downloads the microcode and runs the AP. |
|---|
| 1309 | Description: |
|---|
| 1310 | This function downloads the microcode to the AP RAM and then starts running |
|---|
| 1311 | the AP. |
|---|
| 1312 | Returns: |
|---|
| 1313 | BERR_Code : BERR_SUCCESS = AP is running and successfully initialized |
|---|
| 1314 | ******************************************************************************/ |
|---|
| 1315 | BERR_Code BTHD_Init( |
|---|
| 1316 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1317 | const uint8_t *pImage, /* [in] pointer to microcode image. Set to NULL to use default image */ |
|---|
| 1318 | uint32_t imageLength /* [in] length of image. Set to 0 when using default image */ |
|---|
| 1319 | ); |
|---|
| 1320 | |
|---|
| 1321 | /****************************************************************************** |
|---|
| 1322 | Summary: |
|---|
| 1323 | Reads a register. |
|---|
| 1324 | Description: |
|---|
| 1325 | This function reads a register. This function is normally used for |
|---|
| 1326 | non-memory mapped BTHD devices, such as BCM3520. |
|---|
| 1327 | Returns: |
|---|
| 1328 | BERR_Code |
|---|
| 1329 | ******************************************************************************/ |
|---|
| 1330 | BERR_Code BTHD_ReadRegister( |
|---|
| 1331 | BTHD_Handle hTHD, /* [in] BTHD handle */ |
|---|
| 1332 | uint32_t reg, /* [in] address of register to read */ |
|---|
| 1333 | uint32_t *val /* [in] contains data that was read */ |
|---|
| 1334 | ); |
|---|
| 1335 | |
|---|
| 1336 | |
|---|
| 1337 | /****************************************************************************** |
|---|
| 1338 | Summary: |
|---|
| 1339 | Writes a register. |
|---|
| 1340 | Description: |
|---|
| 1341 | This function writes to a register. This function is normally used for |
|---|
| 1342 | non-memory mapped BTHD devices, such as BCM3520. |
|---|
| 1343 | Returns: |
|---|
| 1344 | BERR_Code |
|---|
| 1345 | ******************************************************************************/ |
|---|
| 1346 | BERR_Code BTHD_WriteRegister( |
|---|
| 1347 | BTHD_Handle hTHD, /* [in] BTHD handle */ |
|---|
| 1348 | uint32_t reg, /* [in] address of register to write */ |
|---|
| 1349 | uint32_t *val /* [in] contains data to write */ |
|---|
| 1350 | ); |
|---|
| 1351 | |
|---|
| 1352 | |
|---|
| 1353 | /****************************************************************************** |
|---|
| 1354 | Summary: |
|---|
| 1355 | Initiates an I2C write transaction from the front end device's I2C |
|---|
| 1356 | controller. |
|---|
| 1357 | Description: |
|---|
| 1358 | This function programs the front end device's master i2c controller to |
|---|
| 1359 | transmit the data given in buf[]. If there is no master i2c controller on |
|---|
| 1360 | the front end device, this function will return BERR_NOT_SUPPORTED. |
|---|
| 1361 | Returns: |
|---|
| 1362 | BERR_Code |
|---|
| 1363 | ******************************************************************************/ |
|---|
| 1364 | BERR_Code BTHD_Mi2cWrite( |
|---|
| 1365 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1366 | uint8_t slave_addr, /* [in] address of the i2c slave device */ |
|---|
| 1367 | uint8_t *buf, /* [in] specifies the data to transmit */ |
|---|
| 1368 | uint8_t n /* [in] number of bytes to transmit after the i2c slave address */ |
|---|
| 1369 | ); |
|---|
| 1370 | |
|---|
| 1371 | |
|---|
| 1372 | /****************************************************************************** |
|---|
| 1373 | Summary: |
|---|
| 1374 | Initiates an I2C read transaction from the front end device's I2C |
|---|
| 1375 | controller. |
|---|
| 1376 | Description: |
|---|
| 1377 | This function programs the front end device's master i2c controller to |
|---|
| 1378 | transmit the data given in buf[]. If there is no master i2c controller on |
|---|
| 1379 | the front end device, this function will return BERR_NOT_SUPPORTED. |
|---|
| 1380 | Returns: |
|---|
| 1381 | BERR_Code |
|---|
| 1382 | ******************************************************************************/ |
|---|
| 1383 | BERR_Code BTHD_Mi2cRead( |
|---|
| 1384 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1385 | uint8_t slave_addr, /* [in] address of the i2c slave device */ |
|---|
| 1386 | uint8_t *out_buf, /* [in] specifies the data to transmit before the i2c restart condition */ |
|---|
| 1387 | uint8_t out_n, /* [in] number of bytes to transmit before the i2c restart condition not including the i2c slave address */ |
|---|
| 1388 | uint8_t *in_buf, /* [out] holds the data read */ |
|---|
| 1389 | uint8_t in_n /* [in] number of bytes to read after the i2c restart condition not including the i2c slave address */ |
|---|
| 1390 | ); |
|---|
| 1391 | |
|---|
| 1392 | /*************************************************************************** |
|---|
| 1393 | Summary: |
|---|
| 1394 | Sets the Acquire parameters for the inband channel. |
|---|
| 1395 | Description: |
|---|
| 1396 | Sets the Acquire parameters for the inband channel. |
|---|
| 1397 | Returns: |
|---|
| 1398 | BERR_Code |
|---|
| 1399 | |
|---|
| 1400 | ****************************************************************************/ |
|---|
| 1401 | BERR_Code BTHD_SetAcquireParams( |
|---|
| 1402 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1403 | const BTHD_InbandParams *pParams /* [in] inband acquisition parameters */ |
|---|
| 1404 | ); |
|---|
| 1405 | |
|---|
| 1406 | /*************************************************************************** |
|---|
| 1407 | Summary: |
|---|
| 1408 | Gets the Acquire parameters for the inband channel. |
|---|
| 1409 | Description: |
|---|
| 1410 | Gets the Acquire parameters for the inband channel. |
|---|
| 1411 | Returns: |
|---|
| 1412 | BERR_Code |
|---|
| 1413 | |
|---|
| 1414 | ****************************************************************************/ |
|---|
| 1415 | BERR_Code BTHD_GetAcquireParams( |
|---|
| 1416 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1417 | BTHD_InbandParams *pParams /* [out] inband acquisition parameters */ |
|---|
| 1418 | ); |
|---|
| 1419 | |
|---|
| 1420 | |
|---|
| 1421 | /****************************************************************************** |
|---|
| 1422 | Summary: |
|---|
| 1423 | Acquire the inband channel. |
|---|
| 1424 | Description: |
|---|
| 1425 | Tells the Thd core to start DVB-T channel acquisition. |
|---|
| 1426 | Returns: |
|---|
| 1427 | BERR_Code |
|---|
| 1428 | ******************************************************************************/ |
|---|
| 1429 | BERR_Code BTHD_TuneAcquire( |
|---|
| 1430 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1431 | const BTHD_InbandParams *pParams /* [in] inband acquisition parameters */ |
|---|
| 1432 | ); |
|---|
| 1433 | |
|---|
| 1434 | /****************************************************************************** |
|---|
| 1435 | Summary: |
|---|
| 1436 | Acquire the inband ananlog channel |
|---|
| 1437 | Description: |
|---|
| 1438 | Tells the IFD core to start channel acqusition |
|---|
| 1439 | Returns: |
|---|
| 1440 | BERR_Code |
|---|
| 1441 | ******************************************************************************/ |
|---|
| 1442 | BERR_Code BTHD_AcquireIfd( |
|---|
| 1443 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1444 | const BTHD_IfdParams *pParams /* [in] IFD acquisition parameters */ |
|---|
| 1445 | ); |
|---|
| 1446 | |
|---|
| 1447 | /****************************************************************************** |
|---|
| 1448 | Summary: |
|---|
| 1449 | Gets IFD status. |
|---|
| 1450 | Description: |
|---|
| 1451 | This function returns IFD status information. |
|---|
| 1452 | Returns: |
|---|
| 1453 | BERR_Code |
|---|
| 1454 | ******************************************************************************/ |
|---|
| 1455 | BERR_Code BTHD_GetIfdStatus( |
|---|
| 1456 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1457 | BTHD_IfdStatus *pIfdStatus /* [out] IFD Status structure */ |
|---|
| 1458 | ); |
|---|
| 1459 | |
|---|
| 1460 | /****************************************************************************** |
|---|
| 1461 | Summary: |
|---|
| 1462 | This function gets the status asynchronously of THD module channel. |
|---|
| 1463 | |
|---|
| 1464 | Description: |
|---|
| 1465 | This function is responsible for asynchronously getting the complete status |
|---|
| 1466 | for a THD module channel. BTHD_RequestThdAsyncStatus() is called to notify the |
|---|
| 1467 | frontend to calculate the status and notify the backend asynchronously |
|---|
| 1468 | that the status is ready then BTHD_GetAsyncThdStatus() needs to be called to |
|---|
| 1469 | retrieve the status. |
|---|
| 1470 | |
|---|
| 1471 | Returns: |
|---|
| 1472 | BERR_Code |
|---|
| 1473 | ******************************************************************************/ |
|---|
| 1474 | BERR_Code BTHD_RequestThdAsyncStatus( |
|---|
| 1475 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1476 | ); |
|---|
| 1477 | |
|---|
| 1478 | /****************************************************************************** |
|---|
| 1479 | Summary: |
|---|
| 1480 | Gets THD Async status. |
|---|
| 1481 | Description: |
|---|
| 1482 | This function returns THD Asyncstatus information. |
|---|
| 1483 | Returns: |
|---|
| 1484 | BERR_Code |
|---|
| 1485 | ******************************************************************************/ |
|---|
| 1486 | BERR_Code BTHD_GetThdAsyncStatus( |
|---|
| 1487 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1488 | BTHD_THDStatus *pStatus /* [out] THD status */ |
|---|
| 1489 | ); |
|---|
| 1490 | |
|---|
| 1491 | /****************************************************************************** |
|---|
| 1492 | Summary: |
|---|
| 1493 | Gets THD status. |
|---|
| 1494 | Description: |
|---|
| 1495 | This function returns THD status information. |
|---|
| 1496 | Returns: |
|---|
| 1497 | BERR_Code |
|---|
| 1498 | ******************************************************************************/ |
|---|
| 1499 | BERR_Code BTHD_GetThdStatus( |
|---|
| 1500 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1501 | BTHD_THDStatus *pStatus /* [out] THD status */ |
|---|
| 1502 | ); |
|---|
| 1503 | |
|---|
| 1504 | |
|---|
| 1505 | /****************************************************************************** |
|---|
| 1506 | Summary: |
|---|
| 1507 | Resets inband FEC bit error and block counters. |
|---|
| 1508 | Description: |
|---|
| 1509 | This function clears the following counters in BTHD_THDStatus/BTHD_QamStatus: |
|---|
| 1510 | corrErrCount, corrBlockCount, ucorrBlockCount, cleanBlockCount, and berCount |
|---|
| 1511 | Returns: |
|---|
| 1512 | BERR_Code |
|---|
| 1513 | ******************************************************************************/ |
|---|
| 1514 | BERR_Code BTHD_ResetInbandStatus( |
|---|
| 1515 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1516 | ); |
|---|
| 1517 | |
|---|
| 1518 | |
|---|
| 1519 | /****************************************************************************** |
|---|
| 1520 | Summary: |
|---|
| 1521 | Gets the currents settings for the BTHD PI. |
|---|
| 1522 | Description: |
|---|
| 1523 | This function returns the current settings being used on the BTHD PI. |
|---|
| 1524 | Returns: |
|---|
| 1525 | BERR_Code |
|---|
| 1526 | ******************************************************************************/ |
|---|
| 1527 | BERR_Code BTHD_GetSettings( |
|---|
| 1528 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1529 | BTHD_Settings *pSettings /* [out] current BTHD settings */ |
|---|
| 1530 | ); |
|---|
| 1531 | |
|---|
| 1532 | |
|---|
| 1533 | /****************************************************************************** |
|---|
| 1534 | Summary: |
|---|
| 1535 | Modifies the currents settings for the BTHD PI. |
|---|
| 1536 | Description: |
|---|
| 1537 | This function modifies the current settings for the BTHD PI. |
|---|
| 1538 | Returns: |
|---|
| 1539 | BERR_Code |
|---|
| 1540 | ******************************************************************************/ |
|---|
| 1541 | BERR_Code BTHD_SetSettings( |
|---|
| 1542 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1543 | BTHD_Settings *pSettings /* [in] new BTHD settings */ |
|---|
| 1544 | ); |
|---|
| 1545 | |
|---|
| 1546 | |
|---|
| 1547 | |
|---|
| 1548 | /****************************************************************************** |
|---|
| 1549 | Summary: |
|---|
| 1550 | This function returns the BTHD interrupt event handle. |
|---|
| 1551 | Description: |
|---|
| 1552 | This function is used for an i2c-controlled BTHD device only. The |
|---|
| 1553 | application will need to call this function to get the event handle |
|---|
| 1554 | for BTHD interrupts. The application will wait on this interrupt event. |
|---|
| 1555 | When this event is signalled, the application must call |
|---|
| 1556 | BTHD_ProcessInterruptEvent(). For memory-mapped BTHD devices, this function |
|---|
| 1557 | will return BERR_NOT_SUPPORTED. |
|---|
| 1558 | Returns: |
|---|
| 1559 | BERR_Code |
|---|
| 1560 | ******************************************************************************/ |
|---|
| 1561 | BERR_Code BTHD_GetInterruptEventHandle( |
|---|
| 1562 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1563 | BKNI_EventHandle *phEvent /* [out] event handle */ |
|---|
| 1564 | ); |
|---|
| 1565 | |
|---|
| 1566 | |
|---|
| 1567 | |
|---|
| 1568 | /****************************************************************************** |
|---|
| 1569 | Summary: |
|---|
| 1570 | This function returns the BTHD interrupt event handle. |
|---|
| 1571 | Description: |
|---|
| 1572 | Returns: |
|---|
| 1573 | BERR_Code |
|---|
| 1574 | ******************************************************************************/ |
|---|
| 1575 | BERR_Code BTHD_GetBBSInterruptEventHandle( |
|---|
| 1576 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1577 | BKNI_EventHandle *phEvent /* [out] event handle */ |
|---|
| 1578 | ); |
|---|
| 1579 | |
|---|
| 1580 | /****************************************************************************** |
|---|
| 1581 | Summary: |
|---|
| 1582 | Handle BTHD interrupts. |
|---|
| 1583 | Description: |
|---|
| 1584 | This function must be called when the host receives an interrupt from the |
|---|
| 1585 | BTHD device. |
|---|
| 1586 | Returns: |
|---|
| 1587 | BERR_Code |
|---|
| 1588 | ******************************************************************************/ |
|---|
| 1589 | BERR_Code BTHD_HandleInterrupt_isr( |
|---|
| 1590 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1591 | ); |
|---|
| 1592 | |
|---|
| 1593 | |
|---|
| 1594 | /****************************************************************************** |
|---|
| 1595 | Summary: |
|---|
| 1596 | This function processes BTHD interrupt events. |
|---|
| 1597 | Description: |
|---|
| 1598 | This function is used for an i2c-controlled BTHD device only. The |
|---|
| 1599 | application calls this function when a BTHD interrupt event has been |
|---|
| 1600 | signalled. This function will decode the interrupt and set approriate |
|---|
| 1601 | events. For memory-mapped BTHD devices, this function will return |
|---|
| 1602 | BERR_NOT_SUPPORTED. |
|---|
| 1603 | Returns: |
|---|
| 1604 | BERR_Code |
|---|
| 1605 | ******************************************************************************/ |
|---|
| 1606 | BERR_Code BTHD_ProcessInterruptEvent( |
|---|
| 1607 | BTHD_Handle hTHD /* [in] THD device handle */ |
|---|
| 1608 | ); |
|---|
| 1609 | |
|---|
| 1610 | |
|---|
| 1611 | /****************************************************************************** |
|---|
| 1612 | Summary: |
|---|
| 1613 | This function processes BTHD interrupt events. |
|---|
| 1614 | Description: |
|---|
| 1615 | |
|---|
| 1616 | Returns: |
|---|
| 1617 | BERR_Code |
|---|
| 1618 | ******************************************************************************/ |
|---|
| 1619 | BERR_Code BTHD_ProcessBBSInterruptEvent( |
|---|
| 1620 | BTHD_Handle hTHD /* [in] THD device handle */ |
|---|
| 1621 | ); |
|---|
| 1622 | |
|---|
| 1623 | |
|---|
| 1624 | /****************************************************************************** |
|---|
| 1625 | Summary: |
|---|
| 1626 | This function reads the chip id |
|---|
| 1627 | Description: |
|---|
| 1628 | This function is used to figure out which chip revision is the software |
|---|
| 1629 | connected to. The revision is important information as it determines which |
|---|
| 1630 | hexfile to download |
|---|
| 1631 | Returns: |
|---|
| 1632 | BERR_Code |
|---|
| 1633 | ******************************************************************************/ |
|---|
| 1634 | BERR_Code BTHD_GetChipRevision( |
|---|
| 1635 | BTHD_Handle hTHD, /* [in] THD device handle */ |
|---|
| 1636 | uint8_t* revision /* [out] Chip revision, for 3461 revision is 16 bits */ |
|---|
| 1637 | ); |
|---|
| 1638 | |
|---|
| 1639 | /****************************************************************************** |
|---|
| 1640 | Summary: |
|---|
| 1641 | This function reads THD software version |
|---|
| 1642 | Description: |
|---|
| 1643 | This function is used to figure out what version of the THD software is |
|---|
| 1644 | currently running. The revision is important information as it determines |
|---|
| 1645 | which firmware was downloaded |
|---|
| 1646 | Returns: |
|---|
| 1647 | BERR_Code |
|---|
| 1648 | ******************************************************************************/ |
|---|
| 1649 | BERR_Code BTHD_GetVersion( |
|---|
| 1650 | BTHD_Handle hTHD, /* [in] THD device handle */ |
|---|
| 1651 | uint32_t* version, /* [out] firmware revision, for 3461 version is lower 16 bits(e.g. Ver. 1.4 is represented by 0x00000104) */ |
|---|
| 1652 | uint32_t* checksum /* [out] firmware checksum */ |
|---|
| 1653 | ); |
|---|
| 1654 | |
|---|
| 1655 | /****************************************************************************** |
|---|
| 1656 | Summary: |
|---|
| 1657 | Returns the Lock State Change event handle. |
|---|
| 1658 | Description: |
|---|
| 1659 | If the application wants to know when the downstream channel goes in lock or |
|---|
| 1660 | out of lock, it should use this function to get a handle to the Lock State |
|---|
| 1661 | Change event. This event is set whenever the downstream channel lock status |
|---|
| 1662 | changes. |
|---|
| 1663 | Returns: |
|---|
| 1664 | BERR_Code |
|---|
| 1665 | ******************************************************************************/ |
|---|
| 1666 | BERR_Code BTHD_GetLockStateChangeEventHandle( |
|---|
| 1667 | BTHD_Handle h, /* [in] BTHD channel handle */ |
|---|
| 1668 | BKNI_EventHandle *hEvent /* [out] lock event handle */ |
|---|
| 1669 | ); |
|---|
| 1670 | |
|---|
| 1671 | /****************************************************************************** |
|---|
| 1672 | Summary: |
|---|
| 1673 | Gets I/Q soft decisions for THD |
|---|
| 1674 | Description: |
|---|
| 1675 | This function is mainly used for inband QAM/VSB constellation display. This |
|---|
| 1676 | function returns 30 pairs of I/Q values. |
|---|
| 1677 | Returns: |
|---|
| 1678 | BERR_Code |
|---|
| 1679 | ******************************************************************************/ |
|---|
| 1680 | BERR_Code BTHD_GetSoftDecisionBuf( |
|---|
| 1681 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1682 | int16_t *pI, /* [out] 30 I-values */ |
|---|
| 1683 | int16_t *pQ /* [out] 30 Q-values */ |
|---|
| 1684 | ); |
|---|
| 1685 | |
|---|
| 1686 | /****************************************************************************** |
|---|
| 1687 | Summary: |
|---|
| 1688 | Gets default inband param settings used in DVB-T acquire |
|---|
| 1689 | Description: |
|---|
| 1690 | This function is used to get a set of default parameters that can be passed |
|---|
| 1691 | to the BTHD_TuneAcquire function |
|---|
| 1692 | Returns: |
|---|
| 1693 | BERR_Code |
|---|
| 1694 | ******************************************************************************/ |
|---|
| 1695 | BERR_Code BTHD_GetDefaultInbandParams( |
|---|
| 1696 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1697 | BTHD_InbandParams* pDefInbandParam /* [out] default param */ |
|---|
| 1698 | ); |
|---|
| 1699 | |
|---|
| 1700 | /****************************************************************************** |
|---|
| 1701 | Summary: |
|---|
| 1702 | Gets default inband param settings used in IFD acquire |
|---|
| 1703 | Description: |
|---|
| 1704 | This function is used to get a set of default parameters that can be passed |
|---|
| 1705 | to the BTHD_AcquireIfd function |
|---|
| 1706 | Returns: |
|---|
| 1707 | BERR_Code |
|---|
| 1708 | ******************************************************************************/ |
|---|
| 1709 | BERR_Code BTHD_GetDefaultIfdParams( |
|---|
| 1710 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1711 | BTHD_IfdParams* pDefIfdParam /* [out] default param */ |
|---|
| 1712 | ); |
|---|
| 1713 | |
|---|
| 1714 | /****************************************************************************** |
|---|
| 1715 | Summary: |
|---|
| 1716 | Reset internal counters for IFD status |
|---|
| 1717 | Description: |
|---|
| 1718 | This function is used to get a set of default parameters that can be passed |
|---|
| 1719 | to the BTHD_AcquireIfd function |
|---|
| 1720 | Returns: |
|---|
| 1721 | BERR_Code |
|---|
| 1722 | ******************************************************************************/ |
|---|
| 1723 | BERR_Code BTHD_ResetIfdStatus( |
|---|
| 1724 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1725 | ); |
|---|
| 1726 | |
|---|
| 1727 | /****************************************************************************** |
|---|
| 1728 | Summary: |
|---|
| 1729 | Retrieve the current IFD audio carrier settings |
|---|
| 1730 | Description: |
|---|
| 1731 | This function is used to get current audio carrier settings |
|---|
| 1732 | Returns: |
|---|
| 1733 | BERR_Code |
|---|
| 1734 | ******************************************************************************/ |
|---|
| 1735 | BERR_Code BTHD_GetIfdAudioSettings( |
|---|
| 1736 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1737 | BTHD_IfdAudioSettings* audioSettings /* [out] Audio settings structure */ |
|---|
| 1738 | ); |
|---|
| 1739 | |
|---|
| 1740 | /****************************************************************************** |
|---|
| 1741 | Summary: |
|---|
| 1742 | Sets the current IFD audio carrier settings |
|---|
| 1743 | Description: |
|---|
| 1744 | This function is used to set current audio carrier settings after acqusition. |
|---|
| 1745 | These settings will be overwritten on an IFDAcquire command. |
|---|
| 1746 | Returns: |
|---|
| 1747 | BERR_Code |
|---|
| 1748 | ******************************************************************************/ |
|---|
| 1749 | BERR_Code BTHD_SetIfdAudioSettings( |
|---|
| 1750 | BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1751 | const BTHD_IfdAudioSettings* audioSettings /* [in] Audio settings structure */ |
|---|
| 1752 | ); |
|---|
| 1753 | |
|---|
| 1754 | /****************************************************************************** |
|---|
| 1755 | Summary: |
|---|
| 1756 | Turn On clocks to all frontend related cores |
|---|
| 1757 | Description: |
|---|
| 1758 | This function is used by dynamic power management to essentially power up |
|---|
| 1759 | all frontend related cores. |
|---|
| 1760 | Returns: |
|---|
| 1761 | BERR_Code |
|---|
| 1762 | ******************************************************************************/ |
|---|
| 1763 | BERR_Code BTHD_PowerUp( |
|---|
| 1764 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1765 | ); |
|---|
| 1766 | |
|---|
| 1767 | /****************************************************************************** |
|---|
| 1768 | Summary: |
|---|
| 1769 | Turn off clocks to all frontend related cores include AFE, THD, IFD and PLLs |
|---|
| 1770 | Description: |
|---|
| 1771 | This function is used by dynamic power management to essentially shut off |
|---|
| 1772 | all frontend related cores. To bring core back the application needs to call |
|---|
| 1773 | either acquire function or the init function |
|---|
| 1774 | Returns: |
|---|
| 1775 | BERR_Code |
|---|
| 1776 | ******************************************************************************/ |
|---|
| 1777 | BERR_Code BTHD_PowerDown( |
|---|
| 1778 | BTHD_Handle h /* [in] BTHD handle */ |
|---|
| 1779 | ); |
|---|
| 1780 | |
|---|
| 1781 | /****************************************************************************** |
|---|
| 1782 | Summary: |
|---|
| 1783 | Get a handle for EWS |
|---|
| 1784 | Description: |
|---|
| 1785 | |
|---|
| 1786 | Returns: |
|---|
| 1787 | BERR_Code |
|---|
| 1788 | ******************************************************************************/ |
|---|
| 1789 | BERR_Code BTHD_GetEWSEventHandle( BTHD_Handle h, /* [in] BTHD channel handle */ |
|---|
| 1790 | BKNI_EventHandle *hEvent /* [out] lock event handle */ |
|---|
| 1791 | ); |
|---|
| 1792 | |
|---|
| 1793 | /****************************************************************************** |
|---|
| 1794 | Summary: |
|---|
| 1795 | Get the THD lock status without pulling all other status |
|---|
| 1796 | Description: |
|---|
| 1797 | |
|---|
| 1798 | Returns: |
|---|
| 1799 | BERR_Code |
|---|
| 1800 | ******************************************************************************/ |
|---|
| 1801 | BERR_Code BTHD_GetThdLockStatus( BTHD_Handle h, /* [in] BTHD handle */ |
|---|
| 1802 | BTHD_LockStatus *pLockStatus /* [out] THD lock status */ |
|---|
| 1803 | ); |
|---|
| 1804 | |
|---|
| 1805 | /*************************************************************************** |
|---|
| 1806 | Summary: |
|---|
| 1807 | This function is responsible for installing a callback function. |
|---|
| 1808 | |
|---|
| 1809 | Description: |
|---|
| 1810 | This function installs a callback function. |
|---|
| 1811 | |
|---|
| 1812 | Returns: |
|---|
| 1813 | TODO: |
|---|
| 1814 | |
|---|
| 1815 | See Also: |
|---|
| 1816 | |
|---|
| 1817 | ****************************************************************************/ |
|---|
| 1818 | BERR_Code BTHD_InstallCallback( |
|---|
| 1819 | BTHD_Handle h, /* [in] Device channel handle */ |
|---|
| 1820 | BTHD_Callback callbackType, /* [in] Type of callback */ |
|---|
| 1821 | BTHD_CallbackFunc pCallback, /* [in] Function Ptr to callback */ |
|---|
| 1822 | void *pParam /* [in] Generic parameter send on callback */ |
|---|
| 1823 | ); |
|---|
| 1824 | #ifdef __cplusplus |
|---|
| 1825 | } |
|---|
| 1826 | #endif |
|---|
| 1827 | |
|---|
| 1828 | #endif /* BTHD_H__ */ |
|---|
| 1829 | |
|---|