| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2011, 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: btnr_3x7x.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/3 $ |
|---|
| 12 | * $brcm_Date: 4/19/11 12:33p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: $ |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/tnr/7552/btnr_3x7x.h $ |
|---|
| 19 | * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | #ifndef BTNR_3x7x_H__ |
|---|
| 22 | #define BTNR_3x7x_H__ |
|---|
| 23 | |
|---|
| 24 | #include "bchp.h" |
|---|
| 25 | #include "btnr.h" |
|---|
| 26 | |
|---|
| 27 | #ifdef __cplusplus |
|---|
| 28 | extern "C" { |
|---|
| 29 | #endif |
|---|
| 30 | |
|---|
| 31 | typedef struct |
|---|
| 32 | { |
|---|
| 33 | unsigned short i2cAddr; /* 7bit I2C address of Bcm7550 */ |
|---|
| 34 | BTMR_Handle hTmr; |
|---|
| 35 | BMEM_Heap_Handle hHeap; |
|---|
| 36 | } BTNR_3x7x_Settings; |
|---|
| 37 | |
|---|
| 38 | /*************************************************************************** |
|---|
| 39 | Summary: |
|---|
| 40 | This function returns the default settings for Bcm3x7x Tuner module. |
|---|
| 41 | |
|---|
| 42 | Description: |
|---|
| 43 | This function is responsible for returns the default setting for |
|---|
| 44 | BTNR module. The returning default setting should be when |
|---|
| 45 | opening the device. |
|---|
| 46 | |
|---|
| 47 | Returns: |
|---|
| 48 | TODO: |
|---|
| 49 | |
|---|
| 50 | See Also: |
|---|
| 51 | BTNR_3x7x_Open() |
|---|
| 52 | |
|---|
| 53 | ****************************************************************************/ |
|---|
| 54 | BERR_Code BTNR_3x7x_GetDefaultSettings( |
|---|
| 55 | BTNR_3x7x_Settings *pDefSettings /* [out] Returns default setting */ |
|---|
| 56 | ); |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | /*************************************************************************** |
|---|
| 60 | Summary: |
|---|
| 61 | This function opens Bcm3x7x Tuner module. |
|---|
| 62 | |
|---|
| 63 | Description: |
|---|
| 64 | This function is responsible for opening Bcm3x7x BTNR module. When BTNR is |
|---|
| 65 | opened, it will create a module handle and configure the module based |
|---|
| 66 | on the default settings. Once the device is opened, it must be closed |
|---|
| 67 | before it can be opened again. |
|---|
| 68 | |
|---|
| 69 | Returns: |
|---|
| 70 | TODO: |
|---|
| 71 | |
|---|
| 72 | See Also: |
|---|
| 73 | BTNR_Close(), BTNR_3x7x_GetDefaultSettings() |
|---|
| 74 | |
|---|
| 75 | ****************************************************************************/ |
|---|
| 76 | |
|---|
| 77 | BERR_Code BTNR_3x7x_Open(BTNR_Handle *phDev, |
|---|
| 78 | BTNR_3x7x_Settings *pSettings, |
|---|
| 79 | BREG_Handle hRegister); |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | /*************************************************************************** |
|---|
| 83 | Summary: |
|---|
| 84 | Function called once the event is sent to upper layer |
|---|
| 85 | |
|---|
| 86 | BTNR_3x7x_ProcessInterruptEvent |
|---|
| 87 | ****************************************************************************/ |
|---|
| 88 | BERR_Code BTNR_3x7x_ProcessInterruptEvent(BTNR_Handle hDev); |
|---|
| 89 | |
|---|
| 90 | /*************************************************************************** |
|---|
| 91 | Summary: |
|---|
| 92 | Function called by upper to get the inetrrupt handle |
|---|
| 93 | |
|---|
| 94 | BTNR_3x7x_GetInterruptEventHandle |
|---|
| 95 | ****************************************************************************/ |
|---|
| 96 | BERR_Code BTNR_3x7x_GetInterruptEventHandle(BTNR_Handle h, BKNI_EventHandle* hEvent); |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | /*************************************************************************** |
|---|
| 100 | Summary: |
|---|
| 101 | BTNR_3x7x_P_TimerFunc |
|---|
| 102 | ****************************************************************************/ |
|---|
| 103 | BERR_Code BTNR_3x7x_P_TimerFunc(void *myParam1, int myParam2); |
|---|
| 104 | |
|---|
| 105 | /*************************************************************************** |
|---|
| 106 | Summary: callback for demod to tuner through above layer |
|---|
| 107 | BTNR_3x7x_Set_RF_Offset |
|---|
| 108 | ****************************************************************************/ |
|---|
| 109 | BERR_Code BTNR_3x7x_Set_RF_Offset(BTNR_Handle hTnrDev, int32_t RF_Offset, uint32_t Symbol_Rate); |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | typedef struct |
|---|
| 113 | { |
|---|
| 114 | uint32_t RF_Freq; /*RF frequency of the tuner on eRequestMode: set to 0 if unknown*/ |
|---|
| 115 | int32_t Total_Mix_After_ADC; /*Sum of mixer frequencies after ADC on eRequestMode*/ |
|---|
| 116 | int16_t PreADC_Gain_x256db ; /*Gain in db*256 before ADC on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 117 | int16_t PostADC_Gain_x256db; /*Gain in db*256 after ADC on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 118 | int16_t External_Gain_x256db; /*Gain in db*256 external to chip (like external LNA) on eRequestMode: set to 0x8000 if unknown*/ |
|---|
| 119 | uint32_t Symbol_Rate; |
|---|
| 120 | int32_t RF_Offset; |
|---|
| 121 | } BTNR_3x7x_RfStatus_t; |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | /****************************************************************************** |
|---|
| 125 | BTNR_3x7x_Get_RF_Status() |
|---|
| 126 | callback from Demod to Tuner through above layer |
|---|
| 127 | ******************************************************************************/ |
|---|
| 128 | BERR_Code BTNR_3x7x_Get_RF_Status(BTNR_Handle hTnrDev, BTNR_3x7x_RfStatus_t *RfCallbackStatus); |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | /****************************************************************************** |
|---|
| 133 | BTNR_3x7x_Set_RF_LoopThrough() |
|---|
| 134 | ******************************************************************************/ |
|---|
| 135 | BERR_Code BTNR_3x7x_Set_RF_LoopThrough(BTNR_Handle hTnrDev, bool EnableRfLoopThrough); |
|---|
| 136 | |
|---|
| 137 | /****************************************************************************** |
|---|
| 138 | BTNR_3x7x_Get_RF_LoopThrough() |
|---|
| 139 | ******************************************************************************/ |
|---|
| 140 | BERR_Code BTNR_3x7x_Get_RF_LoopThrough(BTNR_Handle hTnrDev, bool EnableRfLoopThrough); |
|---|
| 141 | |
|---|
| 142 | #ifdef __cplusplus |
|---|
| 143 | } |
|---|
| 144 | #endif |
|---|
| 145 | |
|---|
| 146 | #endif |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | |
|---|