1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 // Software and any modification/derivatives thereof.
18 // No right, ownership, or interest to MStar Software and any
19 // modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 // supplied together with third party`s software and the use of MStar
23 // Software may require additional licenses from third parties.
24 // Therefore, you hereby agree it is your sole responsibility to separately
25 // obtain any and all third party right and license necessary for your use of
26 // such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 // MStar`s confidential information and you agree to keep MStar`s
30 // confidential information in strictest confidence and not disclose to any
31 // third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 // kind. Any warranties are hereby expressly disclaimed by MStar, including
35 // without limitation, any warranties of merchantability, non-infringement of
36 // intellectual property rights, fitness for a particular purpose, error free
37 // and in conformity with any international standard. You agree to waive any
38 // claim against MStar for any loss, damage, cost or expense that you may
39 // incur related to your use of MStar Software.
40 // In no event shall MStar be liable for any direct, indirect, incidental or
41 // consequential damages, including without limitation, lost of profit or
42 // revenues, lost or damage of data, and unauthorized system use.
43 // You agree that this Section 4 shall still apply without being affected
44 // even if MStar Software has been modified by MStar in accordance with your
45 // request or instruction for your use, except otherwise agreed by both
46 // parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 // services in relation with MStar Software to you for your use of
50 // MStar Software in conjunction with your or your customer`s product
51 // ("Services").
52 // You understand and agree that, except otherwise agreed by both parties in
53 // writing, Services are provided on an "AS IS" basis and the warranty
54 // disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 // or otherwise:
58 // (a) conferring any license or right to use MStar name, trademark, service
59 // mark, symbol or any other identification;
60 // (b) obligating MStar or any of its affiliates to furnish any person,
61 // including without limitation, you and your customers, any assistance
62 // of any kind whatsoever, or any information; or
63 // (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 // of Taiwan, R.O.C., excluding its conflict of law rules.
67 // Any and all dispute arising out hereof or related hereto shall be finally
68 // settled by arbitration referred to the Chinese Arbitration Association,
69 // Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 // Rules of the Association by three (3) arbitrators appointed in accordance
71 // with the said Rules.
72 // The place of arbitration shall be in Taipei, Taiwan and the language shall
73 // be English.
74 // The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 // [for Doxygen]
94 /// file drvADVSOUND.c
95 /// @brief Subroutine for advance sound effect
96 /// @author MStarSemi Inc.
97 ////////////////////////////////////////////////////////////////////////////////
98
99 //-------------------------------------------------------------------------------------------------
100 // Include Files
101 //-------------------------------------------------------------------------------------------------
102 #include "MsCommon.h"
103 #include "drvBDMA.h"
104
105 #include "drvAUDIO_if.h"
106 #include "drvAUDIO.h"
107
108 #include "./internal/drvADVSOUND.h"
109 #include "./internal/drvMAD.h"
110 #include "./internal/drvMAD2.h"
111 #include "./internal/drvAUDIO_internal.h"
112
113 #include "regAUDIO.h"
114 #include "drvBDMA.h"
115 #include "halAUDIO.h"
116 #include "halADVAUDIO.h"
117
118
119 //-------------------------------------------------------------------------------------------------
120 // Local Compiler Options
121 //-------------------------------------------------------------------------------------------------
122
123 //-------------------------------------------------------------------------------------------------
124 // Local Defines
125 //-------------------------------------------------------------------------------------------------
126
127 //-------------------------------------------------------------------------------------------------
128 // Local Structures
129 //-------------------------------------------------------------------------------------------------
130
131
132 //------------------------------------------------------------------------------
133 // Local Functions Prototype
134 //------------------------------------------------------------------------------
135
136
137 //-------------------------------------------------------------------------------------------------
138 // Extern Variables
139 //-------------------------------------------------------------------------------------------------
140
141
142 //-------------------------------------------------------------------------------------------------
143 // Global Variables
144 //-------------------------------------------------------------------------------------------------
145
146
147 //-------------------------------------------------------------------------------------------------
148 // Local Variables
149 //-------------------------------------------------------------------------------------------------
150
151
152 //-------------------------------------------------------------------------------------------------
153 // Debug Functions
154 //-------------------------------------------------------------------------------------------------
155
156
157 //-------------------------------------------------------------------------------------------------
158 // Local Functions
159 //-------------------------------------------------------------------------------------------------
160 ////////////////////////////////////////////////////////////////////////////////
161 /// @brief \b Function \b Name: MDrv_SOUND_AseSetBinAddress()
162 /// @brief \b Function \b Description: This function is used to assign Bin address of advanced sound effect
163 /// @param u8Index \b : type index
164 /// @param BinAddr \b : address of Bin file
165 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_AseSetBinAddress(MS_U8 u8Index,MS_U32 BinAddr)166 void MDrv_SOUND_AseSetBinAddress(MS_U8 u8Index, MS_U32 BinAddr)
167 {
168 HAL_SOUND_AseSetBinAddress(u8Index, BinAddr);
169 }
170
171 ////////////////////////////////////////////////////////////////////////////////
172 /// @brief \b Function \b Name: MDrv_SOUND_SetPara()
173 /// @brief \b Function \b Description: This function is used to write paramters value into SRAM
174 /// @param u8Addr1 \b : middle byte of address
175 /// @param u8Addr2 \b : low byte of address
176 /// @param u8Value1 \b : high byte of value
177 /// @param u8Value2 \b : middle byte of value
178 /// @param u8Value3 \b : low byte of value
179 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_SetPara(MS_U8 u8Addr1,MS_U8 u8Addr2,MS_U8 u8Value1,MS_U8 u8Value2,MS_U8 u8Value3)180 void MDrv_SOUND_SetPara(MS_U8 u8Addr1 , MS_U8 u8Addr2, MS_U8 u8Value1, MS_U8 u8Value2, MS_U8 u8Value3)
181 {
182 HAL_SOUND_SetPara(u8Addr1 , u8Addr2, u8Value1, u8Value2, u8Value3);
183 }
184
185 ////////////////////////////////////////////////////////////////////////////////
186 /// @brief \b Function \b Name: MDrv_SOUND_TSHD_TruSurr()
187 /// @brief \b Function \b Description: This function is used to enable/disable SRS-HD
188 /// @param u8TSHDenTruSurr \b : 1: enable, 0: disable
189 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_TSHD_TruSurr(MS_U8 u8TSHDenTruSurr)190 void MDrv_SOUND_TSHD_TruSurr(MS_U8 u8TSHDenTruSurr)
191 {
192 HAL_SOUND_TSHD_TruSurr(u8TSHDenTruSurr);
193 }
194
195 ////////////////////////////////////////////////////////////////////////////////
196 /// @brief \b Function \b Name: MDrv_SOUND_TSHD_Limiter()
197 /// @brief \b Function \b Description: This function is used to enable/disable SRS-HD Limiter
198 /// @param u8TSHDenLimiter \b : 1: enable, 0: disable
199 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_TSHD_Limiter(MS_U8 u8TSHDenLimiter)200 void MDrv_SOUND_TSHD_Limiter(MS_U8 u8TSHDenLimiter)
201 {
202 HAL_SOUND_TSHD_Limiter(u8TSHDenLimiter);
203 }
204
205 ////////////////////////////////////////////////////////////////////////////////
206 /// @brief \b Function \b Name: MDrv_SOUND_TSHD_SRS3D()
207 /// @brief \b Function \b Description: This function is used to enable/disable SRS-HD SRS3D
208 /// @param u8TSHDenSRS3D \b : 1: enable, 0: disable
209 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_TSHD_SRS3D(MS_U8 u8TSHDenSRS3D)210 void MDrv_SOUND_TSHD_SRS3D(MS_U8 u8TSHDenSRS3D)
211 {
212 HAL_SOUND_TSHD_SRS3D(u8TSHDenSRS3D);
213 }
214
215 ////////////////////////////////////////////////////////////////////////////////
216 /// @brief \b Function \b Name: MDrv_SOUND_TruVolume_Enable()
217 /// @brief \b Function \b Description: This function is used to enable/disable SRS-HD SRS3D
218 /// @param u8TSHDenTVol \b : 1: enable, 0: disable
219 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_TruVolume_Enable(MS_U8 u8TSHDenTVol)220 void MDrv_SOUND_TruVolume_Enable(MS_U8 u8TSHDenTVol)
221 {
222 HAL_SOUND_TruVolume_Enable(u8TSHDenTVol);
223 }
224
225 ////////////////////////////////////////////////////////////////////////////////
226 /// @brief \b Function \b Name: MDrv_SOUND_ADSY_SetPara()
227 /// @brief \b Function \b Description: This function is used to set parameter
228 /// @param u8mode \b :
229 /// @param u8value \b :
230 ////////////////////////////////////////////////////////////////////////////////
MDrv_SOUND_ADSY_SetPara(MS_U8 u8mode,MS_U8 u8value)231 void MDrv_SOUND_ADSY_SetPara(MS_U8 u8mode, MS_U8 u8value)
232 {
233 HAL_SOUND_ADSY_SetPara(u8mode, u8value);
234 }
235
236 ////////////////////////////////////////////////////////////////////////////////
237 /// @brief \b Function \b Name: MDrv_ADVSOUND_SetParam(ADVSND_PARAM param, MS_U32 u32value1, MS_U16 u16value2)
238 /// @brief \b Function \b Description: This routine is used to set paramters advanced sound effect.
239 /// @param <IN> \b param, u32value1, u16value2
240 /// @param <OUT> \b NONE :
241 /// @return <OUT> \b FALSE : Setting Fail
242 /// \b TRUE : Setting OK
243 /// @param <GLOBAL> \b NONE
244 ////////////////////////////////////////////////////////////////////////////////
MDrv_ADVSOUND_SetParam(ADVSND_PARAM param,MS_U32 u32value1,MS_U16 u16value2)245 MS_BOOL MDrv_ADVSOUND_SetParam(ADVSND_PARAM param, MS_U32 u32value1, MS_U16 u16value2)
246 {
247 return(HAL_ADVSOUND_SetParam(param, u32value1, u16value2));
248 }
249
250
251 ////////////////////////////////////////////////////////////////////////////////
252 /// @brief \b Function \b Name: MDrv_AUDIO_COPY_Parameter()
253 /// @brief \b Function \b Description: This function is used to copy user parameters to hal
254 ////////////////////////////////////////////////////////////////////////////////
MDrv_AUDIO_COPY_Parameter(ADVSND_PARAM type,void * Parameter_ptr,MS_U32 size)255 void MDrv_AUDIO_COPY_Parameter(ADVSND_PARAM type, void * Parameter_ptr, MS_U32 size)
256 {
257 HAL_AUDIO_COPY_Parameter(type, Parameter_ptr, size);
258 }
259
260 ////////////////////////////////////////////////////////////////////////////////
261 /// @brief \b Function \b Name: MDrv_DBXTV_SetVolPath(AUDIO_PATH_TYPE path)
262 /// @brief \b Function \b Description: This routine is used to set dbx TV volume path
263 /// @param <IN> \b param, AUDIO_PATH_TYPE
264 /// @param <OUT> \b NONE :
265 /// @param <RET> \b NONE :
266 /// @param <GLOBAL> \b NONE
267 ////////////////////////////////////////////////////////////////////////////////
MDrv_DBXTV_SetVolPath(AUDIO_OUTPUT_TYPE path)268 void MDrv_DBXTV_SetVolPath(AUDIO_OUTPUT_TYPE path){
269 Hal_DBXTV_SetVolPath(path);
270 }
271