| 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: baob.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/5 $ |
|---|
| 12 | * $brcm_Date: 3/12/12 10:35a $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/aob/7552/baob.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/5 3/12/12 10:35a farshidf |
|---|
| 21 | * SW3128-1: add callback to tuner through Nexus |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/4 12/14/11 3:58p farshidf |
|---|
| 24 | * SW7552-170: fix the AOB interface |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/3 12/12/11 2:41p farshidf |
|---|
| 27 | * SW7552-170: add get default settings |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/2 12/12/11 12:00p farshidf |
|---|
| 30 | * SW7552-170: fix the AOB pi |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/2 4/15/11 4:33p vishk |
|---|
| 33 | * SW7422-413: Nexus support for the 3128 OOB core for 7422 board |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/1 4/14/11 5:02p atanugul |
|---|
| 36 | * SW3128-2: Add 3128 AOB Support |
|---|
| 37 | * |
|---|
| 38 | ****************************************************************************/ |
|---|
| 39 | |
|---|
| 40 | /*= Module Overview ********************************************************* |
|---|
| 41 | <verbatim> |
|---|
| 42 | |
|---|
| 43 | Overview |
|---|
| 44 | The Advanced Qam Out Of Band (AOB) Downstream receiver is responsible for taking an |
|---|
| 45 | Out-of-Band RF signal (70-130 MHz), down converting into IF signal. This IF |
|---|
| 46 | signal is then digitalized, demodulated and error corrected. This error |
|---|
| 47 | corrected data stream can be then routed to Davic MAC. |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | Design |
|---|
| 51 | The design for BAOB PI API is broken into three parts. |
|---|
| 52 | |
|---|
| 53 | o Part 1 (open/close/configuration): |
|---|
| 54 | |
|---|
| 55 | These APIs are used for opening and closing BAOB device. |
|---|
| 56 | When a device is opened, the device can be configured. |
|---|
| 57 | |
|---|
| 58 | o Part 2 (acquire/get/set): |
|---|
| 59 | |
|---|
| 60 | These APIs are used for getting and setting runtime attributes of BAOB. |
|---|
| 61 | Along with get and set APIs, an acquire API is also provided. The acquire |
|---|
| 62 | API is used to acquire (lock) OutOfBand Downstream signal. |
|---|
| 63 | |
|---|
| 64 | o Part 3 (process): |
|---|
| 65 | |
|---|
| 66 | This API is used to process notification. |
|---|
| 67 | |
|---|
| 68 | Usage |
|---|
| 69 | The usage of BAOB involves the following: |
|---|
| 70 | |
|---|
| 71 | * Configure/Open of BQOB |
|---|
| 72 | |
|---|
| 73 | * Configure BAOB device for the target system |
|---|
| 74 | * Open BAOB device |
|---|
| 75 | |
|---|
| 76 | * Program/Acquire device |
|---|
| 77 | |
|---|
| 78 | * Try to acquire OutOfBand Downstream signal |
|---|
| 79 | * Check status of acquisition |
|---|
| 80 | * Wait for Lock/Unlock ntotification sent from 325X |
|---|
| 81 | * Process Lock/Unlock Notification |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | Interrupt Requirements |
|---|
| 85 | No interrrupt processing is done by this module. |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | Sample Code: |
|---|
| 89 | // |
|---|
| 90 | // NOTE: The following sample code does not do any error checking. |
|---|
| 91 | // |
|---|
| 92 | // In this example, the target H/W board is configured for an |
|---|
| 93 | // Out-of-Band Downstream DVS 178 application, with a Crystal Frequency of 24.00 MHz |
|---|
| 94 | // |
|---|
| 95 | static BAOB_Handle aobDev; |
|---|
| 96 | static BCHP_Handle hChip3128; |
|---|
| 97 | static BREG_Handle hReg3128; |
|---|
| 98 | static BRPC_Handle hRpc; |
|---|
| 99 | |
|---|
| 100 | static BAOB_CallbackFunc cbLockChangeFunc( |
|---|
| 101 | BAOB_Handle hIbChn, |
|---|
| 102 | void *pParam |
|---|
| 103 | ) |
|---|
| 104 | { |
|---|
| 105 | bool *lockStatus = (bool *) pParam; |
|---|
| 106 | |
|---|
| 107 | BAOB_GetLockStatus( hIbChn, lockStatus ); |
|---|
| 108 | |
|---|
| 109 | return; |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | main( void ) |
|---|
| 113 | { |
|---|
| 114 | BAOB_Settings aobDevSettings; |
|---|
| 115 | bool isLock; |
|---|
| 116 | |
|---|
| 117 | // Initialize hChip3128, hReg3128, and hRpc . . . |
|---|
| 118 | |
|---|
| 119 | // Initialize BTNR_3128Ob |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | // BAOB initialization for BCM3128 |
|---|
| 123 | BAOB_GetDefaultSetting( &aobDevSettings ); |
|---|
| 124 | |
|---|
| 125 | // Configure the Crystal Frequency of H/W board. |
|---|
| 126 | aobDevSettings.xtalFreq = 24000000; |
|---|
| 127 | aobDevSettings.enableFEC = true; // false: CableCARD will do FEC |
|---|
| 128 | // true: legacy OOB needs FEC |
|---|
| 129 | aobDevSettings.hRpc = hRpc; |
|---|
| 130 | BAOB_Open( &aobDev, hChip3128, hReg3128, &aobDevSettings ); |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | // Now startup the RPC Notificiation Background thread/task . . . |
|---|
| 134 | |
|---|
| 135 | // Install callback for state change event, where last parameter |
|---|
| 136 | // is for general use. |
|---|
| 137 | BAOB_InstallCallback( aobDev, BAOB_Callback_eLockChange, cbLockChangeFunc, (void *) &isLock ); |
|---|
| 138 | |
|---|
| 139 | // Tune Tuner . . . |
|---|
| 140 | |
|---|
| 141 | |
|---|
| 142 | // Acquire OutOfBand Downstream Signal, DVS 178 QPSK modulation with a |
|---|
| 143 | // symbol rate of 777 KBaud. |
|---|
| 144 | BAOB_Set_Spectrum( aobDev, BAOB_SpectrumMode_eNoInverted); |
|---|
| 145 | |
|---|
| 146 | BAOB_Acquire( aobDev, BAOB_ModulationType_eDvs178Qpsk, 777000 ); |
|---|
| 147 | |
|---|
| 148 | while(1) |
|---|
| 149 | { |
|---|
| 150 | // Print the lock status every second |
|---|
| 151 | BKNI_Sleep(1000); |
|---|
| 152 | BAOB_GetLOckStatus(aobDev, &isLock); |
|---|
| 153 | printf("Lock Status: %s\n", (isLock==true): "locked", "not lock"); |
|---|
| 154 | } |
|---|
| 155 | } |
|---|
| 156 | |
|---|
| 157 | void checkRpcNotificationThread(. . .) |
|---|
| 158 | { |
|---|
| 159 | while (!system_terminated) |
|---|
| 160 | { |
|---|
| 161 | uint32_t device_id, event; |
|---|
| 162 | |
|---|
| 163 | BRPC_CheckNotification(hRpc, &device_id, &event, 0); |
|---|
| 164 | if ((BRPC_GET_NOTIFICATION_EVENT(event)) |
|---|
| 165 | { |
|---|
| 166 | switch (device_id) |
|---|
| 167 | { |
|---|
| 168 | case BRPC_DevId_3128_DS0: |
|---|
| 169 | break; |
|---|
| 170 | case BRPC_DevId_3128_DS1: |
|---|
| 171 | break; |
|---|
| 172 | case BRPC_DevId_3128_OB0: |
|---|
| 173 | BAOB_ProcessNotification(aobDev); |
|---|
| 174 | break; |
|---|
| 175 | default: |
|---|
| 176 | // device not used |
|---|
| 177 | break; |
|---|
| 178 | } |
|---|
| 179 | } |
|---|
| 180 | else |
|---|
| 181 | { |
|---|
| 182 | BKNI_Sleep(100); |
|---|
| 183 | } |
|---|
| 184 | } |
|---|
| 185 | } |
|---|
| 186 | |
|---|
| 187 | </verbatim> |
|---|
| 188 | |
|---|
| 189 | ***************************************************************************/ |
|---|
| 190 | |
|---|
| 191 | #ifndef BAOB_H__ |
|---|
| 192 | #define BAOB_H__ |
|---|
| 193 | |
|---|
| 194 | #include "bchp.h" |
|---|
| 195 | #include "breg_mem.h" |
|---|
| 196 | #include "bint.h" |
|---|
| 197 | #include "bkni.h" |
|---|
| 198 | #include "berr_ids.h" |
|---|
| 199 | #include "bmem.h" |
|---|
| 200 | |
|---|
| 201 | #ifdef __cplusplus |
|---|
| 202 | extern "C" { |
|---|
| 203 | #endif |
|---|
| 204 | |
|---|
| 205 | /*************************************************************************** |
|---|
| 206 | Summary: |
|---|
| 207 | Error Codes specific to BAOB |
|---|
| 208 | |
|---|
| 209 | Description: |
|---|
| 210 | |
|---|
| 211 | See Also: |
|---|
| 212 | |
|---|
| 213 | ****************************************************************************/ |
|---|
| 214 | #define BAOB_ERR_NOTAVAIL_MODULATION_TYPE BERR_MAKE_CODE(BERR_AOB_ID, 0) |
|---|
| 215 | |
|---|
| 216 | /*************************************************************************** |
|---|
| 217 | Summary: |
|---|
| 218 | The handles for Qam Out-of-Band Downstream module. |
|---|
| 219 | |
|---|
| 220 | Description: |
|---|
| 221 | An opaque handle for BAOB device. |
|---|
| 222 | |
|---|
| 223 | See Also: |
|---|
| 224 | BAOB_Open() |
|---|
| 225 | |
|---|
| 226 | ****************************************************************************/ |
|---|
| 227 | typedef struct BAOB_P_Handle *BAOB_Handle; |
|---|
| 228 | |
|---|
| 229 | typedef struct BAOB_P_3x7x_Handle *BAOB_3x7x_Handle; |
|---|
| 230 | /*************************************************************************** |
|---|
| 231 | Summary: |
|---|
| 232 | Enumeration for modulation type |
|---|
| 233 | |
|---|
| 234 | Description: |
|---|
| 235 | This enumeration defines the valid modulation types. |
|---|
| 236 | |
|---|
| 237 | See Also: |
|---|
| 238 | BAOB_Acquire(), BAOB_GetStatus() |
|---|
| 239 | |
|---|
| 240 | ****************************************************************************/ |
|---|
| 241 | typedef enum BAOB_ModulationType |
|---|
| 242 | { |
|---|
| 243 | BAOB_ModulationType_eDvs167Qpsk, /*Annex A*/ |
|---|
| 244 | BAOB_ModulationType_eDvs178Qpsk, /*Annex B*/ |
|---|
| 245 | BAOB_ModulationType_ePod_Dvs167Qpsk, |
|---|
| 246 | BAOB_ModulationType_ePod_Dvs178Qpsk, |
|---|
| 247 | BAOB_ModulationType_eLast |
|---|
| 248 | } BAOB_ModulationType; |
|---|
| 249 | |
|---|
| 250 | /*************************************************************************** |
|---|
| 251 | Summary: |
|---|
| 252 | Enumeration for BERT Source |
|---|
| 253 | |
|---|
| 254 | Description: |
|---|
| 255 | This enumeration defines the valid BERT input Sources |
|---|
| 256 | |
|---|
| 257 | See Also: |
|---|
| 258 | BAOB_Acquire() |
|---|
| 259 | |
|---|
| 260 | ****************************************************************************/ |
|---|
| 261 | typedef enum BAOB_BerInputSrc |
|---|
| 262 | { |
|---|
| 263 | BAOB_BerInputSrc_eRcvIChOutput, /* BERT input source is the receiver I-channel output */ |
|---|
| 264 | BAOB_BerInputSrc_eRcvQChOutput, /* BERT input source is the receiver Q-channel output */ |
|---|
| 265 | BAOB_BerInputSrc_eRcvIQChOutputIntrlv, /* BERT input source is the receiver I-channel and Q-channel output interleaved */ |
|---|
| 266 | BAOB_BerInputSrc_eFecOutput /* BERT input source is the FEC output */ |
|---|
| 267 | } BAOB_BerInputSrc; |
|---|
| 268 | |
|---|
| 269 | /*************************************************************************** |
|---|
| 270 | Summary: |
|---|
| 271 | Enumeration for QPSK OOB spectrum setting |
|---|
| 272 | |
|---|
| 273 | Description: |
|---|
| 274 | This enumeration defines the valid spectrum setting. |
|---|
| 275 | |
|---|
| 276 | See Also: |
|---|
| 277 | BAOB_Get_Spectrum(), BAOB_Set_Spectrum() |
|---|
| 278 | |
|---|
| 279 | ****************************************************************************/ |
|---|
| 280 | typedef enum BAOB_SpectrumMode |
|---|
| 281 | { |
|---|
| 282 | BAOB_SpectrumMode_eAuto, |
|---|
| 283 | BAOB_SpectrumMode_eNoInverted, |
|---|
| 284 | BAOB_SpectrumMode_eInverted |
|---|
| 285 | } BAOB_SpectrumMode; |
|---|
| 286 | /*************************************************************************** |
|---|
| 287 | Summary: |
|---|
| 288 | This structure represents the AOB Status for a Qam Out-of-Band Downstream |
|---|
| 289 | module. |
|---|
| 290 | |
|---|
| 291 | Description: |
|---|
| 292 | This structure is returned when BAOB_GetStatus() is called. This |
|---|
| 293 | structure contains the complete status of Qam Out-of-Band Downstream |
|---|
| 294 | module. |
|---|
| 295 | |
|---|
| 296 | See Also: |
|---|
| 297 | BAOB_GetStatus() |
|---|
| 298 | |
|---|
| 299 | ****************************************************************************/ |
|---|
| 300 | typedef struct BAOB_Status |
|---|
| 301 | { |
|---|
| 302 | bool isPowerSaverEnabled; /* Enable=1, Disable=0 */ |
|---|
| 303 | BAOB_ModulationType modType; /* Modulation Type */ |
|---|
| 304 | uint32_t sysXtalFreq; /* in Hertz, Sys. Xtal freq. */ |
|---|
| 305 | uint32_t symbolRate; /* in Baud */ |
|---|
| 306 | bool isFecLock; /* lock=1, unlock=0 */ |
|---|
| 307 | bool isQamLock; /* lock=1, unlock=0 */ |
|---|
| 308 | int32_t snrEstimate; /* in 1/256 db */ |
|---|
| 309 | int32_t agcIntLevel; /* in 1/10 percent */ |
|---|
| 310 | int32_t agcExtLevel; /* in 1/10 percent */ |
|---|
| 311 | int32_t carrierFreqOffset; /* in 1/1000 Hz */ |
|---|
| 312 | int32_t carrierPhaseOffset; /* in 1/1000 Hz */ |
|---|
| 313 | uint32_t uncorrectedCount; /* not self-clearing */ |
|---|
| 314 | uint32_t correctedCount; /* not self-clearing*/ |
|---|
| 315 | uint32_t berErrorCount; /* not self-clearing */ |
|---|
| 316 | } BAOB_Status; |
|---|
| 317 | |
|---|
| 318 | /*************************************************************************** |
|---|
| 319 | Summary: |
|---|
| 320 | Enumeration for Nyquist Filter |
|---|
| 321 | |
|---|
| 322 | Description: |
|---|
| 323 | This enumeration represents the Nyquist Filter modes of an AOB channel. |
|---|
| 324 | |
|---|
| 325 | See Also: |
|---|
| 326 | |
|---|
| 327 | ****************************************************************************/ |
|---|
| 328 | typedef enum BAOB_NyquistFilter |
|---|
| 329 | { |
|---|
| 330 | BAOB_NyquistFilter_eRaisedCosine_50, /* Raised Cosine Nyquist Filter with 50% Roll Off */ |
|---|
| 331 | BAOB_NyquistFilter_eRootRaisedCosine_50, /* Root Raised Cosine Nyquist Filter with 50% Roll Off */ |
|---|
| 332 | BAOB_NyquistFilter_eRootRaisedCosine_30, /* Root Raised Cosine Nyquist Filter with 30% Roll Off */ |
|---|
| 333 | BAOB_NyquistFilter_eLast |
|---|
| 334 | } BAOB_NyquistFilter; |
|---|
| 335 | |
|---|
| 336 | /*************************************************************************** |
|---|
| 337 | Summary: |
|---|
| 338 | Required default settings structure for QPSK Out-of_Band module. |
|---|
| 339 | |
|---|
| 340 | Description: |
|---|
| 341 | The default setting structure defines the default configuration of |
|---|
| 342 | QPSK Out-of_Band when the device is opened. |
|---|
| 343 | |
|---|
| 344 | See Also: |
|---|
| 345 | BAOB_Open() |
|---|
| 346 | |
|---|
| 347 | ****************************************************************************/ |
|---|
| 348 | #define BAOB_SETTINGS_XTALFREQ (24000000) /* 24.00 MHz */ |
|---|
| 349 | typedef struct BAOB_Settings |
|---|
| 350 | { |
|---|
| 351 | unsigned int devId; /* generic device ID */ |
|---|
| 352 | void *hGeneric; /* generic handle can be used for anything */ |
|---|
| 353 | uint32_t xtalFreq; /* Crystal Freqency in Hertz */ |
|---|
| 354 | bool enableFEC; /* use OOB FEC or not */ |
|---|
| 355 | bool isOpenDrain; /* true = Open Drain mode, false = Normal mode. */ |
|---|
| 356 | bool serialData; /* true = transport data is serial, false = transport data is parallel and is output on 3128_GPIO[0:7]*/ |
|---|
| 357 | BTMR_Handle hTmr; /* for peridic check equired for 7552 */ |
|---|
| 358 | BMEM_Heap_Handle hHeap; |
|---|
| 359 | BAOB_NyquistFilter nyquist; /* specifies Nyquist filter rolloff */ |
|---|
| 360 | } BAOB_Settings; |
|---|
| 361 | |
|---|
| 362 | /*************************************************************************** |
|---|
| 363 | Summary: |
|---|
| 364 | This structure represents AOB Qam In-Band Downstream acquisition parameters. |
|---|
| 365 | |
|---|
| 366 | Description: |
|---|
| 367 | |
|---|
| 368 | See Also: |
|---|
| 369 | BAOB_Acquire() |
|---|
| 370 | |
|---|
| 371 | ****************************************************************************/ |
|---|
| 372 | typedef struct BAOB_AcquireParam |
|---|
| 373 | { |
|---|
| 374 | BAOB_ModulationType modType; /* Modulation type */ |
|---|
| 375 | uint32_t symbolRate; /* in Baud */ |
|---|
| 376 | bool autoAcquire; |
|---|
| 377 | BAOB_SpectrumMode spectrum; /*default Spectrum setting*/ |
|---|
| 378 | BAOB_BerInputSrc berSrc; /* BERT Input Source */ |
|---|
| 379 | } BAOB_AcquireParam; |
|---|
| 380 | |
|---|
| 381 | |
|---|
| 382 | |
|---|
| 383 | /*************************************************************************** |
|---|
| 384 | Summary: |
|---|
| 385 | Data for the AOB callback |
|---|
| 386 | ****************************************************************************/ |
|---|
| 387 | /*This is a single NON-channelized structure called on demand then sent through the HAB*/ |
|---|
| 388 | /*Each sub-structure is completely filled by an appropriate function call*/ |
|---|
| 389 | |
|---|
| 390 | typedef enum BAOB_CallbackMode |
|---|
| 391 | { |
|---|
| 392 | /* Most of these are currently not supported, are here for future use */ |
|---|
| 393 | BAOB_CallbackMode_eSetMode = 0, |
|---|
| 394 | BAOB_CallbackMode_eRequestMode = 1, |
|---|
| 395 | BAOB_CallbackMode_eLast |
|---|
| 396 | } BAOB_CallbackMode; |
|---|
| 397 | |
|---|
| 398 | |
|---|
| 399 | typedef struct BAOB_P_AobCallbackData_s |
|---|
| 400 | { |
|---|
| 401 | void* hTunerChn; |
|---|
| 402 | uint16_t Mode; /*Callback is to send data on eSetMode, Callback is to get data on eRequestMode*/ |
|---|
| 403 | uint32_t Symbol_Rate; /*Upper Symbol_Rate currently being scanned on eSetMode: return last value sent on eRequestMode*/ |
|---|
| 404 | int32_t Freq_Offset; /*Front end offset to use on eSetMode: return last value sent on eRequestMode*/ |
|---|
| 405 | uint32_t RF_Freq; /*RF frequency of the tuner on eRequestMode: set to 0 if unknown*/ |
|---|
| 406 | int32_t Total_Mix_After_ADC; /*Sum of mixer frequencies after ADC on eRequestMode*/ |
|---|
| 407 | int16_t PreADC_Gain_x256db ; /*Gain in db*256 before ADC on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 408 | int16_t PostADC_Gain_x256db; /*Gain in db*256 after ADC on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 409 | int16_t External_Gain_x256db; /*Gain in db*256 external to chip (like external LNA) on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 410 | }BAOB_P_AobCallbackData_t; |
|---|
| 411 | |
|---|
| 412 | |
|---|
| 413 | typedef enum BAOB_Callback |
|---|
| 414 | { |
|---|
| 415 | BAOB_Callback_eLockChange, /* Callback to notify application of lock change */ |
|---|
| 416 | BAOB_Callback_eAsyncStatusReady, /* Callback to notify application there is no signal */ |
|---|
| 417 | BAOB_Callback_eTuner, /* callback to tuner to get Tuner status */ |
|---|
| 418 | BAOB_Callback_eLast /* More may be required */ |
|---|
| 419 | } BAOB_Callback; |
|---|
| 420 | |
|---|
| 421 | /*************************************************************************** |
|---|
| 422 | Summary: |
|---|
| 423 | Callback used for event notification. |
|---|
| 424 | |
|---|
| 425 | Description: |
|---|
| 426 | When this PI wants to notify an application, it will call this callback |
|---|
| 427 | function the callback function is registered. |
|---|
| 428 | |
|---|
| 429 | See Also: |
|---|
| 430 | BAOB_InstallLockStateChangeCallback() |
|---|
| 431 | |
|---|
| 432 | ****************************************************************************/ |
|---|
| 433 | typedef BERR_Code (*BAOB_CallbackFunc)(void *pParam ); |
|---|
| 434 | |
|---|
| 435 | |
|---|
| 436 | /*************************************************************************** |
|---|
| 437 | Summary: |
|---|
| 438 | This function returns the default settings for QPSK Out-of_Band module. |
|---|
| 439 | |
|---|
| 440 | Description: |
|---|
| 441 | This function is responsible for returns the default setting for |
|---|
| 442 | BAOB module. The returning default setting should be when |
|---|
| 443 | opening the device. |
|---|
| 444 | |
|---|
| 445 | Returns: |
|---|
| 446 | TODO: |
|---|
| 447 | |
|---|
| 448 | See Also: |
|---|
| 449 | BAOB_Open() |
|---|
| 450 | |
|---|
| 451 | ****************************************************************************/ |
|---|
| 452 | BERR_Code BAOB_GetDefaultSettings( |
|---|
| 453 | BAOB_Settings *pDefSettings, /* [out] Returns default setting */ |
|---|
| 454 | BCHP_Handle hChip /* [in] Chip handle */ |
|---|
| 455 | ); |
|---|
| 456 | |
|---|
| 457 | |
|---|
| 458 | |
|---|
| 459 | /*************************************************************************** |
|---|
| 460 | Summary: |
|---|
| 461 | This function opens Qam Out-of-Band Downstream module. |
|---|
| 462 | |
|---|
| 463 | Description: |
|---|
| 464 | This function is responsible for opening BAOB module. When BAOB is |
|---|
| 465 | opened, it will create a module handle and configure the module based |
|---|
| 466 | on the default settings. Once the device is opened, it must be closed |
|---|
| 467 | before it can be opened again. |
|---|
| 468 | |
|---|
| 469 | Returns: |
|---|
| 470 | TODO: |
|---|
| 471 | |
|---|
| 472 | See Also: |
|---|
| 473 | BAOB_Close(), BAOB_GetDefaultSettings() |
|---|
| 474 | |
|---|
| 475 | ****************************************************************************/ |
|---|
| 476 | BERR_Code BAOB_Open( |
|---|
| 477 | BAOB_Handle *pAob, /* [out] Returns handle */ |
|---|
| 478 | BCHP_Handle hChip, /* [in] Chip handle */ |
|---|
| 479 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 480 | BINT_Handle hInterrupt, /* [in] Interrupt handle, Bcm3250 */ |
|---|
| 481 | const BAOB_Settings *pDefSettings /* [in] Default settings */ |
|---|
| 482 | ); |
|---|
| 483 | |
|---|
| 484 | /*************************************************************************** |
|---|
| 485 | Summary: |
|---|
| 486 | This function closes Qam Out-of-Band Downstream module. |
|---|
| 487 | |
|---|
| 488 | Description: |
|---|
| 489 | This function is responsible for closing BAOB module. Closing BAOB |
|---|
| 490 | will free main BAOB handle. |
|---|
| 491 | |
|---|
| 492 | Returns: |
|---|
| 493 | TODO: |
|---|
| 494 | |
|---|
| 495 | See Also: |
|---|
| 496 | BAOB_Open() |
|---|
| 497 | |
|---|
| 498 | ****************************************************************************/ |
|---|
| 499 | BERR_Code BAOB_Close( |
|---|
| 500 | BAOB_Handle hAob /* [in] Device handle */ |
|---|
| 501 | ); |
|---|
| 502 | |
|---|
| 503 | |
|---|
| 504 | /*************************************************************************** |
|---|
| 505 | Summary: |
|---|
| 506 | This function tries to acquire downstream lock for the specific |
|---|
| 507 | Qam Out-of-Band Downstream module. |
|---|
| 508 | |
|---|
| 509 | Description: |
|---|
| 510 | This function is responsible for trying to acquire downstream lock of |
|---|
| 511 | the input Out-of-Band signal. Acquiring Out-of-Band downstream lock involves |
|---|
| 512 | configuring the H/W to desire configuration, then running a Qam Out-of-Band |
|---|
| 513 | downstream acquisition script. If this is the first acquisition for the |
|---|
| 514 | current annex mode, then a Qam Out-of-Band downstream configuration script |
|---|
| 515 | will be run prior to running acquisition script. |
|---|
| 516 | This function will automatically enable the downstream receiver if |
|---|
| 517 | the receiver was in power-saver mode. |
|---|
| 518 | |
|---|
| 519 | Returns: |
|---|
| 520 | TODO: |
|---|
| 521 | |
|---|
| 522 | See Also: |
|---|
| 523 | BAOB_GetLock(), BAOB_GetStatus(), BAOB_GetSoftDecision() |
|---|
| 524 | |
|---|
| 525 | ****************************************************************************/ |
|---|
| 526 | BERR_Code BAOB_Acquire( |
|---|
| 527 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 528 | BAOB_AcquireParam *obParams /* [in] Out of band acquire parameters to use */ |
|---|
| 529 | ); |
|---|
| 530 | |
|---|
| 531 | /*************************************************************************** |
|---|
| 532 | Summary: |
|---|
| 533 | This function gets the status synchronously of Qam Out-of-Band Downstream module. |
|---|
| 534 | |
|---|
| 535 | Description: |
|---|
| 536 | This function is responsible for synchronously getting the complete status for |
|---|
| 537 | a Qam Out-of-Band Downstream module. |
|---|
| 538 | |
|---|
| 539 | Returns: |
|---|
| 540 | TODO: |
|---|
| 541 | |
|---|
| 542 | See Also: BAOB_RequestAsyncStatus(), BAOB_GetAsyncStatus(). |
|---|
| 543 | |
|---|
| 544 | ****************************************************************************/ |
|---|
| 545 | BERR_Code BAOB_GetStatus( |
|---|
| 546 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 547 | BAOB_Status *pStatus /* [out] Returns status */ |
|---|
| 548 | ); |
|---|
| 549 | |
|---|
| 550 | /*************************************************************************** |
|---|
| 551 | Summary: |
|---|
| 552 | This function gets the status asynchronously of Qam Out-of-Band Downstream module. |
|---|
| 553 | |
|---|
| 554 | Description: |
|---|
| 555 | This function is responsible for asynchronously getting the complete status for |
|---|
| 556 | a Qam Out-of-Band Downstream module channel. BAOB_RequestAsyncStatus() is called before to |
|---|
| 557 | notify the frontend to calculate the status and notify the backend asynchronously that |
|---|
| 558 | the status is ready then BAOB_GetAsyncStatus() needs to be called to retrieve the status. |
|---|
| 559 | |
|---|
| 560 | Returns: |
|---|
| 561 | TODO: |
|---|
| 562 | |
|---|
| 563 | See Also: BAOB_RequestAsyncStatus(), BAOB_GetStatus(). |
|---|
| 564 | |
|---|
| 565 | |
|---|
| 566 | ****************************************************************************/ |
|---|
| 567 | BERR_Code BAOB_GetAsyncStatus( |
|---|
| 568 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 569 | BAOB_Status *pStatus /* [out] Returns status */ |
|---|
| 570 | ); |
|---|
| 571 | |
|---|
| 572 | /*************************************************************************** |
|---|
| 573 | Summary: |
|---|
| 574 | This function requests the status asynchronously of Qam Out-of-Band Downstream module. |
|---|
| 575 | |
|---|
| 576 | Description: |
|---|
| 577 | This function is responsible for requesting the status to be calculated asynchronously for |
|---|
| 578 | a Qam Out-of-Band Downstream module channel. The Qam frontend is responsible to inform |
|---|
| 579 | the backend when the status is ready either through an interrupt or by any other predetermined |
|---|
| 580 | method. |
|---|
| 581 | |
|---|
| 582 | Returns: |
|---|
| 583 | TODO: |
|---|
| 584 | |
|---|
| 585 | See Also: BAOB_GetAsyncStatus |
|---|
| 586 | BAOB_GetStatus |
|---|
| 587 | |
|---|
| 588 | ****************************************************************************/ |
|---|
| 589 | BERR_Code BAOB_RequestAsyncStatus( |
|---|
| 590 | BAOB_Handle hDev /* [in] Device handle */ |
|---|
| 591 | ); |
|---|
| 592 | |
|---|
| 593 | /*************************************************************************** |
|---|
| 594 | Summary: |
|---|
| 595 | This function gets the lock status for a Qam Out-of-Band Downstream |
|---|
| 596 | module. |
|---|
| 597 | |
|---|
| 598 | Description: |
|---|
| 599 | This function is responsible for getting the lock status |
|---|
| 600 | for a BAOB module. |
|---|
| 601 | |
|---|
| 602 | Returns: |
|---|
| 603 | TODO: |
|---|
| 604 | |
|---|
| 605 | See Also: |
|---|
| 606 | BAOB_GetStatus() |
|---|
| 607 | |
|---|
| 608 | ****************************************************************************/ |
|---|
| 609 | BERR_Code BAOB_GetLockStatus( |
|---|
| 610 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 611 | bool *isLock /* [out] Returns lock status, 0=not lock, 1=locked */ |
|---|
| 612 | ); |
|---|
| 613 | |
|---|
| 614 | /*************************************************************************** |
|---|
| 615 | Summary: |
|---|
| 616 | This function gets the I and Q values for soft decision of a |
|---|
| 617 | Qam Out-of-Band Downstream module. |
|---|
| 618 | |
|---|
| 619 | Description: |
|---|
| 620 | This function is responsible for getting the I and Q values for soft |
|---|
| 621 | decision of a BAOB module. |
|---|
| 622 | |
|---|
| 623 | Returns: |
|---|
| 624 | TODO: |
|---|
| 625 | |
|---|
| 626 | See Also: |
|---|
| 627 | |
|---|
| 628 | ****************************************************************************/ |
|---|
| 629 | BERR_Code BAOB_GetSoftDecision( |
|---|
| 630 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 631 | int16_t nbrToGet, /* [in] Number values to get */ |
|---|
| 632 | int16_t *iVal, /* [out] Ptr to array to store output I soft decision */ |
|---|
| 633 | int16_t *qVal, /* [out] Ptr to array to store output Q soft decision */ |
|---|
| 634 | int16_t *nbrGotten /* [out] Number of values gotten/read */ |
|---|
| 635 | ); |
|---|
| 636 | |
|---|
| 637 | /*************************************************************************** |
|---|
| 638 | Summary: |
|---|
| 639 | This function enable the power-saver mode. |
|---|
| 640 | |
|---|
| 641 | Description: |
|---|
| 642 | This function is responsible for enabling the OOB downstream receiver |
|---|
| 643 | power-saver mode. When the BAOB is in the power-saver mode, the |
|---|
| 644 | Qam/QPSK OOB Downstream receiver is shutdown. BAOB_Acquire() will disable |
|---|
| 645 | power-saver mode automatically. Also BAOB_DisablePowerSaver() |
|---|
| 646 | can be used to disable power-saver mode. |
|---|
| 647 | |
|---|
| 648 | Returns: |
|---|
| 649 | TODO: |
|---|
| 650 | |
|---|
| 651 | See Also: |
|---|
| 652 | BAOB_DisablePowerSaver() |
|---|
| 653 | BAOB_Acquire() |
|---|
| 654 | |
|---|
| 655 | ****************************************************************************/ |
|---|
| 656 | BERR_Code BAOB_EnablePowerSaver( |
|---|
| 657 | BAOB_Handle hDev /* [in] Device handle */ |
|---|
| 658 | ); |
|---|
| 659 | |
|---|
| 660 | /*************************************************************************** |
|---|
| 661 | Summary: |
|---|
| 662 | This function disables the power-saver mode. |
|---|
| 663 | |
|---|
| 664 | Description: |
|---|
| 665 | This function is responsible for disabling the OOB downstream receiver |
|---|
| 666 | power-saver mode. When the BAOB is in the power-saver mode, the |
|---|
| 667 | Qam/QPSK OOB Downstream receiver is shutdown. |
|---|
| 668 | |
|---|
| 669 | Returns: |
|---|
| 670 | TODO: |
|---|
| 671 | |
|---|
| 672 | See Also: |
|---|
| 673 | BAOB_EnablePowerSaver() |
|---|
| 674 | BAOB_Acquire() |
|---|
| 675 | |
|---|
| 676 | ****************************************************************************/ |
|---|
| 677 | BERR_Code BAOB_DisablePowerSaver( |
|---|
| 678 | BAOB_Handle hDev /* [in] Device handle */ |
|---|
| 679 | ); |
|---|
| 680 | |
|---|
| 681 | /*************************************************************************** |
|---|
| 682 | Summary: |
|---|
| 683 | This function is responsible for processing a notificiation for the specific |
|---|
| 684 | Qam Out-of-Band Downstream module channel. |
|---|
| 685 | |
|---|
| 686 | Description: |
|---|
| 687 | This function needs to called when notification is received. |
|---|
| 688 | |
|---|
| 689 | Returns: |
|---|
| 690 | TODO: |
|---|
| 691 | |
|---|
| 692 | See Also: |
|---|
| 693 | |
|---|
| 694 | ****************************************************************************/ |
|---|
| 695 | BERR_Code BAOB_ProcessNotification( |
|---|
| 696 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 697 | unsigned int event /* [in] Event code and event data*/ |
|---|
| 698 | ); |
|---|
| 699 | |
|---|
| 700 | /*************************************************************************** |
|---|
| 701 | Summary: |
|---|
| 702 | This function is responsible for installing a callback function. |
|---|
| 703 | |
|---|
| 704 | Description: |
|---|
| 705 | This function installs a callback function. |
|---|
| 706 | |
|---|
| 707 | Returns: |
|---|
| 708 | TODO: |
|---|
| 709 | |
|---|
| 710 | See Also: |
|---|
| 711 | |
|---|
| 712 | ****************************************************************************/ |
|---|
| 713 | BERR_Code BAOB_InstallCallback( |
|---|
| 714 | BAOB_Handle hDev, /* [in] Device handle */ |
|---|
| 715 | BAOB_Callback callbackType, /* [in] Type of callback */ |
|---|
| 716 | BAOB_CallbackFunc pCallback, /* [in] Function Ptr to callback */ |
|---|
| 717 | void *pParam /* [in] Generic parameter send on callback */ |
|---|
| 718 | ); |
|---|
| 719 | |
|---|
| 720 | /*************************************************************************** |
|---|
| 721 | Summary: |
|---|
| 722 | This functionclears the corrBlockCount and ucorrBlockCount counters in BAOB_OobStatus. |
|---|
| 723 | |
|---|
| 724 | Description: |
|---|
| 725 | |
|---|
| 726 | |
|---|
| 727 | Returns: |
|---|
| 728 | TODO: |
|---|
| 729 | |
|---|
| 730 | See Also: |
|---|
| 731 | |
|---|
| 732 | ****************************************************************************/ |
|---|
| 733 | BERR_Code BAOB_ResetStatus( |
|---|
| 734 | BAOB_Handle hDev /* [in] Device handle */ |
|---|
| 735 | ); |
|---|
| 736 | |
|---|
| 737 | |
|---|
| 738 | /*************************************************************************** |
|---|
| 739 | Summary: |
|---|
| 740 | This function returns the default settings for QPSK Out-of_Band module. |
|---|
| 741 | |
|---|
| 742 | Description: |
|---|
| 743 | This function is responsible for returns the default setting for |
|---|
| 744 | BAOB module. The returning default setting should be when |
|---|
| 745 | opening the device. |
|---|
| 746 | |
|---|
| 747 | Returns: |
|---|
| 748 | TODO: |
|---|
| 749 | |
|---|
| 750 | See Also: |
|---|
| 751 | BAOB_Open() |
|---|
| 752 | |
|---|
| 753 | ****************************************************************************/ |
|---|
| 754 | BERR_Code BAOB_GetDefaultSettings( |
|---|
| 755 | BAOB_Settings *pDefSettings, /* [out] Returns default setting */ |
|---|
| 756 | BCHP_Handle hChip /* [in] Chip handle */ |
|---|
| 757 | ); |
|---|
| 758 | |
|---|
| 759 | |
|---|
| 760 | /*************************************************************************** |
|---|
| 761 | Summary: |
|---|
| 762 | Function called by upper to get the inetrrupt handle |
|---|
| 763 | |
|---|
| 764 | BAOB_GetInterruptEventHandle |
|---|
| 765 | ****************************************************************************/ |
|---|
| 766 | BERR_Code BAOB_GetInterruptEventHandle(BAOB_Handle h, BKNI_EventHandle* hEvent); |
|---|
| 767 | |
|---|
| 768 | void BAOB_ProcessInterruptEvent (BAOB_Handle hDev); |
|---|
| 769 | |
|---|
| 770 | void BAOB_P_TimerFunc(void *myParam1, int myParam2); |
|---|
| 771 | |
|---|
| 772 | #ifdef __cplusplus |
|---|
| 773 | } |
|---|
| 774 | #endif |
|---|
| 775 | |
|---|
| 776 | #endif |
|---|
| 777 | |
|---|