| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2005-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: bads_api.h $ |
|---|
| 39 | * $brcm_Revision: Hydra_Software_Devel/4 $ |
|---|
| 40 | * $brcm_Date: 3/29/12 8:46p $ |
|---|
| 41 | * |
|---|
| 42 | * Module Description: |
|---|
| 43 | * |
|---|
| 44 | * Revision History: |
|---|
| 45 | * |
|---|
| 46 | * $brcm_Log: /magnum/portinginterface/ads/7552/bads_api.h $ |
|---|
| 47 | * |
|---|
| 48 | * Hydra_Software_Devel/4 3/29/12 8:46p farshidf |
|---|
| 49 | * SW7552-239: fix the power |
|---|
| 50 | * |
|---|
| 51 | * Hydra_Software_Devel/3 12/22/11 4:49p farshidf |
|---|
| 52 | * SW7552-170: add scanstatus calls |
|---|
| 53 | * |
|---|
| 54 | * Hydra_Software_Devel/2 11/16/11 6:05p atanugul |
|---|
| 55 | * SW3461-79: Add No Signal to GetLockStatus() |
|---|
| 56 | * |
|---|
| 57 | * Hydra_Software_Devel/1 10/10/11 2:06p farshidf |
|---|
| 58 | * SW7552-134: sync up to V2_0 of 3461 |
|---|
| 59 | * |
|---|
| 60 | * Hydra_Software_Devel/15 10/10/11 1:51p farshidf |
|---|
| 61 | * SW7552-134: update to match V2_0 of 3461 |
|---|
| 62 | * |
|---|
| 63 | * Hydra_Software_Devel/14 8/16/11 4:24p farshidf |
|---|
| 64 | * SW7552-105: rebase ro 3461_V1_0_RC0 label |
|---|
| 65 | * |
|---|
| 66 | * Hydra_Software_Devel/13 7/19/11 8:03p farshidf |
|---|
| 67 | * SW7552-60: update teh callback struct |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/12 7/19/11 7:58p farshidf |
|---|
| 70 | * SW7552-60: add new include |
|---|
| 71 | * |
|---|
| 72 | * Hydra_Software_Devel/11 7/18/11 3:53p farshidf |
|---|
| 73 | * SWDTV-7869: update the FFT event |
|---|
| 74 | * |
|---|
| 75 | * Hydra_Software_Devel/10 7/15/11 5:47p farshidf |
|---|
| 76 | * SWDTV-7869: add the 35126Bo changes |
|---|
| 77 | * |
|---|
| 78 | * Hydra_Software_Devel/9 5/31/11 3:58p farshidf |
|---|
| 79 | * SW7552-36: compile fix |
|---|
| 80 | * |
|---|
| 81 | * Hydra_Software_Devel/8 5/10/11 11:09p farshidf |
|---|
| 82 | * SWDTV-7035: merge main |
|---|
| 83 | * |
|---|
| 84 | * Hydra_Software_Devel/SWDTV-7035/1 5/10/11 12:31p farshidf |
|---|
| 85 | * SWDTV-7035: update to latest |
|---|
| 86 | * |
|---|
| 87 | * Hydra_Software_Devel/7 5/6/11 4:26p farshidf |
|---|
| 88 | * SWDTV-6857: waring fix |
|---|
| 89 | * |
|---|
| 90 | * Hydra_Software_Devel/6 5/6/11 2:23p farshidf |
|---|
| 91 | * SWDTV-6857: merge main |
|---|
| 92 | * |
|---|
| 93 | * Hydra_Software_Devel/SWDTV-6857/1 5/6/11 2:03p farshidf |
|---|
| 94 | * SWDTV-6587: add scan structure and calls |
|---|
| 95 | * |
|---|
| 96 | * Hydra_Software_Devel/5 4/28/11 8:18p farshidf |
|---|
| 97 | * SWDTV-6190: fix the code |
|---|
| 98 | * |
|---|
| 99 | * Hydra_Software_Devel/4 4/27/11 11:47p farshidf |
|---|
| 100 | * SWDTV-6190: move the L3 interrupt processing inside the PI |
|---|
| 101 | * |
|---|
| 102 | * Hydra_Software_Devel/3 4/27/11 12:28p farshidf |
|---|
| 103 | * SWDTV-6190: fix the max channel number |
|---|
| 104 | * |
|---|
| 105 | * Hydra_Software_Devel/2 4/25/11 6:22p farshidf |
|---|
| 106 | * SWDTV-6191: update the ADS callback |
|---|
| 107 | * |
|---|
| 108 | * Hydra_Software_Devel/1 4/20/11 12:41p farshidf |
|---|
| 109 | * SWDTV-6190: add intial DS files |
|---|
| 110 | * |
|---|
| 111 | * 32 3/16/11 7:40p farshidf |
|---|
| 112 | * SW3128-1: add an extra timer for status |
|---|
| 113 | * |
|---|
| 114 | * 31 3/8/11 1:17p farshidf |
|---|
| 115 | * SW3128-1: use one channel for ADS on 3461 |
|---|
| 116 | * |
|---|
| 117 | * 29 2/28/11 5:57p cbrooks |
|---|
| 118 | * sw3128-1:Changed acqwords to internal_params |
|---|
| 119 | * |
|---|
| 120 | * 28 2/8/11 11:48a farshidf |
|---|
| 121 | * SW3128-1: update the constellation function |
|---|
| 122 | * |
|---|
| 123 | * 27 2/7/11 5:08p mpovich |
|---|
| 124 | * SW3128-1: Integrate HAB power control and status messages with ADS |
|---|
| 125 | * driver. Update HAB driver (misc integ. updates and fixes). |
|---|
| 126 | * |
|---|
| 127 | * Rom_Devel_3128/4 2/5/11 1:52p mpovich |
|---|
| 128 | * SW3128-1: Rebase to main branch. |
|---|
| 129 | * |
|---|
| 130 | * 26 2/5/11 1:07p farshidf |
|---|
| 131 | * SW3128-1: add the auto acquire |
|---|
| 132 | * |
|---|
| 133 | * Rom_Devel_3128/3 2/4/11 11:24a mpovich |
|---|
| 134 | * SW3128-1: Keep power-up/off state of ADS channels. |
|---|
| 135 | * |
|---|
| 136 | * Rom_Devel_3128/2 2/1/11 10:23a mpovich |
|---|
| 137 | * SW3128-1: Rebase to the latest from the main branch. |
|---|
| 138 | * |
|---|
| 139 | * 25 1/31/11 7:03p farshidf |
|---|
| 140 | * SW3128-1: add the WFE to ADS callback sample |
|---|
| 141 | * |
|---|
| 142 | * 24 1/31/11 12:55a mpovich |
|---|
| 143 | * SW3128-1: Add HAB driver changes integrated with ADS and WFE modules. |
|---|
| 144 | * |
|---|
| 145 | * Rom_Devel_3128/1 1/28/11 4:42p mpovich |
|---|
| 146 | * SW3128-1: Add get/set functions to integrate ADS with HAB commands |
|---|
| 147 | * |
|---|
| 148 | * 23 1/26/11 4:13p farshidf |
|---|
| 149 | * SW3128-1: clean up |
|---|
| 150 | * |
|---|
| 151 | * 22 1/26/11 3:28p cbrooks |
|---|
| 152 | * sw3128-1:Cleanup Code |
|---|
| 153 | * |
|---|
| 154 | * 21 1/25/11 9:29p cbrooks |
|---|
| 155 | * sw3128-1: Cleanup Code |
|---|
| 156 | * |
|---|
| 157 | * 20 1/21/11 5:19p farshidf |
|---|
| 158 | * SW3128-1: update the names |
|---|
| 159 | * |
|---|
| 160 | * 19 1/18/11 6:19p farshidf |
|---|
| 161 | * SW3128-1: add channel irq handle |
|---|
| 162 | * |
|---|
| 163 | * 18 1/17/11 3:01p farshidf |
|---|
| 164 | * SW3128-1: add the ADS irq |
|---|
| 165 | * |
|---|
| 166 | * 17 12/22/10 2:21p farshidf |
|---|
| 167 | * SW3128-1: update |
|---|
| 168 | * |
|---|
| 169 | * 16 12/21/10 2:17p farshidf |
|---|
| 170 | * SW3128-1: update the API |
|---|
| 171 | * |
|---|
| 172 | * 15 12/20/10 4:40p farshidf |
|---|
| 173 | * SW3128-1: update |
|---|
| 174 | * |
|---|
| 175 | * 14 12/18/10 10:40a farshidf |
|---|
| 176 | * SW3128-1: update |
|---|
| 177 | * |
|---|
| 178 | * 13 12/17/10 4:17p farshidf |
|---|
| 179 | * SW3128-1: update |
|---|
| 180 | * |
|---|
| 181 | ***************************************************************************/ |
|---|
| 182 | #ifndef BADS_API_H__ |
|---|
| 183 | #define BADS_API_H__ |
|---|
| 184 | |
|---|
| 185 | #ifdef __cplusplus |
|---|
| 186 | extern "C" { |
|---|
| 187 | #endif |
|---|
| 188 | #include "bads_def.h" |
|---|
| 189 | #include "bads_struct.h" |
|---|
| 190 | |
|---|
| 191 | #ifndef LEAP_BASED_CODE |
|---|
| 192 | #define BREG_WriteField(h, Register, Field, Data) \ |
|---|
| 193 | BREG_Write32(h, BCHP_##Register, ((BREG_Read32(h, BCHP_##Register) & \ |
|---|
| 194 | ~((uint32_t)BCHP_MASK(Register, Field))) | \ |
|---|
| 195 | BCHP_FIELD_DATA(Register, Field, Data))) |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | #define BREG_ReadField(h, Register, Field) \ |
|---|
| 199 | ((BREG_Read32(h, BCHP_##Register) & BCHP_MASK(Register,Field)) >> \ |
|---|
| 200 | BCHP_SHIFT(Register,Field)) |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | #define CHK_RETCODE( rc, func ) \ |
|---|
| 204 | do { \ |
|---|
| 205 | if( (rc = BERR_TRACE(func)) != BERR_SUCCESS ) \ |
|---|
| 206 | { \ |
|---|
| 207 | goto done; \ |
|---|
| 208 | } \ |
|---|
| 209 | } while(0) |
|---|
| 210 | |
|---|
| 211 | #define DEV_MAGIC_ID ((BERR_ADS_ID<<16) | 0xFACE) |
|---|
| 212 | #endif |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | #define MX_ADS_CHANNELS (1) |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | #define BADS_CHSCN_EVENT 7 |
|---|
| 220 | #define BADS_FCA_EVENT 6 |
|---|
| 221 | #define BADS_DS0_2_EVENT 1 |
|---|
| 222 | #define BADS_IQ_CONSTELLATION_VECTORS 30 |
|---|
| 223 | |
|---|
| 224 | typedef struct BADS_P_3x7x_Handle *BADS_3x7x_Handle; |
|---|
| 225 | typedef struct BADS_P_3x7x_ChannelHandle *BADS_3x7x_ChannelHandle; |
|---|
| 226 | |
|---|
| 227 | typedef enum BADS_FecLock |
|---|
| 228 | { |
|---|
| 229 | /* Most of these are currently not supported, are here for future use */ |
|---|
| 230 | BADS_FecLock_eNoChange = 0, |
|---|
| 231 | BADS_FecLock_eNotLocked = 2, |
|---|
| 232 | BADS_FecLock_eLocked = 3, |
|---|
| 233 | BADS_FecLock_eLast |
|---|
| 234 | } BADS_FecLock; |
|---|
| 235 | |
|---|
| 236 | /* Channel power on/off status */ |
|---|
| 237 | typedef enum |
|---|
| 238 | { |
|---|
| 239 | BADS_eChan_Power_Off = 0, |
|---|
| 240 | BADS_eChan_Power_On = 1, |
|---|
| 241 | BADS_eChan_Power_Unknown = 0xFF |
|---|
| 242 | } BADS_3x7x_Chan_PowerStatus; |
|---|
| 243 | |
|---|
| 244 | /***************************************************************/ |
|---|
| 245 | /***************************************************************/ |
|---|
| 246 | |
|---|
| 247 | /*************************************************************************** |
|---|
| 248 | * HAB Function call |
|---|
| 249 | ****************************************************************************/ |
|---|
| 250 | /*************************************************************************** |
|---|
| 251 | Summary: |
|---|
| 252 | This function opens Qam In-Band Downstream module. |
|---|
| 253 | |
|---|
| 254 | Description: |
|---|
| 255 | This function is responsible for opening BADS module. When BADS is |
|---|
| 256 | opened, it will create a module handle and configure the module based |
|---|
| 257 | on the default settings. Once the device is opened, it must be closed |
|---|
| 258 | before it can be opened again. |
|---|
| 259 | |
|---|
| 260 | Returns: |
|---|
| 261 | TODO: |
|---|
| 262 | |
|---|
| 263 | See Also: |
|---|
| 264 | BADS_3x7x_Close(), BADS_3x7x_OpenChannel(), BADS_3x7x_CloseChannel(), |
|---|
| 265 | BADS_3x7x_GetDefaultSettings() |
|---|
| 266 | |
|---|
| 267 | ****************************************************************************/ |
|---|
| 268 | BERR_Code BADS_3x7x_Open( |
|---|
| 269 | BADS_Handle *pAds, /* [out] Returns handle */ |
|---|
| 270 | BCHP_Handle hChip, /* [in] Chip handle */ |
|---|
| 271 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 272 | BINT_Handle hInterrupt, /* [in] Interrupt handle, Bcm3250 */ |
|---|
| 273 | const struct BADS_Settings *pDefSettings /* [in] Default settings */ |
|---|
| 274 | ); |
|---|
| 275 | |
|---|
| 276 | /*************************************************************************** |
|---|
| 277 | Summary: |
|---|
| 278 | This function closes Qam In-Band Downstream module. |
|---|
| 279 | |
|---|
| 280 | Description: |
|---|
| 281 | This function is responsible for closing BADS module. Closing BADS |
|---|
| 282 | will free main BADS handle. It is required that all opened |
|---|
| 283 | BDQS channels must be closed before calling this function. If this |
|---|
| 284 | is not done, the results will be unpredicable. |
|---|
| 285 | |
|---|
| 286 | Returns: |
|---|
| 287 | TODO: |
|---|
| 288 | |
|---|
| 289 | See Also: |
|---|
| 290 | BADS_3x7x_Open(), BADS_3x7x_CloseChannel() |
|---|
| 291 | |
|---|
| 292 | ****************************************************************************/ |
|---|
| 293 | BERR_Code BADS_3x7x_Close( |
|---|
| 294 | BADS_Handle hDev /* [in] Device handle */ |
|---|
| 295 | ); |
|---|
| 296 | |
|---|
| 297 | /*************************************************************************** |
|---|
| 298 | Summary: |
|---|
| 299 | This function initialize Qam In-Band Downstream module. |
|---|
| 300 | |
|---|
| 301 | Description: |
|---|
| 302 | This function is responsible for initializing BADS module. The initialize |
|---|
| 303 | function may do none or one or more of the following: |
|---|
| 304 | - Download FW into ADS core |
|---|
| 305 | - Startup ADS core |
|---|
| 306 | - Retrieve information from ADS core regarding ADS static configuration |
|---|
| 307 | - etc |
|---|
| 308 | |
|---|
| 309 | Returns: |
|---|
| 310 | TODO: |
|---|
| 311 | |
|---|
| 312 | See Also: |
|---|
| 313 | BADS_3x7x_Open(), BADS_3x7x_Close() |
|---|
| 314 | |
|---|
| 315 | ****************************************************************************/ |
|---|
| 316 | BERR_Code BADS_3x7x_Init( |
|---|
| 317 | BADS_Handle hDev /* [in] Device handle */ |
|---|
| 318 | ); |
|---|
| 319 | |
|---|
| 320 | /*************************************************************************** |
|---|
| 321 | Summary: |
|---|
| 322 | This function returns the version information. |
|---|
| 323 | |
|---|
| 324 | Description: |
|---|
| 325 | This function is responsible for returning the version information. |
|---|
| 326 | |
|---|
| 327 | Returns: |
|---|
| 328 | TODO: |
|---|
| 329 | |
|---|
| 330 | See Also: |
|---|
| 331 | BADS_3x7x_Open() |
|---|
| 332 | |
|---|
| 333 | ****************************************************************************/ |
|---|
| 334 | BERR_Code BADS_3x7x_GetVersion( |
|---|
| 335 | BADS_Handle hDev, /* [in] Device handle */ |
|---|
| 336 | BADS_Version *pVersion /* [out] Returns version */ |
|---|
| 337 | ); |
|---|
| 338 | |
|---|
| 339 | /*************************************************************************** |
|---|
| 340 | Summary: |
|---|
| 341 | This function returns the total number of channels supported by |
|---|
| 342 | Qam In-Band Downstream module. |
|---|
| 343 | |
|---|
| 344 | Description: |
|---|
| 345 | This function is responsible for getting total number of channels |
|---|
| 346 | supported by BADS module, since BADS device is implemented as a |
|---|
| 347 | device channel. |
|---|
| 348 | |
|---|
| 349 | Returns: |
|---|
| 350 | TODO: |
|---|
| 351 | |
|---|
| 352 | See Also: |
|---|
| 353 | BADS_3x7x_OpenChannel(), BADS_3x7x_ChannelDefaultSettings() |
|---|
| 354 | |
|---|
| 355 | ****************************************************************************/ |
|---|
| 356 | BERR_Code BADS_3x7x_GetTotalChannels( |
|---|
| 357 | BADS_Handle hDev, /* [in] Device handle */ |
|---|
| 358 | unsigned int *totalChannels /* [out] Returns total number downstream channels supported */ |
|---|
| 359 | ); |
|---|
| 360 | |
|---|
| 361 | /*************************************************************************** |
|---|
| 362 | Summary: |
|---|
| 363 | This function opens Qam In-Band Downstream module channel. |
|---|
| 364 | |
|---|
| 365 | Description: |
|---|
| 366 | This function is responsible for opening BADS module channel. When a |
|---|
| 367 | BADS channel is opened, it will create a module channel handle and |
|---|
| 368 | configure the module based on the channel default settings. Once a |
|---|
| 369 | channel is opened, it must be closed before it can be opened again. |
|---|
| 370 | |
|---|
| 371 | Returns: |
|---|
| 372 | TODO: |
|---|
| 373 | |
|---|
| 374 | See Also: |
|---|
| 375 | BADS_3x7x_CloseChannel(), BADS_3x7x_GetChannelDefaultSettings() |
|---|
| 376 | |
|---|
| 377 | ****************************************************************************/ |
|---|
| 378 | BERR_Code BADS_3x7x_OpenChannel( |
|---|
| 379 | BADS_Handle hDev, /* [in] Device handle */ |
|---|
| 380 | BADS_ChannelHandle *phChn, /* [out] Returns channel handle */ |
|---|
| 381 | unsigned int channelNo, /* [in] Channel number to open */ |
|---|
| 382 | const struct BADS_ChannelSettings *pChnDefSettings /* [in] Channel default setting */ |
|---|
| 383 | ); |
|---|
| 384 | |
|---|
| 385 | /*************************************************************************** |
|---|
| 386 | Summary: |
|---|
| 387 | This function closes Qam In-Band Downstream module channel. |
|---|
| 388 | |
|---|
| 389 | Description: |
|---|
| 390 | This function is responsible for closing BADS module channel. Closing |
|---|
| 391 | BADS channel it will free BADS channel handle. It is required that all |
|---|
| 392 | opened BDQS channels must be closed before closing BADS. |
|---|
| 393 | |
|---|
| 394 | Returns: |
|---|
| 395 | TODO: |
|---|
| 396 | |
|---|
| 397 | See Also: |
|---|
| 398 | BADS_3x7x_OpenChannel(), BADS_3x7x_CloseChannel() |
|---|
| 399 | |
|---|
| 400 | ****************************************************************************/ |
|---|
| 401 | BERR_Code BADS_3x7x_CloseChannel( |
|---|
| 402 | BADS_ChannelHandle hChn /* [in] Device channel handle */ |
|---|
| 403 | ); |
|---|
| 404 | |
|---|
| 405 | /*************************************************************************** |
|---|
| 406 | Summary: |
|---|
| 407 | This function gets Qam In-Band Downstream module device handle based on |
|---|
| 408 | the device channel handle. |
|---|
| 409 | |
|---|
| 410 | Description: |
|---|
| 411 | This function is responsible returning BADS module handle based on the |
|---|
| 412 | BADS module channel. |
|---|
| 413 | |
|---|
| 414 | Returns: |
|---|
| 415 | TODO: |
|---|
| 416 | |
|---|
| 417 | See Also: |
|---|
| 418 | |
|---|
| 419 | ****************************************************************************/ |
|---|
| 420 | BERR_Code BADS_3x7x_GetDevice( |
|---|
| 421 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 422 | BADS_Handle *pQds /* [out] Returns Device handle */ |
|---|
| 423 | ); |
|---|
| 424 | |
|---|
| 425 | |
|---|
| 426 | /*************************************************************************** |
|---|
| 427 | Summary: |
|---|
| 428 | This function gets default setting for a Qam In-Band Downstream module channel. |
|---|
| 429 | |
|---|
| 430 | Description: |
|---|
| 431 | This function is responsible for returning the default setting for |
|---|
| 432 | channel of BADS. The return default setting is used when opening |
|---|
| 433 | a channel. |
|---|
| 434 | |
|---|
| 435 | Returns: |
|---|
| 436 | TODO: |
|---|
| 437 | |
|---|
| 438 | See Also: |
|---|
| 439 | BADS_3x7x_OpenChannel() |
|---|
| 440 | |
|---|
| 441 | ****************************************************************************/ |
|---|
| 442 | BERR_Code BADS_3x7x_GetChannelDefaultSettings( |
|---|
| 443 | BADS_Handle hDev, /* [in] Device handle */ |
|---|
| 444 | unsigned int channelNo, /* [in] Channel number to default setting for */ |
|---|
| 445 | BADS_ChannelSettings *pChnDefSettings /* [out] Returns channel default setting */ |
|---|
| 446 | ); |
|---|
| 447 | |
|---|
| 448 | /*************************************************************************** |
|---|
| 449 | Summary: |
|---|
| 450 | This function gets the status of Qam In-Band Downstream module channel. |
|---|
| 451 | |
|---|
| 452 | Description: |
|---|
| 453 | This function is responsible for getting the complete status for |
|---|
| 454 | a Qam In-Band Downstream module channel. |
|---|
| 455 | |
|---|
| 456 | Returns: |
|---|
| 457 | TODO: |
|---|
| 458 | |
|---|
| 459 | See Also: |
|---|
| 460 | |
|---|
| 461 | ****************************************************************************/ |
|---|
| 462 | BERR_Code BADS_3x7x_GetStatus( |
|---|
| 463 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 464 | BADS_Status *pStatus /* [out] Returns status */ |
|---|
| 465 | ); |
|---|
| 466 | |
|---|
| 467 | /*************************************************************************** |
|---|
| 468 | Summary: |
|---|
| 469 | This function gets the lock status for a Qam In-Band Downstream |
|---|
| 470 | module channel. |
|---|
| 471 | |
|---|
| 472 | Description: |
|---|
| 473 | This function is responsible for getting the lock status |
|---|
| 474 | for a BADS module channel. |
|---|
| 475 | |
|---|
| 476 | Returns: |
|---|
| 477 | TODO: |
|---|
| 478 | |
|---|
| 479 | See Also: |
|---|
| 480 | BADS_3x7x_GetStatus() |
|---|
| 481 | |
|---|
| 482 | ****************************************************************************/ |
|---|
| 483 | BERR_Code BADS_3x7x_GetLockStatus( |
|---|
| 484 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 485 | BADS_LockStatus *pLockStatus /* [out] Returns lock status */ |
|---|
| 486 | ); |
|---|
| 487 | |
|---|
| 488 | /*************************************************************************** |
|---|
| 489 | Summary: |
|---|
| 490 | This function gets the I and Q values for soft decision of a |
|---|
| 491 | Qam In-Band Downstream module channel. |
|---|
| 492 | |
|---|
| 493 | Description: |
|---|
| 494 | This function is responsible for getting the I and Q values for soft |
|---|
| 495 | decision of a BADS module channel. |
|---|
| 496 | |
|---|
| 497 | Returns: |
|---|
| 498 | TODO: |
|---|
| 499 | |
|---|
| 500 | See Also: |
|---|
| 501 | |
|---|
| 502 | ****************************************************************************/ |
|---|
| 503 | BERR_Code BADS_3x7x_GetSoftDecision( |
|---|
| 504 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 505 | int16_t nbrToGet, /* [in] Number values to get */ |
|---|
| 506 | int16_t *ival, /* [out] Ptr to array to store output I soft decision */ |
|---|
| 507 | int16_t *qVal, /* [out] Ptr to array to store output Q soft decision */ |
|---|
| 508 | int16_t *nbrGotten /* [out] Number of values gotten/read */ |
|---|
| 509 | ); |
|---|
| 510 | |
|---|
| 511 | |
|---|
| 512 | /*************************************************************************** |
|---|
| 513 | Summary: |
|---|
| 514 | This function installs a callback function for Lock State Change event. |
|---|
| 515 | |
|---|
| 516 | Description: |
|---|
| 517 | This function is responsible for installing a callback function for |
|---|
| 518 | Lock State Change event. The application code should use this function |
|---|
| 519 | to install a callback function, which will be called when the |
|---|
| 520 | Qam In-Band Downstream channel changes lock state. |
|---|
| 521 | A lock state change is defined at switching from Lock-Unlock or Unlock-Lock. |
|---|
| 522 | To determine the current lock state, a call to BADS_GetLockStatus() is |
|---|
| 523 | required. To get more a more detail status, call BADS_GetStatus(). |
|---|
| 524 | |
|---|
| 525 | Note: It is "highly" recommended that the callback function do the minimum |
|---|
| 526 | require to notify the application of this event, such sent a message or |
|---|
| 527 | fire an event. This callback function may be called from an |
|---|
| 528 | interrupt context. Please use with caution. |
|---|
| 529 | |
|---|
| 530 | Returns: |
|---|
| 531 | TODO: |
|---|
| 532 | |
|---|
| 533 | See Also: |
|---|
| 534 | BADS_3x7x_GetLockStatus(), BADS_3x7x_GetStatus() |
|---|
| 535 | |
|---|
| 536 | ****************************************************************************/ |
|---|
| 537 | BERR_Code BADS_3x7x_InstallCallback( |
|---|
| 538 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 539 | BADS_Callback callbackType, /* [in] type of Callback */ |
|---|
| 540 | BADS_CallbackFunc pCallbackFunc, /* [in] Pointer to completion callback. */ |
|---|
| 541 | void *pParam /* [in] Pointer to callback user data. */ |
|---|
| 542 | ); |
|---|
| 543 | |
|---|
| 544 | /*************************************************************************** |
|---|
| 545 | Summary: |
|---|
| 546 | This function tries to acquire downstream lock for the specific |
|---|
| 547 | Qam In-Band Downstream module channel. |
|---|
| 548 | |
|---|
| 549 | Description: |
|---|
| 550 | This function is responsible for trying to acquire downstream lock of |
|---|
| 551 | the input IF signal. Acquiring downstream lock involves configuring |
|---|
| 552 | the H/W to desire configuration, then running a Qam In-Band Downstream |
|---|
| 553 | acquisition script. If this is the first acquisition for the current |
|---|
| 554 | annex mode, then a Qam In-Band Downstream configuration script will be run |
|---|
| 555 | prior to running acquisition script. |
|---|
| 556 | This function will automatically enable the downstream receiver if |
|---|
| 557 | the receiver was in power-saver mode. |
|---|
| 558 | |
|---|
| 559 | Returns: |
|---|
| 560 | TODO: |
|---|
| 561 | |
|---|
| 562 | See Also: |
|---|
| 563 | BADS_3x7x_GetLock(), BADS_3x7x_GetStatus(), BADS_3x7x_GetSoftDecision() |
|---|
| 564 | |
|---|
| 565 | ****************************************************************************/ |
|---|
| 566 | BERR_Code BADS_3x7x_Acquire( |
|---|
| 567 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 568 | BADS_InbandParam *ibParam /* [in] Inband Parameters to use */ |
|---|
| 569 | ); |
|---|
| 570 | |
|---|
| 571 | /*************************************************************************** |
|---|
| 572 | Summary: |
|---|
| 573 | This function enable the power-saver mode. |
|---|
| 574 | |
|---|
| 575 | Description: |
|---|
| 576 | This function is responsible for enabling the downstream receiver |
|---|
| 577 | power-saver mode. When the BADS is in the power-saver mode, the |
|---|
| 578 | Qam In-Band Downstream receiver is shutdown. |
|---|
| 579 | |
|---|
| 580 | Returns: |
|---|
| 581 | TODO: |
|---|
| 582 | |
|---|
| 583 | See Also: |
|---|
| 584 | BADS_3x7x_EnablePowerSaver() |
|---|
| 585 | |
|---|
| 586 | ****************************************************************************/ |
|---|
| 587 | BERR_Code BADS_3x7x_EnablePowerSaver( |
|---|
| 588 | BADS_ChannelHandle hChn /* [in] Device channel handle */ |
|---|
| 589 | ); |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | /*************************************************************************** |
|---|
| 593 | Summary: |
|---|
| 594 | This function disable the power-saver mode. |
|---|
| 595 | |
|---|
| 596 | Description: |
|---|
| 597 | This function is responsible for enabling the downstream receiver |
|---|
| 598 | power-saver mode. When the BADS is in the power-saver mode, the |
|---|
| 599 | Qam In-Band Downstream receiver is shutdown. |
|---|
| 600 | |
|---|
| 601 | Returns: |
|---|
| 602 | TODO: |
|---|
| 603 | |
|---|
| 604 | See Also: |
|---|
| 605 | BADS_3x7x_DisablePowerSaver() |
|---|
| 606 | |
|---|
| 607 | ****************************************************************************/ |
|---|
| 608 | BERR_Code BADS_3x7x_DisablePowerSaver( |
|---|
| 609 | BADS_ChannelHandle hChn /* [in] Device channel handle */ |
|---|
| 610 | ); |
|---|
| 611 | |
|---|
| 612 | /*************************************************************************** |
|---|
| 613 | Summary: |
|---|
| 614 | This function is responsible for processing a notificiation for the specific |
|---|
| 615 | Qam In-Band Downstream module channel. |
|---|
| 616 | |
|---|
| 617 | Description: |
|---|
| 618 | This function needs to called when notification is received. |
|---|
| 619 | |
|---|
| 620 | Returns: |
|---|
| 621 | TODO: |
|---|
| 622 | |
|---|
| 623 | See Also: |
|---|
| 624 | |
|---|
| 625 | ****************************************************************************/ |
|---|
| 626 | BERR_Code BADS_3x7x_ProcessNotification( |
|---|
| 627 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 628 | unsigned int event /* [in] Event code and event data*/ |
|---|
| 629 | ); |
|---|
| 630 | |
|---|
| 631 | /*************************************************************************** |
|---|
| 632 | Summary: |
|---|
| 633 | This function opens configures (enables/disables) the 75xx device's |
|---|
| 634 | RF out for daisy chaining. |
|---|
| 635 | |
|---|
| 636 | Description: |
|---|
| 637 | This function opens configures (enables/disables) the 75xx device's |
|---|
| 638 | RF out for daisy chaining. |
|---|
| 639 | |
|---|
| 640 | Returns: |
|---|
| 641 | TODO: |
|---|
| 642 | |
|---|
| 643 | See Also: |
|---|
| 644 | ****************************************************************************/ |
|---|
| 645 | BERR_Code BADS_3x7x_SetDaisyChain( |
|---|
| 646 | BADS_Handle hDev, /* [in] Returns handle */ |
|---|
| 647 | bool enableDaisyChain /* [in] Eanble/disable daisy chain. */ |
|---|
| 648 | ); |
|---|
| 649 | |
|---|
| 650 | /*************************************************************************** |
|---|
| 651 | Summary: |
|---|
| 652 | This function opens tells if the 75xx device's RF out daisy chaining is enabled/disabled. |
|---|
| 653 | |
|---|
| 654 | Description: |
|---|
| 655 | This function opens tells if the 75xx device's RF out daisy chaining is enabled/disabled. |
|---|
| 656 | |
|---|
| 657 | Returns: |
|---|
| 658 | TODO: |
|---|
| 659 | |
|---|
| 660 | See Also: |
|---|
| 661 | ****************************************************************************/ |
|---|
| 662 | |
|---|
| 663 | BERR_Code BADS_3x7x_GetDaisyChain( |
|---|
| 664 | BADS_Handle hDev, /* [in] Returns handle */ |
|---|
| 665 | bool *isEnableDaisyChain /* [in] Eanble/disable daisy chain. */ |
|---|
| 666 | ); |
|---|
| 667 | |
|---|
| 668 | /*************************************************************************** |
|---|
| 669 | Summary: |
|---|
| 670 | This function resets the 75xx device's FEC bit error and block counters. |
|---|
| 671 | |
|---|
| 672 | Description: |
|---|
| 673 | |
|---|
| 674 | Returns: |
|---|
| 675 | TODO: |
|---|
| 676 | |
|---|
| 677 | See Also: |
|---|
| 678 | ****************************************************************************/ |
|---|
| 679 | BERR_Code BADS_3x7x_ResetStatus( |
|---|
| 680 | BADS_ChannelHandle hDev /* [in] Returns handle */ |
|---|
| 681 | ); |
|---|
| 682 | |
|---|
| 683 | |
|---|
| 684 | /*************************************************************************** |
|---|
| 685 | Summary: |
|---|
| 686 | Get the Event handle |
|---|
| 687 | |
|---|
| 688 | Description: |
|---|
| 689 | |
|---|
| 690 | Returns: |
|---|
| 691 | TODO: |
|---|
| 692 | |
|---|
| 693 | See Also: |
|---|
| 694 | ****************************************************************************/ |
|---|
| 695 | |
|---|
| 696 | BERR_Code BADS_3x7x_GetInterruptEventHandle( |
|---|
| 697 | BADS_Handle hDev, /* [in] BADS handle */ |
|---|
| 698 | BKNI_EventHandle *phEvent /* [out] event handle */ |
|---|
| 699 | ); |
|---|
| 700 | |
|---|
| 701 | /*************************************************************************** |
|---|
| 702 | Summary: |
|---|
| 703 | Process the Interrupt event |
|---|
| 704 | |
|---|
| 705 | Description: |
|---|
| 706 | |
|---|
| 707 | Returns: |
|---|
| 708 | TODO: |
|---|
| 709 | |
|---|
| 710 | See Also: |
|---|
| 711 | ****************************************************************************/ |
|---|
| 712 | BERR_Code BADS_3x7x_ProcessInterruptEvent( |
|---|
| 713 | BADS_Handle hDev /* [in] Returns handle */ |
|---|
| 714 | ); |
|---|
| 715 | |
|---|
| 716 | /*************************************************************************** |
|---|
| 717 | Summary: |
|---|
| 718 | Stop the ADS timer |
|---|
| 719 | |
|---|
| 720 | Description: |
|---|
| 721 | |
|---|
| 722 | Returns: |
|---|
| 723 | TODO: |
|---|
| 724 | |
|---|
| 725 | See Also: |
|---|
| 726 | ****************************************************************************/ |
|---|
| 727 | BERR_Code BADS_3x7x_Untune( |
|---|
| 728 | BADS_Handle hDev /* [in] Returns handle */ |
|---|
| 729 | ); |
|---|
| 730 | /*************************************************************************** |
|---|
| 731 | Summary: |
|---|
| 732 | Set the Scan param |
|---|
| 733 | |
|---|
| 734 | Description: |
|---|
| 735 | |
|---|
| 736 | Returns: |
|---|
| 737 | TODO: |
|---|
| 738 | |
|---|
| 739 | See Also: |
|---|
| 740 | ****************************************************************************/ |
|---|
| 741 | BERR_Code BADS_3x7x_SetScanParam( |
|---|
| 742 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 743 | BADS_ChannelScanSettings *pChnScanSettings |
|---|
| 744 | ); |
|---|
| 745 | /*************************************************************************** |
|---|
| 746 | Summary: |
|---|
| 747 | Get the Scan param |
|---|
| 748 | |
|---|
| 749 | Description: |
|---|
| 750 | |
|---|
| 751 | Returns: |
|---|
| 752 | TODO: |
|---|
| 753 | |
|---|
| 754 | See Also: |
|---|
| 755 | ****************************************************************************/ |
|---|
| 756 | BERR_Code BADS_3x7x_GetScanParam( |
|---|
| 757 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 758 | BADS_ChannelScanSettings *pChnScanSettings |
|---|
| 759 | ); |
|---|
| 760 | |
|---|
| 761 | void BADS_3x7x_TimerFunc(void *myParam1, int myParam2); |
|---|
| 762 | BERR_Code BADS_3x7x_SetAcquireParams(BADS_3x7x_ChannelHandle hChn, const BADS_Acquire_Params_t* pMesgData); |
|---|
| 763 | BERR_Code BADS_3x7x_SetScanParams(BADS_3x7x_ChannelHandle hChn, const BADS_Scan_Params_t* pMesgData); |
|---|
| 764 | BERR_Code BADS_3x7x_SetAcqWords(BADS_3x7x_ChannelHandle hChn, const BADS_Internal_Params_t* pMesgData); |
|---|
| 765 | BERR_Code BADS_3x7x_GetScanStatus( |
|---|
| 766 | BADS_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 767 | BADS_ScanStatus *pChnScanStatus /* [out] Device Scan Status */ |
|---|
| 768 | ); |
|---|
| 769 | |
|---|
| 770 | /*************************************************************************** |
|---|
| 771 | Summary: |
|---|
| 772 | Data for the ADS callback |
|---|
| 773 | ****************************************************************************/ |
|---|
| 774 | /*This is a single NON-channelized structure called on demand then sent through the HAB*/ |
|---|
| 775 | /*Each sub-structure is completely filled by an appropriate function call*/ |
|---|
| 776 | |
|---|
| 777 | typedef enum BADS_CallbackMode |
|---|
| 778 | { |
|---|
| 779 | /* Most of these are currently not supported, are here for future use */ |
|---|
| 780 | BADS_CallbackMode_eSetMode = 0, |
|---|
| 781 | BADS_CallbackMode_eRequestMode = 1, |
|---|
| 782 | BADS_CallbackMode_eLast |
|---|
| 783 | } BADS_CallbackMode; |
|---|
| 784 | |
|---|
| 785 | |
|---|
| 786 | typedef struct BADS_P_AdsCallbackData_s |
|---|
| 787 | { |
|---|
| 788 | void* hTunerChn; |
|---|
| 789 | uint16_t Mode; /*Callback is to send data on eSetMode, Callback is to get data on eRequestMode*/ |
|---|
| 790 | uint32_t Symbol_Rate; /*Upper Symbol_Rate currently being scanned on eSetMode: return last value sent on eRequestMode*/ |
|---|
| 791 | int32_t Freq_Offset; /*Front end offset to use on eSetMode: return last value sent on eRequestMode*/ |
|---|
| 792 | uint32_t RF_Freq; /*RF frequency of the tuner on eRequestMode: set to 0 if unknown*/ |
|---|
| 793 | int32_t Total_Mix_After_ADC; /*Sum of mixer frequencies after ADC on eRequestMode*/ |
|---|
| 794 | int16_t PreADC_Gain_x256db ; /*Gain in db*256 before ADC on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 795 | int16_t PostADC_Gain_x256db; /*Gain in db*256 after ADC on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 796 | int16_t External_Gain_x256db; /*Gain in db*256 external to chip (like external LNA) on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 797 | }BADS_P_AdsCallbackData_t; |
|---|
| 798 | |
|---|
| 799 | /***************************************************************/ |
|---|
| 800 | /***************************************************************/ |
|---|
| 801 | |
|---|
| 802 | /******************************************************************************* |
|---|
| 803 | * |
|---|
| 804 | * Private Module Handles |
|---|
| 805 | * |
|---|
| 806 | *******************************************************************************/ |
|---|
| 807 | |
|---|
| 808 | |
|---|
| 809 | typedef struct BADS_P_3x7x_Handle |
|---|
| 810 | { |
|---|
| 811 | uint32_t magicId; /* Used to check if structure is corrupt */ |
|---|
| 812 | BCHP_Handle hChip; |
|---|
| 813 | BINT_Handle hInterrupt; |
|---|
| 814 | BREG_Handle hRegister; |
|---|
| 815 | unsigned int mxChnNo; |
|---|
| 816 | BADS_3x7x_ChannelHandle hAdsChn[MX_ADS_CHANNELS]; |
|---|
| 817 | bool isDaisyChain; |
|---|
| 818 | BKNI_EventHandle hIntEvent; |
|---|
| 819 | bool timerStopped; |
|---|
| 820 | BTMR_TimerHandle hTimer; |
|---|
| 821 | BTMR_TimerHandle hStatusTimer; |
|---|
| 822 | BADS_FecLock LockStatus[MX_ADS_CHANNELS]; |
|---|
| 823 | } BADS_P_3x7x_Handle; |
|---|
| 824 | |
|---|
| 825 | |
|---|
| 826 | typedef struct BADS_P_3x7x_ChannelHandle |
|---|
| 827 | { |
|---|
| 828 | uint32_t magicId; /* Used to check if structure is corrupt */ |
|---|
| 829 | BREG_Handle hRegister; |
|---|
| 830 | BADS_ChannelHandle hChnAds; |
|---|
| 831 | BADS_3x7x_Handle hAds; |
|---|
| 832 | unsigned int chnNo; |
|---|
| 833 | bool isLock; /* current lock status */ |
|---|
| 834 | BADS_3x7x_AcqParams_t *pChnAcqParam; |
|---|
| 835 | BADS_3x7x_ChnLockStatus_t *pChnLockStatus; |
|---|
| 836 | BADS_3x7x_ChnScanStatus_t *pChnScanStatus; /* channel status obtained post acquire or post scan with BADS_3x7x_GetScanStatus() */ |
|---|
| 837 | BADS_3x7x_ChnStatus_t *pChnStatus; /* channel status updated with BADS_3x7x_GetStatus() */ |
|---|
| 838 | |
|---|
| 839 | BADS_3x7x_Chan_PowerStatus ePowerStatus; /* channel power (on/off) status */ |
|---|
| 840 | #if BCHP_DS_CORE_V_9_1 |
|---|
| 841 | BKNI_EventHandle hChscnEvent; |
|---|
| 842 | BKNI_EventHandle hFcaEvent; |
|---|
| 843 | #elif ((BCHP_DS_CORE_V_9_2) || (BCHP_DS_CORE_V_9_4)) |
|---|
| 844 | BKNI_EventHandle hFftEvent; |
|---|
| 845 | #endif |
|---|
| 846 | BADS_CallbackFunc pCallback[BADS_Callback_eLast]; |
|---|
| 847 | void *pCallbackParam[BADS_Callback_eLast]; |
|---|
| 848 | BINT_CallbackHandle hDs2Callback; |
|---|
| 849 | } BADS_P_3x7x_ChannelHandle; |
|---|
| 850 | |
|---|
| 851 | #ifdef __cplusplus |
|---|
| 852 | } |
|---|
| 853 | #endif |
|---|
| 854 | |
|---|
| 855 | #endif |
|---|
| 856 | |
|---|