| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-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: nexus_amplifier.h $ |
|---|
| 39 | * $brcm_Revision: 7 $ |
|---|
| 40 | * $brcm_Date: 5/26/11 1:22p $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: Frontend Amplifier |
|---|
| 44 | * Generic APIs for Low-Noise Amplifiers (LNA). |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /nexus/modules/frontend/common/include/nexus_amplifier.h $ |
|---|
| 49 | * |
|---|
| 50 | * 7 5/26/11 1:22p erickson |
|---|
| 51 | * SW7125-928: add members to NEXUS_AmplifierStatus |
|---|
| 52 | * |
|---|
| 53 | * 6 3/14/11 4:10p erickson |
|---|
| 54 | * SW7125-830: merge |
|---|
| 55 | * |
|---|
| 56 | * SW7125-828/3 3/11/11 6:06p mward |
|---|
| 57 | * SW7125-830: Adding agcGain to NEXUS_AmplifierStatus. |
|---|
| 58 | * |
|---|
| 59 | * SW7125-828/2 2/18/11 1:48p mward |
|---|
| 60 | * SW7125-830: Changes and clarifications recommended for API approval. |
|---|
| 61 | * |
|---|
| 62 | * SW7125-828/1 2/14/11 12:05p mward |
|---|
| 63 | * SW7125-828: Adding NEXUS_Amplifier_GetStatus(), corresponding to |
|---|
| 64 | * BLNA_GetStatus(). |
|---|
| 65 | * |
|---|
| 66 | * 5 11/15/10 11:15a erickson |
|---|
| 67 | * SW7125-731: add NEXUS_AmplifierSettings.enabled |
|---|
| 68 | * |
|---|
| 69 | * 4 2/7/08 5:36p jgarrett |
|---|
| 70 | * PR 39407: Converting to common close functions |
|---|
| 71 | * |
|---|
| 72 | * 3 1/23/08 8:37p vobadm |
|---|
| 73 | * PR35457: update docs |
|---|
| 74 | * |
|---|
| 75 | * 2 1/23/08 5:16p erickson |
|---|
| 76 | * PR35457: update docs |
|---|
| 77 | * |
|---|
| 78 | * 1 1/18/08 2:19p jgarrett |
|---|
| 79 | * PR 38808: Merging to main branch |
|---|
| 80 | * |
|---|
| 81 | * Nexus_Devel/2 10/5/07 5:51p jgarrett |
|---|
| 82 | * PR 35551: Successful build |
|---|
| 83 | * |
|---|
| 84 | * Nexus_Devel/1 10/4/07 2:41p jgarrett |
|---|
| 85 | * PR 35551: Adding initial version |
|---|
| 86 | * |
|---|
| 87 | ***************************************************************************/ |
|---|
| 88 | #ifndef NEXUS_AMPLIFIER_H__ |
|---|
| 89 | #define NEXUS_AMPLIFIER_H__ |
|---|
| 90 | |
|---|
| 91 | #ifdef __cplusplus |
|---|
| 92 | extern "C" { |
|---|
| 93 | #endif |
|---|
| 94 | |
|---|
| 95 | /*************************************************************************** |
|---|
| 96 | Summary: |
|---|
| 97 | Handle for a generic frontend amplifier object |
|---|
| 98 | ***************************************************************************/ |
|---|
| 99 | typedef struct NEXUS_Amplifier *NEXUS_AmplifierHandle; |
|---|
| 100 | |
|---|
| 101 | typedef enum NEXUS_AmplifierGainMode |
|---|
| 102 | { |
|---|
| 103 | NEXUS_AmplifierGainMode_eAutomatic, |
|---|
| 104 | NEXUS_AmplifierGainMode_eManual, |
|---|
| 105 | NEXUS_AmplifierGainMode_eMax |
|---|
| 106 | } NEXUS_AmplifierGainMode; |
|---|
| 107 | |
|---|
| 108 | /*************************************************************************** |
|---|
| 109 | Summary: |
|---|
| 110 | Settings for a frontend amplifier |
|---|
| 111 | ***************************************************************************/ |
|---|
| 112 | typedef struct NEXUS_AmplifierSettings |
|---|
| 113 | { |
|---|
| 114 | bool enabled; /* if not enabled, amplifier can be powered down. */ |
|---|
| 115 | NEXUS_AmplifierGainMode gainMode; |
|---|
| 116 | union |
|---|
| 117 | { |
|---|
| 118 | struct |
|---|
| 119 | { |
|---|
| 120 | unsigned outputLevel; /* AGC Output Level, in 2/10 dB */ |
|---|
| 121 | int deltaValue; /* Delta Value, specifies window, in 2/10 dB */ |
|---|
| 122 | } automatic; |
|---|
| 123 | struct |
|---|
| 124 | { |
|---|
| 125 | unsigned gain; /* Gain, in 2/10 dB */ |
|---|
| 126 | } manual; |
|---|
| 127 | } gainSettings; |
|---|
| 128 | } NEXUS_AmplifierSettings; |
|---|
| 129 | |
|---|
| 130 | /*************************************************************************** |
|---|
| 131 | Summary: |
|---|
| 132 | Get the settings of a frontend amplifier |
|---|
| 133 | ***************************************************************************/ |
|---|
| 134 | void NEXUS_Amplifier_GetSettings( |
|---|
| 135 | NEXUS_AmplifierHandle handle, |
|---|
| 136 | NEXUS_AmplifierSettings *pSettings /* [out] */ |
|---|
| 137 | ); |
|---|
| 138 | |
|---|
| 139 | /*************************************************************************** |
|---|
| 140 | Summary: |
|---|
| 141 | Set the settings of a frontend amplifier |
|---|
| 142 | ***************************************************************************/ |
|---|
| 143 | NEXUS_Error NEXUS_Amplifier_SetSettings( |
|---|
| 144 | NEXUS_AmplifierHandle handle, |
|---|
| 145 | const NEXUS_AmplifierSettings *pSettings |
|---|
| 146 | ); |
|---|
| 147 | |
|---|
| 148 | /*************************************************************************** |
|---|
| 149 | Summary: |
|---|
| 150 | Enable the external output for an amplifier port |
|---|
| 151 | ***************************************************************************/ |
|---|
| 152 | NEXUS_Error NEXUS_Amplifier_EnableExternalDriver( |
|---|
| 153 | NEXUS_AmplifierHandle handle, |
|---|
| 154 | unsigned portNum, /* The port number you want to enable/disable */ |
|---|
| 155 | bool enabled /* If true, output will be enabled. If false, it will be disabled */ |
|---|
| 156 | ); |
|---|
| 157 | |
|---|
| 158 | /*************************************************************************** |
|---|
| 159 | Summary: |
|---|
| 160 | InBand amplifier mode |
|---|
| 161 | ***************************************************************************/ |
|---|
| 162 | typedef enum NEXUS_AmplifierInBandMode |
|---|
| 163 | { |
|---|
| 164 | NEXUS_AmplifierInBandMode_eOpenCable, |
|---|
| 165 | NEXUS_AmplifierInBandMode_eAnalog, |
|---|
| 166 | NEXUS_AmplifierInBandMode_eDigital, |
|---|
| 167 | NEXUS_AmplifierInBandMode_ePowerDown, |
|---|
| 168 | NEXUS_AmplifierInBandMode_eMax |
|---|
| 169 | } NEXUS_AmplifierInBandMode; |
|---|
| 170 | |
|---|
| 171 | /*************************************************************************** |
|---|
| 172 | Summary: |
|---|
| 173 | Set the amplifier mode for an InBand port |
|---|
| 174 | ***************************************************************************/ |
|---|
| 175 | NEXUS_Error NEXUS_Amplifier_SetInBandMode( |
|---|
| 176 | NEXUS_AmplifierHandle handle, |
|---|
| 177 | unsigned inBandPortNum, |
|---|
| 178 | NEXUS_AmplifierInBandMode inBandMode |
|---|
| 179 | ); |
|---|
| 180 | |
|---|
| 181 | /*************************************************************************** |
|---|
| 182 | Summary: |
|---|
| 183 | OutOfBand amplifier mode |
|---|
| 184 | ***************************************************************************/ |
|---|
| 185 | typedef enum NEXUS_AmplifierOutOfBandMode |
|---|
| 186 | { |
|---|
| 187 | NEXUS_AmplifierOutOfBandMode_eMaxGain, |
|---|
| 188 | NEXUS_AmplifierOutOfBandMode_eBypass, |
|---|
| 189 | NEXUS_AmplifierOutOfBandMode_eNormal, |
|---|
| 190 | NEXUS_AmplifierOutOfBandMode_ePowerDown, |
|---|
| 191 | NEXUS_AmplifierOutOfBandMode_eMax |
|---|
| 192 | } NEXUS_AmplifierOutOfBandMode; |
|---|
| 193 | |
|---|
| 194 | /*************************************************************************** |
|---|
| 195 | Summary: |
|---|
| 196 | Set the amplifier mode for an OutOfBand port |
|---|
| 197 | ***************************************************************************/ |
|---|
| 198 | NEXUS_Error NEXUS_Amplifier_SetOutOfBandMode( |
|---|
| 199 | NEXUS_AmplifierHandle handle, |
|---|
| 200 | unsigned outOfBandPortNum, |
|---|
| 201 | NEXUS_AmplifierOutOfBandMode outOfBandMode |
|---|
| 202 | ); |
|---|
| 203 | |
|---|
| 204 | /*************************************************************************** |
|---|
| 205 | Summary: |
|---|
| 206 | Close an amplifier handle |
|---|
| 207 | ***************************************************************************/ |
|---|
| 208 | void NEXUS_Amplifier_Close( |
|---|
| 209 | NEXUS_AmplifierHandle handle |
|---|
| 210 | ); |
|---|
| 211 | |
|---|
| 212 | #define NEXUS_AMPLIFIER_NUM_INBAND_PORTS (5) |
|---|
| 213 | #define NEXUS_AMPLIFIER_NUM_OUTOFBAND_PORTS (5) |
|---|
| 214 | #define NEXUS_AMPLIFIER_NUM_EXTERNAL_DRIVER (5) |
|---|
| 215 | |
|---|
| 216 | /*************************************************************************** |
|---|
| 217 | Summary: |
|---|
| 218 | Status of a frontend amplifier |
|---|
| 219 | ***************************************************************************/ |
|---|
| 220 | typedef struct NEXUS_AmplifierStatus |
|---|
| 221 | { |
|---|
| 222 | NEXUS_AmplifierGainMode gainMode; |
|---|
| 223 | NEXUS_AmplifierInBandMode inBandPortMode[NEXUS_AMPLIFIER_NUM_INBAND_PORTS]; |
|---|
| 224 | NEXUS_AmplifierOutOfBandMode outOfBandPortMode[NEXUS_AMPLIFIER_NUM_OUTOFBAND_PORTS]; |
|---|
| 225 | bool isExternalDriverEnabled[NEXUS_AMPLIFIER_NUM_EXTERNAL_DRIVER]; |
|---|
| 226 | unsigned agcOutputLevel; /* AGC Output Level, in 1/10 dB */ |
|---|
| 227 | int agcDeltaVal; /* AGC Delta Value, in 1/10 dB */ |
|---|
| 228 | unsigned manualGainVal; /* If Manual Gain, manual gain value, in 1/10 dB */ |
|---|
| 229 | unsigned agcGain; /* Gain read from the LNA, for use by the frontend, |
|---|
| 230 | delivered, for example, in the agcValue of the |
|---|
| 231 | NEXUS_31xxConfigSettings */ |
|---|
| 232 | bool gainBoostEnabled; /* True if Stage 1 gain boost is enabled */ |
|---|
| 233 | bool superBoostEnabled; /* True if SuperBoost is enabled */ |
|---|
| 234 | bool tiltEnabled; /* True if Stage 1 tilt is enabled */ |
|---|
| 235 | } NEXUS_AmplifierStatus; |
|---|
| 236 | |
|---|
| 237 | /*************************************************************************** |
|---|
| 238 | Summary: |
|---|
| 239 | Get the status of a frontend amplifier |
|---|
| 240 | ***************************************************************************/ |
|---|
| 241 | NEXUS_Error NEXUS_Amplifier_GetStatus( |
|---|
| 242 | NEXUS_AmplifierHandle handle, |
|---|
| 243 | NEXUS_AmplifierStatus *pStatus /* [out] */ |
|---|
| 244 | ); |
|---|
| 245 | |
|---|
| 246 | #ifdef __cplusplus |
|---|
| 247 | } |
|---|
| 248 | #endif |
|---|
| 249 | |
|---|
| 250 | #endif /* #ifndef NEXUS_AMPLIFIER_H__ */ |
|---|
| 251 | |
|---|