| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2004-2009, 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: bvsb.c $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/18 $ |
|---|
| 12 | * $brcm_Date: 5/19/09 11:04a $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/vsb/bvsb.c $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/18 5/19/09 11:04a dliu |
|---|
| 21 | * PR55183: Add OOB lock interrupts |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/17 3/24/09 3:38p dliu |
|---|
| 24 | * PR53219: Add OOB control for 3520 |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/16 1/12/09 2:18p dliu |
|---|
| 27 | * PR50693: Change arguments to SetPgaGain |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/15 11/12/08 6:02p dliu |
|---|
| 30 | * PR47770: Change from Pga_Gain to PgaGain |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/14 10/20/08 11:55a dliu |
|---|
| 33 | * PR47770:Add PGA interface |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/PR47770/1 10/10/08 7:38p jerryy |
|---|
| 36 | * PR47770:Add PGA interface |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/13 9/29/08 4:48p dliu |
|---|
| 39 | * PR46516: Add dynamic power management api |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/12 5/7/08 4:50p dliu |
|---|
| 42 | * PR38953: Add detect type back to ChannelDetect() function |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/11 11/28/06 4:21p dliu |
|---|
| 45 | * PR23867: Update changes in 3563 |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/10 11/14/06 11:21a dliu |
|---|
| 48 | * PR25214: Added BCHP_GetChipRevsion function implementation |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/9 10/6/05 4:13p dliu |
|---|
| 51 | * PR17430: Added IF AGC/SNR control for video kill |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/8 9/29/05 4:21p dliu |
|---|
| 54 | * PR 17253: Added IFD weak signal detection and chroma kill |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/7 9/28/05 2:18p dliu |
|---|
| 57 | * PR 17253: Added IFD weak signal detection and chroma kill |
|---|
| 58 | * |
|---|
| 59 | * Hydra_Software_Devel/6 3/5/05 9:10a enavarro |
|---|
| 60 | * PR 14005: added BVSB_GetSettings() and BVSB_SetSettings() |
|---|
| 61 | * |
|---|
| 62 | * Hydra_Software_Devel/5 2/1/05 2:41p enavarro |
|---|
| 63 | * PR 14005: fixed function names ResetOobStatus and SetBtscVolume |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/4 2/1/05 10:21a enavarro |
|---|
| 66 | * PR 14005: return BERR_NOT_SUPPORTED if function not in API function |
|---|
| 67 | * table in settings struct |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/3 2/1/05 9:42a enavarro |
|---|
| 70 | * PR 14005: pass in BINT_Handle to BVSB_Open() |
|---|
| 71 | * |
|---|
| 72 | * Hydra_Software_Devel/2 10/1/04 3:25p brianlee |
|---|
| 73 | * PR12857: Modified code to comform to magnum coding convention. |
|---|
| 74 | * |
|---|
| 75 | ***************************************************************************/ |
|---|
| 76 | |
|---|
| 77 | #include "bstd.h" |
|---|
| 78 | #include "bvsb.h" |
|---|
| 79 | #include "bvsb_priv.h" |
|---|
| 80 | |
|---|
| 81 | BDBG_MODULE(bvsb); |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | /****************************************************************************** |
|---|
| 85 | BVSB_Open() |
|---|
| 86 | ******************************************************************************/ |
|---|
| 87 | BERR_Code BVSB_Open( |
|---|
| 88 | BVSB_Handle *h, /* [out] BVSB handle */ |
|---|
| 89 | BCHP_Handle hChip, /* [in] chip handle */ |
|---|
| 90 | void *pReg, /* [in] pointer to register or i2c handle */ |
|---|
| 91 | BINT_Handle hInterrupt, /* [in] Interrupt handle */ |
|---|
| 92 | const BVSB_Settings *pDefSettings /* [in] default settings */ |
|---|
| 93 | ) |
|---|
| 94 | { |
|---|
| 95 | BDBG_ASSERT(h); |
|---|
| 96 | BDBG_ASSERT(pReg); |
|---|
| 97 | BDBG_ASSERT(pDefSettings); |
|---|
| 98 | |
|---|
| 99 | return (pDefSettings->api.Open(h, hChip, pReg, hInterrupt, pDefSettings)); |
|---|
| 100 | } |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | /****************************************************************************** |
|---|
| 104 | BVSB_Close() |
|---|
| 105 | ******************************************************************************/ |
|---|
| 106 | BERR_Code BVSB_Close( |
|---|
| 107 | BVSB_Handle h /* [in] BVSB handle */ |
|---|
| 108 | ) |
|---|
| 109 | { |
|---|
| 110 | BDBG_ASSERT(h); |
|---|
| 111 | return (h->settings.api.Close(h)); |
|---|
| 112 | } |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | /****************************************************************************** |
|---|
| 116 | BVSB_InitAp() |
|---|
| 117 | ******************************************************************************/ |
|---|
| 118 | BERR_Code BVSB_InitAp( |
|---|
| 119 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 120 | const uint8_t *pImage /* [in] pointer to the AP image */ |
|---|
| 121 | ) |
|---|
| 122 | { |
|---|
| 123 | BDBG_ASSERT(h); |
|---|
| 124 | return (h->settings.api.InitAp(h, pImage)); |
|---|
| 125 | } |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | /****************************************************************************** |
|---|
| 129 | BVSB_GetApStatus() |
|---|
| 130 | ******************************************************************************/ |
|---|
| 131 | BERR_Code BVSB_GetApStatus( |
|---|
| 132 | BVSB_Handle h, /* [in] VSB device handle */ |
|---|
| 133 | BVSB_ApStatus *pStatus /* [out] AP status */ |
|---|
| 134 | ) |
|---|
| 135 | { |
|---|
| 136 | BDBG_ASSERT(h); |
|---|
| 137 | return (h->settings.api.GetApStatus(h, pStatus)); |
|---|
| 138 | } |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | /****************************************************************************** |
|---|
| 142 | BVSB_GetApVersion() |
|---|
| 143 | ******************************************************************************/ |
|---|
| 144 | BERR_Code BVSB_GetApVersion( |
|---|
| 145 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 146 | uint16_t *pChipId, /* [out] VSB chip id */ |
|---|
| 147 | uint16_t *pChipVer, /* [out] chip revision number */ |
|---|
| 148 | uint8_t *pApVer, /* [out] AP microcode version */ |
|---|
| 149 | uint8_t *pScrVer, /* [out] acquisition script version */ |
|---|
| 150 | uint8_t *pCfgVer /* [out] host configuration version */ |
|---|
| 151 | ) |
|---|
| 152 | { |
|---|
| 153 | BDBG_ASSERT(h); |
|---|
| 154 | return (h->settings.api.GetApVersion(h, pChipId, pChipVer, pApVer, pScrVer, pCfgVer)); |
|---|
| 155 | } |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | /****************************************************************************** |
|---|
| 159 | BVSB_ReadRegister() |
|---|
| 160 | ******************************************************************************/ |
|---|
| 161 | BERR_Code BVSB_ReadRegister( |
|---|
| 162 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 163 | uint32_t reg, /* [in] address of register to read */ |
|---|
| 164 | uint32_t *val /* [in] contains data that was read */ |
|---|
| 165 | ) |
|---|
| 166 | { |
|---|
| 167 | BDBG_ASSERT(h); |
|---|
| 168 | return (h->settings.api.ReadRegister(h, reg, val)); |
|---|
| 169 | } |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | /****************************************************************************** |
|---|
| 173 | BVSB_WriteRegister() |
|---|
| 174 | ******************************************************************************/ |
|---|
| 175 | BERR_Code BVSB_WriteRegister( |
|---|
| 176 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 177 | uint32_t reg, /* [in] address of register to read */ |
|---|
| 178 | uint32_t *val /* [in] contains data that was read */ |
|---|
| 179 | ) |
|---|
| 180 | { |
|---|
| 181 | BDBG_ASSERT(h); |
|---|
| 182 | return (h->settings.api.WriteRegister(h, reg, val)); |
|---|
| 183 | } |
|---|
| 184 | |
|---|
| 185 | |
|---|
| 186 | /****************************************************************************** |
|---|
| 187 | BVSB_Mi2cWrite() |
|---|
| 188 | ******************************************************************************/ |
|---|
| 189 | BERR_Code BVSB_Mi2cWrite( |
|---|
| 190 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 191 | uint8_t slave_addr, /* [in] address of the i2c slave device */ |
|---|
| 192 | uint8_t *buf, /* [in] specifies the data to transmit */ |
|---|
| 193 | uint8_t n /* [in] number of bytes to transmit after the i2c slave address */ |
|---|
| 194 | ) |
|---|
| 195 | { |
|---|
| 196 | BDBG_ASSERT(h); |
|---|
| 197 | if (h->settings.api.Mi2cWrite) |
|---|
| 198 | return (h->settings.api.Mi2cWrite(h, slave_addr, buf, n)); |
|---|
| 199 | else |
|---|
| 200 | return BERR_NOT_SUPPORTED; |
|---|
| 201 | } |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | /****************************************************************************** |
|---|
| 205 | BVSB_Mi2cRead() |
|---|
| 206 | ******************************************************************************/ |
|---|
| 207 | BERR_Code BVSB_Mi2cRead( |
|---|
| 208 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 209 | uint8_t slave_addr, /* [in] address of the i2c slave device */ |
|---|
| 210 | uint8_t *out_buf, /* [in] specifies the data to transmit before the i2c restart condition */ |
|---|
| 211 | uint8_t out_n, /* [in] number of bytes to transmit before the i2c restart condition not including the i2c slave address */ |
|---|
| 212 | uint8_t *in_buf, /* [out] holds the data read */ |
|---|
| 213 | uint8_t in_n /* [in] number of bytes to read after the i2c restart condition not including the i2c slave address */ |
|---|
| 214 | ) |
|---|
| 215 | { |
|---|
| 216 | BDBG_ASSERT(h); |
|---|
| 217 | if (h->settings.api.Mi2cRead) |
|---|
| 218 | return (h->settings.api.Mi2cRead(h, slave_addr, out_buf, out_n, in_buf, in_n)); |
|---|
| 219 | else |
|---|
| 220 | return BERR_NOT_SUPPORTED; |
|---|
| 221 | } |
|---|
| 222 | |
|---|
| 223 | |
|---|
| 224 | /****************************************************************************** |
|---|
| 225 | BVSB_AcquireInband() |
|---|
| 226 | ******************************************************************************/ |
|---|
| 227 | BERR_Code BVSB_AcquireInband( |
|---|
| 228 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 229 | const BVSB_InbandParams *pParams /* [in] inband acquisition parameters */ |
|---|
| 230 | ) |
|---|
| 231 | { |
|---|
| 232 | BDBG_ASSERT(h); |
|---|
| 233 | return (h->settings.api.AcquireInband(h, pParams)); |
|---|
| 234 | } |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | /****************************************************************************** |
|---|
| 238 | BVSB_GetVsbStatus() |
|---|
| 239 | ******************************************************************************/ |
|---|
| 240 | BERR_Code BVSB_GetVsbStatus( |
|---|
| 241 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 242 | BVSB_VsbStatus *pStatus /* [out] VSB status */ |
|---|
| 243 | ) |
|---|
| 244 | { |
|---|
| 245 | BDBG_ASSERT(h); |
|---|
| 246 | return (h->settings.api.GetVsbStatus(h, pStatus)); |
|---|
| 247 | } |
|---|
| 248 | |
|---|
| 249 | |
|---|
| 250 | /****************************************************************************** |
|---|
| 251 | BVSB_GetQamStatus() |
|---|
| 252 | ******************************************************************************/ |
|---|
| 253 | BERR_Code BVSB_GetQamStatus( |
|---|
| 254 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 255 | BVSB_QamStatus *pStatus /* [out] QAM status */ |
|---|
| 256 | ) |
|---|
| 257 | { |
|---|
| 258 | BDBG_ASSERT(h); |
|---|
| 259 | return (h->settings.api.GetQamStatus(h, pStatus)); |
|---|
| 260 | } |
|---|
| 261 | |
|---|
| 262 | |
|---|
| 263 | /****************************************************************************** |
|---|
| 264 | BVSB_GetNtscStatus() |
|---|
| 265 | ******************************************************************************/ |
|---|
| 266 | BERR_Code BVSB_GetNtscStatus( |
|---|
| 267 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 268 | BVSB_NtscStatus *pStatus /* [out] NTSC status */ |
|---|
| 269 | ) |
|---|
| 270 | { |
|---|
| 271 | BDBG_ASSERT(h); |
|---|
| 272 | return (h->settings.api.GetNtscStatus(h, pStatus)); |
|---|
| 273 | } |
|---|
| 274 | |
|---|
| 275 | |
|---|
| 276 | /****************************************************************************** |
|---|
| 277 | BVSB_ResetInbandStatus() |
|---|
| 278 | ******************************************************************************/ |
|---|
| 279 | BERR_Code BVSB_ResetInbandStatus( |
|---|
| 280 | BVSB_Handle h /* [in] BVSB handle */ |
|---|
| 281 | ) |
|---|
| 282 | { |
|---|
| 283 | BDBG_ASSERT(h); |
|---|
| 284 | return (h->settings.api.ResetInbandStatus(h)); |
|---|
| 285 | } |
|---|
| 286 | |
|---|
| 287 | |
|---|
| 288 | /****************************************************************************** |
|---|
| 289 | BVSB_AcquireOob() |
|---|
| 290 | ******************************************************************************/ |
|---|
| 291 | BERR_Code BVSB_AcquireOob( |
|---|
| 292 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 293 | BVSB_OobParams *pParams /* [in] acquisition parameters */ |
|---|
| 294 | ) |
|---|
| 295 | { |
|---|
| 296 | BDBG_ASSERT(h); |
|---|
| 297 | return (h->settings.api.AcquireOob(h, pParams)); |
|---|
| 298 | } |
|---|
| 299 | |
|---|
| 300 | |
|---|
| 301 | /****************************************************************************** |
|---|
| 302 | BVSB_GetOobStatus() |
|---|
| 303 | ******************************************************************************/ |
|---|
| 304 | BERR_Code BVSB_GetOobStatus( |
|---|
| 305 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 306 | BVSB_OobStatus *pStatus /* [out] OOB status */ |
|---|
| 307 | ) |
|---|
| 308 | { |
|---|
| 309 | BDBG_ASSERT(h); |
|---|
| 310 | return (h->settings.api.GetOobStatus(h, pStatus)); |
|---|
| 311 | } |
|---|
| 312 | |
|---|
| 313 | |
|---|
| 314 | /****************************************************************************** |
|---|
| 315 | BVSB_ResetOobStatus() |
|---|
| 316 | ******************************************************************************/ |
|---|
| 317 | BERR_Code BVSB_ResetOobStatus( |
|---|
| 318 | BVSB_Handle h /* [in] BVSB handle */ |
|---|
| 319 | ) |
|---|
| 320 | { |
|---|
| 321 | BDBG_ASSERT(h); |
|---|
| 322 | return (h->settings.api.ResetOobStatus(h)); |
|---|
| 323 | } |
|---|
| 324 | |
|---|
| 325 | |
|---|
| 326 | /****************************************************************************** |
|---|
| 327 | BVSB_SetBtscConfig() |
|---|
| 328 | ******************************************************************************/ |
|---|
| 329 | BERR_Code BVSB_SetBtscConfig( |
|---|
| 330 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 331 | BVSB_BtscSettings *pParams /* [in] BTSC configuration parameters */ |
|---|
| 332 | ) |
|---|
| 333 | { |
|---|
| 334 | BDBG_ASSERT(h); |
|---|
| 335 | if (h->settings.api.SetBtscConfig) |
|---|
| 336 | return (h->settings.api.SetBtscConfig(h, pParams)); |
|---|
| 337 | else |
|---|
| 338 | return BERR_NOT_SUPPORTED; |
|---|
| 339 | } |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | /****************************************************************************** |
|---|
| 343 | BVSB_SetBtscVolume() |
|---|
| 344 | ******************************************************************************/ |
|---|
| 345 | BERR_Code BVSB_SetBtscVolume( |
|---|
| 346 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 347 | uint8_t left_volume, /* [in] left volume attenuation in dB (0 to 95 dB) */ |
|---|
| 348 | uint8_t right_volume, /* [in] left volume attenuation in dB (0 to 95 dB) */ |
|---|
| 349 | bool bMute |
|---|
| 350 | ) |
|---|
| 351 | { |
|---|
| 352 | BDBG_ASSERT(h); |
|---|
| 353 | if (h->settings.api.SetBtscVolume) |
|---|
| 354 | return (h->settings.api.SetBtscVolume(h, left_volume, right_volume, bMute)); |
|---|
| 355 | else |
|---|
| 356 | return BERR_NOT_SUPPORTED; |
|---|
| 357 | } |
|---|
| 358 | |
|---|
| 359 | |
|---|
| 360 | /****************************************************************************** |
|---|
| 361 | BVSB_GetBtscStatus() |
|---|
| 362 | ******************************************************************************/ |
|---|
| 363 | BERR_Code BVSB_GetBtscStatus( |
|---|
| 364 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 365 | BVSB_BtscStatus *pStatus /* [out] BTSC status */ |
|---|
| 366 | ) |
|---|
| 367 | { |
|---|
| 368 | BDBG_ASSERT(h); |
|---|
| 369 | if (h->settings.api.GetBtscStatus) |
|---|
| 370 | return (h->settings.api.GetBtscStatus(h, pStatus)); |
|---|
| 371 | else |
|---|
| 372 | return BERR_NOT_SUPPORTED; |
|---|
| 373 | } |
|---|
| 374 | |
|---|
| 375 | |
|---|
| 376 | /****************************************************************************** |
|---|
| 377 | BVSB_SetInbandO() |
|---|
| 378 | ******************************************************************************/ |
|---|
| 379 | BERR_Code BVSB_SetInbandOi( |
|---|
| 380 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 381 | BVSB_InbandOiSettings *pInbandOi /* [in] inband transport output interface settings */ |
|---|
| 382 | ) |
|---|
| 383 | { |
|---|
| 384 | BDBG_ASSERT(h); |
|---|
| 385 | return (h->settings.api.SetInbandOi(h, pInbandOi)); |
|---|
| 386 | } |
|---|
| 387 | |
|---|
| 388 | |
|---|
| 389 | /****************************************************************************** |
|---|
| 390 | BVSB_GetSoftDecisionBuf() |
|---|
| 391 | ******************************************************************************/ |
|---|
| 392 | BERR_Code BVSB_GetSoftDecisionBuf( |
|---|
| 393 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 394 | int16_t *pI, /* [out] 30 I-values */ |
|---|
| 395 | int16_t *pQ /* [out] 30 Q-values */ |
|---|
| 396 | ) |
|---|
| 397 | { |
|---|
| 398 | BDBG_ASSERT(h); |
|---|
| 399 | return (h->settings.api.GetSoftDecisionBuf(h, pI, pQ)); |
|---|
| 400 | } |
|---|
| 401 | |
|---|
| 402 | |
|---|
| 403 | /****************************************************************************** |
|---|
| 404 | BVSB_GetOobSoftDecisionBuf() |
|---|
| 405 | ******************************************************************************/ |
|---|
| 406 | BERR_Code BVSB_GetOobSoftDecisionBuf( |
|---|
| 407 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 408 | int16_t *pI, /* [out] 30 I-values */ |
|---|
| 409 | int16_t *pQ /* [out] 30 Q-values */ |
|---|
| 410 | ) |
|---|
| 411 | { |
|---|
| 412 | BDBG_ASSERT(h); |
|---|
| 413 | return (h->settings.api.GetOobSoftDecisionBuf(h, pI, pQ)); |
|---|
| 414 | } |
|---|
| 415 | |
|---|
| 416 | |
|---|
| 417 | /****************************************************************************** |
|---|
| 418 | BVSB_SetTmConfig() |
|---|
| 419 | ******************************************************************************/ |
|---|
| 420 | BERR_Code BVSB_SetTmConfig( |
|---|
| 421 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 422 | void *pCfg /* [in] pad configuration parameters */ |
|---|
| 423 | ) |
|---|
| 424 | { |
|---|
| 425 | BDBG_ASSERT(h); |
|---|
| 426 | if (h->settings.api.SetTmConfig) |
|---|
| 427 | return (h->settings.api.SetTmConfig(h, pCfg)); |
|---|
| 428 | else |
|---|
| 429 | return BERR_NOT_SUPPORTED; |
|---|
| 430 | } |
|---|
| 431 | |
|---|
| 432 | |
|---|
| 433 | /****************************************************************************** |
|---|
| 434 | BVSB_GetTmConfig() |
|---|
| 435 | ******************************************************************************/ |
|---|
| 436 | BERR_Code BVSB_GetTmConfig( |
|---|
| 437 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 438 | void *pCfg /* [out] pad configuration parameters */ |
|---|
| 439 | ) |
|---|
| 440 | { |
|---|
| 441 | BDBG_ASSERT(h); |
|---|
| 442 | if (h->settings.api.GetTmConfig) |
|---|
| 443 | return (h->settings.api.GetTmConfig(h, pCfg)); |
|---|
| 444 | else |
|---|
| 445 | return BERR_NOT_SUPPORTED; |
|---|
| 446 | } |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | /****************************************************************************** |
|---|
| 450 | BVSB_WriteConfig() |
|---|
| 451 | ******************************************************************************/ |
|---|
| 452 | BERR_Code BVSB_WriteConfig( |
|---|
| 453 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 454 | uint16_t offset, /* [in] 16-bit offset within the host configuration space */ |
|---|
| 455 | uint8_t *buf, /* [in] data to write */ |
|---|
| 456 | uint8_t len /* [in] number of bytes to write */ |
|---|
| 457 | ) |
|---|
| 458 | { |
|---|
| 459 | BDBG_ASSERT(h); |
|---|
| 460 | return (h->settings.api.WriteConfig(h, offset, buf, len)); |
|---|
| 461 | } |
|---|
| 462 | |
|---|
| 463 | |
|---|
| 464 | /****************************************************************************** |
|---|
| 465 | BVSB_ReadConfig() |
|---|
| 466 | ******************************************************************************/ |
|---|
| 467 | BERR_Code BVSB_ReadConfig( |
|---|
| 468 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 469 | uint16_t offset, /* [in] 16-bit offset within the host configuration space */ |
|---|
| 470 | uint8_t *buf, /* [in] buffer to hold the read data */ |
|---|
| 471 | uint8_t len /* [in] number of bytes to read */ |
|---|
| 472 | ) |
|---|
| 473 | { |
|---|
| 474 | BDBG_ASSERT(h); |
|---|
| 475 | return (h->settings.api.ReadConfig(h, offset, buf, len)); |
|---|
| 476 | } |
|---|
| 477 | |
|---|
| 478 | /****************************************************************************** |
|---|
| 479 | BVSB_GetunLockStateEventHandle() |
|---|
| 480 | ******************************************************************************/ |
|---|
| 481 | BERR_Code BVSB_GetUnlockEventHandle( |
|---|
| 482 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 483 | BKNI_EventHandle *hEvent /* [out] lock event handle */ |
|---|
| 484 | ) |
|---|
| 485 | { |
|---|
| 486 | BDBG_ASSERT(h); |
|---|
| 487 | return (h->settings.api.GetUnlockstatusEventHandle(h, hEvent)); |
|---|
| 488 | } |
|---|
| 489 | |
|---|
| 490 | /****************************************************************************** |
|---|
| 491 | BVSB_GetLockStateEventHandle() |
|---|
| 492 | ******************************************************************************/ |
|---|
| 493 | BERR_Code BVSB_GetLockEventHandle( |
|---|
| 494 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 495 | BKNI_EventHandle *hEvent /* [out] lock event handle */ |
|---|
| 496 | ) |
|---|
| 497 | { |
|---|
| 498 | BDBG_ASSERT(h); |
|---|
| 499 | return (h->settings.api.GetLockstatusEventHandle(h, hEvent)); |
|---|
| 500 | } |
|---|
| 501 | |
|---|
| 502 | /****************************************************************************** |
|---|
| 503 | BVSB_GetLockStateChangeEventHandle() |
|---|
| 504 | ******************************************************************************/ |
|---|
| 505 | BERR_Code BVSB_GetLockStateChangeEventHandle( |
|---|
| 506 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 507 | BKNI_EventHandle *hEvent /* [out] lock event handle */ |
|---|
| 508 | ) |
|---|
| 509 | { |
|---|
| 510 | BDBG_ASSERT(h); |
|---|
| 511 | return (h->settings.api.GetLockStateChangeEventHandle(h, hEvent)); |
|---|
| 512 | } |
|---|
| 513 | /****************************************************************************** |
|---|
| 514 | BVSB_GetOobLockStateChangeEventHandle() |
|---|
| 515 | ******************************************************************************/ |
|---|
| 516 | BERR_Code BVSB_GetOobLockStateChangeEventHandle( |
|---|
| 517 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 518 | BKNI_EventHandle *hEvent /* [out] lock event handle */ |
|---|
| 519 | ) |
|---|
| 520 | { |
|---|
| 521 | BDBG_ASSERT(h); |
|---|
| 522 | return (h->settings.api.GetOobLockStateChangeEventHandle(h, hEvent)); |
|---|
| 523 | } |
|---|
| 524 | |
|---|
| 525 | /****************************************************************************** |
|---|
| 526 | BVSB_GetAntennaEventHandle() |
|---|
| 527 | ******************************************************************************/ |
|---|
| 528 | BERR_Code BVSB_GetAntennaEventHandle( |
|---|
| 529 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 530 | BKNI_EventHandle *hEvent /* [out] antenna event handle */ |
|---|
| 531 | ) |
|---|
| 532 | { |
|---|
| 533 | BDBG_ASSERT(h); |
|---|
| 534 | if (h->settings.api.GetAntennaEventHandle) |
|---|
| 535 | return (h->settings.api.GetAntennaEventHandle(h, hEvent)); |
|---|
| 536 | else |
|---|
| 537 | return BERR_NOT_SUPPORTED; |
|---|
| 538 | } |
|---|
| 539 | |
|---|
| 540 | |
|---|
| 541 | /****************************************************************************** |
|---|
| 542 | BVSB_GetInterruptEventHandle() |
|---|
| 543 | ******************************************************************************/ |
|---|
| 544 | BERR_Code BVSB_GetInterruptEventHandle( |
|---|
| 545 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 546 | BKNI_EventHandle *hEvent /* [out] interrupt event handle */ |
|---|
| 547 | ) |
|---|
| 548 | { |
|---|
| 549 | BDBG_ASSERT(h); |
|---|
| 550 | if (h->settings.api.GetInterruptEventHandle) |
|---|
| 551 | return (h->settings.api.GetInterruptEventHandle(h, hEvent)); |
|---|
| 552 | else |
|---|
| 553 | return BERR_NOT_SUPPORTED; |
|---|
| 554 | } |
|---|
| 555 | |
|---|
| 556 | |
|---|
| 557 | /****************************************************************************** |
|---|
| 558 | BVSB_HandleInterrupt_isr() |
|---|
| 559 | ******************************************************************************/ |
|---|
| 560 | BERR_Code BVSB_HandleInterrupt_isr( |
|---|
| 561 | BVSB_Handle h /* [in] BVSB handle */ |
|---|
| 562 | ) |
|---|
| 563 | { |
|---|
| 564 | BDBG_ASSERT(h); |
|---|
| 565 | return (h->settings.api.HandleInterrupt_isr(h)); |
|---|
| 566 | } |
|---|
| 567 | |
|---|
| 568 | |
|---|
| 569 | /****************************************************************************** |
|---|
| 570 | BVSB_ProcessInterruptEvent() |
|---|
| 571 | ******************************************************************************/ |
|---|
| 572 | BERR_Code BVSB_ProcessInterruptEvent( |
|---|
| 573 | BVSB_Handle h /* [in] BVSB handle */ |
|---|
| 574 | ) |
|---|
| 575 | { |
|---|
| 576 | BDBG_ASSERT(h); |
|---|
| 577 | return (h->settings.api.ProcessInterruptEvent(h)); |
|---|
| 578 | } |
|---|
| 579 | |
|---|
| 580 | |
|---|
| 581 | /****************************************************************************** |
|---|
| 582 | BVSB_GetSettings() |
|---|
| 583 | ******************************************************************************/ |
|---|
| 584 | BERR_Code BVSB_GetSettings( |
|---|
| 585 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 586 | BVSB_Settings *pSettings /* [out] current BVSB settings */ |
|---|
| 587 | ) |
|---|
| 588 | { |
|---|
| 589 | BDBG_ASSERT(pSettings); |
|---|
| 590 | BKNI_Memcpy((void*)pSettings, (void*)&(h->settings), sizeof(BVSB_Settings)); |
|---|
| 591 | return BERR_SUCCESS; |
|---|
| 592 | } |
|---|
| 593 | |
|---|
| 594 | |
|---|
| 595 | /****************************************************************************** |
|---|
| 596 | BVSB_SetSettings() |
|---|
| 597 | ******************************************************************************/ |
|---|
| 598 | BERR_Code BVSB_SetSettings( |
|---|
| 599 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 600 | BVSB_Settings *pSettings /* [in] new BVSB settings */ |
|---|
| 601 | ) |
|---|
| 602 | { |
|---|
| 603 | BDBG_ASSERT(pSettings); |
|---|
| 604 | BKNI_Memcpy((void*)&(h->settings), (void*)pSettings, sizeof(BVSB_Settings)); |
|---|
| 605 | return BERR_SUCCESS; |
|---|
| 606 | } |
|---|
| 607 | |
|---|
| 608 | /****************************************************************************** |
|---|
| 609 | BVSB_GetChipRevision |
|---|
| 610 | ******************************************************************************/ |
|---|
| 611 | BERR_Code BVSB_GetChipRevision( |
|---|
| 612 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 613 | uint8_t *revision /* [out] chip revision*/ |
|---|
| 614 | ) |
|---|
| 615 | { |
|---|
| 616 | BDBG_ASSERT(h); |
|---|
| 617 | return (h->settings.api.GetChipRevision(h, revision)); |
|---|
| 618 | } |
|---|
| 619 | |
|---|
| 620 | /****************************************************************************** |
|---|
| 621 | BVSB_DetectChannelSignal() |
|---|
| 622 | ******************************************************************************/ |
|---|
| 623 | BERR_Code BVSB_DetectChannelSignal( |
|---|
| 624 | BVSB_Handle h, /* [in] VSB device handle */ |
|---|
| 625 | BVSB_DetectType eDetectType, /* [in] signal detect type */ |
|---|
| 626 | BVSB_SignalMode* peSignalMode /* [out] signal mode */ |
|---|
| 627 | ) |
|---|
| 628 | { |
|---|
| 629 | BDBG_ASSERT(h); |
|---|
| 630 | return (h->settings.api.DetectChannelSignal(h, eDetectType, peSignalMode)); |
|---|
| 631 | } |
|---|
| 632 | |
|---|
| 633 | |
|---|
| 634 | /****************************************************************************** |
|---|
| 635 | BVSB_SetInbandIfFreq() |
|---|
| 636 | ******************************************************************************/ |
|---|
| 637 | BERR_Code BVSB_SetInbandIfFreq( |
|---|
| 638 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 639 | uint32_t uIfFreq_hz /* [in] BTSC configuration parameters */ |
|---|
| 640 | ) |
|---|
| 641 | { |
|---|
| 642 | BDBG_ASSERT(h); |
|---|
| 643 | return (h->settings.api.SetInbandIfFreq(h, uIfFreq_hz)); |
|---|
| 644 | } |
|---|
| 645 | |
|---|
| 646 | /****************************************************************************** |
|---|
| 647 | BVSB_SetIfdPullInRange() |
|---|
| 648 | ******************************************************************************/ |
|---|
| 649 | BERR_Code BVSB_SetIfdPullInRange( |
|---|
| 650 | BVSB_Handle h, |
|---|
| 651 | BVSB_Ifd_PullInRange if_pulling_range |
|---|
| 652 | ) |
|---|
| 653 | { |
|---|
| 654 | BDBG_ASSERT(h); |
|---|
| 655 | return (h->settings.api.SetIfdPullInRange(h, if_pulling_range)); |
|---|
| 656 | } |
|---|
| 657 | BERR_Code BVSB_PowerDown( |
|---|
| 658 | BVSB_Handle h |
|---|
| 659 | ) |
|---|
| 660 | { |
|---|
| 661 | BDBG_ASSERT(h); |
|---|
| 662 | return (h->settings.api.PowerDown(h)); |
|---|
| 663 | } |
|---|
| 664 | |
|---|
| 665 | /****************************************************************************** |
|---|
| 666 | BVSB_SetPgaGain() |
|---|
| 667 | ******************************************************************************/ |
|---|
| 668 | BERR_Code BVSB_SetPgaGain( |
|---|
| 669 | BVSB_Handle h, |
|---|
| 670 | BVSB_InbandMode mode, |
|---|
| 671 | BVSB_PgaGain PgaGain |
|---|
| 672 | ) |
|---|
| 673 | { |
|---|
| 674 | BDBG_ASSERT(h); |
|---|
| 675 | return (h->settings.api.SetPgaGain(h, mode, PgaGain)); |
|---|
| 676 | } |
|---|
| 677 | |
|---|
| 678 | /****************************************************************************** |
|---|
| 679 | BVSB_SetOobInterfaceControl() |
|---|
| 680 | ******************************************************************************/ |
|---|
| 681 | BERR_Code BVSB_SetOobInterfaceControl( |
|---|
| 682 | BVSB_Handle h, /* [in] BVSB handle */ |
|---|
| 683 | BVSB_OobClockSuppression clockSuppression, |
|---|
| 684 | BVSB_OobClock clock |
|---|
| 685 | ) |
|---|
| 686 | { |
|---|
| 687 | BDBG_ASSERT(h); |
|---|
| 688 | return (h->settings.api.SetOobInterfaceControl(h, clockSuppression, clock)); |
|---|
| 689 | } |
|---|
| 690 | |
|---|