| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2010 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: bape_rf_encoder.h $ |
|---|
| 39 | * $brcm_Revision: Hydra_Software_Devel/2 $ |
|---|
| 40 | * $brcm_Date: 8/26/11 11:41a $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: RfEncoder |
|---|
| 44 | * Specific APIs related to RF Audio Encoding |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /magnum/portinginterface/ape/7422/bape_rf_encoder.h $ |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/2 8/26/11 11:41a jgarrett |
|---|
| 51 | * SW7425-742: Incorporating API review feedback |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/1 8/24/11 11:53a jgarrett |
|---|
| 54 | * SW7425-724: Adding RF Audio Encoder |
|---|
| 55 | * |
|---|
| 56 | ***************************************************************************/ |
|---|
| 57 | |
|---|
| 58 | #ifndef BAPE_RF_ENCODER_H__ |
|---|
| 59 | #define BAPE_RF_ENCODER_H__ |
|---|
| 60 | |
|---|
| 61 | #include "bape.h" |
|---|
| 62 | |
|---|
| 63 | /*************************************************************************** |
|---|
| 64 | Summary: |
|---|
| 65 | Audio Encoder Settings |
|---|
| 66 | ***************************************************************************/ |
|---|
| 67 | typedef struct BAPE_RfEncoder *BAPE_RfEncoderHandle; |
|---|
| 68 | |
|---|
| 69 | /*************************************************************************** |
|---|
| 70 | Summary: |
|---|
| 71 | Audio Encoder Settings |
|---|
| 72 | ***************************************************************************/ |
|---|
| 73 | typedef struct BAPE_RfEncoderSettings |
|---|
| 74 | { |
|---|
| 75 | BAPE_RfAudioEncoding encoding; /* Encoding to generate. Cannot be changed while running. */ |
|---|
| 76 | } BAPE_RfEncoderSettings; |
|---|
| 77 | |
|---|
| 78 | /*************************************************************************** |
|---|
| 79 | Summary: |
|---|
| 80 | Get default settings for an RF Audio Encoder |
|---|
| 81 | ***************************************************************************/ |
|---|
| 82 | void BAPE_RfEncoder_GetDefaultSettings( |
|---|
| 83 | BAPE_RfEncoderSettings *pSettings /* [out] default settings */ |
|---|
| 84 | ); |
|---|
| 85 | |
|---|
| 86 | /*************************************************************************** |
|---|
| 87 | Summary: |
|---|
| 88 | Open an RF Audio Encoder |
|---|
| 89 | ***************************************************************************/ |
|---|
| 90 | BERR_Code BAPE_RfEncoder_Create( |
|---|
| 91 | BAPE_Handle deviceHandle, |
|---|
| 92 | const BAPE_RfEncoderSettings *pSettings, |
|---|
| 93 | BAPE_RfEncoderHandle *pHandle /* [out] */ |
|---|
| 94 | ); |
|---|
| 95 | |
|---|
| 96 | /*************************************************************************** |
|---|
| 97 | Summary: |
|---|
| 98 | Close an RF Audio Encoder |
|---|
| 99 | |
|---|
| 100 | Description: |
|---|
| 101 | Input to the stage must be removed prior to closing. |
|---|
| 102 | ***************************************************************************/ |
|---|
| 103 | void BAPE_RfEncoder_Destroy( |
|---|
| 104 | BAPE_RfEncoderHandle handle |
|---|
| 105 | ); |
|---|
| 106 | |
|---|
| 107 | /*************************************************************************** |
|---|
| 108 | Summary: |
|---|
| 109 | Get Settings for an RF Audio Encoder |
|---|
| 110 | ***************************************************************************/ |
|---|
| 111 | void BAPE_RfEncoder_GetSettings( |
|---|
| 112 | BAPE_RfEncoderHandle handle, |
|---|
| 113 | BAPE_RfEncoderSettings *pSettings /* [out] Settings */ |
|---|
| 114 | ); |
|---|
| 115 | |
|---|
| 116 | /*************************************************************************** |
|---|
| 117 | Summary: |
|---|
| 118 | Set Settings for an RF Audio Encoder |
|---|
| 119 | ***************************************************************************/ |
|---|
| 120 | BERR_Code BAPE_RfEncoder_SetSettings( |
|---|
| 121 | BAPE_RfEncoderHandle handle, |
|---|
| 122 | const BAPE_RfEncoderSettings *pSettings |
|---|
| 123 | ); |
|---|
| 124 | |
|---|
| 125 | /*************************************************************************** |
|---|
| 126 | Summary: |
|---|
| 127 | BTSC Encoding Settings |
|---|
| 128 | |
|---|
| 129 | Description: |
|---|
| 130 | The parameters below are used for calibration and tuning of the BTSC |
|---|
| 131 | encoder. |
|---|
| 132 | ***************************************************************************/ |
|---|
| 133 | typedef struct BAPE_BtscEncodeSettings |
|---|
| 134 | { |
|---|
| 135 | bool useDeEmphasizedSourceSignals; /* Default = true. */ |
|---|
| 136 | bool equivalentMode75us; /* Default = false. When enabled, L+R and L-R will go through preephasis and be rendered out. */ |
|---|
| 137 | bool fmDeviationControl; /* Default = true. Used to Control FM Deviation of Final Output to 50Khz */ |
|---|
| 138 | |
|---|
| 139 | int32_t volume; /* Default = BAPE_VOLUME_NORMAL. Ranges from BAPE_VOLUME_NORMAL to BAPE_VOLUME_MIN. */ |
|---|
| 140 | uint32_t srdCalibrationFactor; /* Stereo Reference Decoder Calibration Factor. Default = 0x12BE76C9. Specified in 4.28 format */ |
|---|
| 141 | |
|---|
| 142 | struct |
|---|
| 143 | { |
|---|
| 144 | bool preemphasis; /* Default = true. */ |
|---|
| 145 | bool fmDeviationControl; /* Default = true. */ |
|---|
| 146 | } mainChannel; /* Settings for the main (L+R) channel */ |
|---|
| 147 | |
|---|
| 148 | struct |
|---|
| 149 | { |
|---|
| 150 | bool clipping; /* Default = true. */ |
|---|
| 151 | bool preemphasis; /* Default = true. */ |
|---|
| 152 | bool fmDeviationControl; /* Default = true. */ |
|---|
| 153 | } diffChannel; /* Settings for the difference (L-R) channel */ |
|---|
| 154 | |
|---|
| 155 | struct |
|---|
| 156 | { |
|---|
| 157 | bool enabled; /* If true, a test tone is enabled */ |
|---|
| 158 | bool frequency; /* Test tone frequency in Hz. If 0, a sweep will be output */ |
|---|
| 159 | } testTone; |
|---|
| 160 | |
|---|
| 161 | } BAPE_BtscEncodeSettings; |
|---|
| 162 | |
|---|
| 163 | /*************************************************************************** |
|---|
| 164 | Summary: |
|---|
| 165 | Encoding-Specific Settings for an audio encoder |
|---|
| 166 | ***************************************************************************/ |
|---|
| 167 | typedef struct BAPE_RfEncoderEncodingSettings |
|---|
| 168 | { |
|---|
| 169 | BAPE_RfAudioEncoding encoding; /* this is used for the codecSettings lookup */ |
|---|
| 170 | union |
|---|
| 171 | { |
|---|
| 172 | BAPE_BtscEncodeSettings btsc; |
|---|
| 173 | } encodingSettings; |
|---|
| 174 | } BAPE_RfEncoderEncodingSettings; |
|---|
| 175 | |
|---|
| 176 | /*************************************************************************** |
|---|
| 177 | Summary: |
|---|
| 178 | Get Encoding-Specific Settings for an RF Audio Encoder |
|---|
| 179 | ***************************************************************************/ |
|---|
| 180 | void BAPE_RfEncoder_GetEncodingSettings( |
|---|
| 181 | BAPE_RfEncoderHandle handle, |
|---|
| 182 | BAPE_RfAudioEncoding encoding, /* The encoding for which you are retrieving settings. */ |
|---|
| 183 | BAPE_RfEncoderEncodingSettings *pSettings /* [out] Settings */ |
|---|
| 184 | ); |
|---|
| 185 | |
|---|
| 186 | /*************************************************************************** |
|---|
| 187 | Summary: |
|---|
| 188 | Set Encoding-Specific Settings for an RF Audio Encoder |
|---|
| 189 | ***************************************************************************/ |
|---|
| 190 | BERR_Code BAPE_RfEncoder_SetEncodingSettings( |
|---|
| 191 | BAPE_RfEncoderHandle handle, |
|---|
| 192 | const BAPE_RfEncoderEncodingSettings *pSettings |
|---|
| 193 | ); |
|---|
| 194 | |
|---|
| 195 | /*************************************************************************** |
|---|
| 196 | Summary: |
|---|
| 197 | Get the audio connector for an RF Audio Encoder |
|---|
| 198 | ***************************************************************************/ |
|---|
| 199 | void BAPE_RfEncoder_GetConnector( |
|---|
| 200 | BAPE_RfEncoderHandle handle, |
|---|
| 201 | BAPE_Connector *pConnector /* [out] */ |
|---|
| 202 | ); |
|---|
| 203 | |
|---|
| 204 | /*************************************************************************** |
|---|
| 205 | Summary: |
|---|
| 206 | Add an input to this processing stage |
|---|
| 207 | ***************************************************************************/ |
|---|
| 208 | BERR_Code BAPE_RfEncoder_AddInput( |
|---|
| 209 | BAPE_RfEncoderHandle handle, |
|---|
| 210 | BAPE_Connector input |
|---|
| 211 | ); |
|---|
| 212 | |
|---|
| 213 | /*************************************************************************** |
|---|
| 214 | Summary: |
|---|
| 215 | Remove an input from this processing stage |
|---|
| 216 | ***************************************************************************/ |
|---|
| 217 | BERR_Code BAPE_RfEncoder_RemoveInput( |
|---|
| 218 | BAPE_RfEncoderHandle handle, |
|---|
| 219 | BAPE_Connector input |
|---|
| 220 | ); |
|---|
| 221 | |
|---|
| 222 | /*************************************************************************** |
|---|
| 223 | Summary: |
|---|
| 224 | Remove all inputs from this processing stage |
|---|
| 225 | ***************************************************************************/ |
|---|
| 226 | BERR_Code BAPE_RfEncoder_RemoveAllInputs( |
|---|
| 227 | BAPE_RfEncoderHandle handle |
|---|
| 228 | ); |
|---|
| 229 | |
|---|
| 230 | #endif /* #ifndef BAPE_RF_ENCODER_H__ */ |
|---|
| 231 | |
|---|
| 232 | |
|---|