📄 drx3973d.lst
字号:
C51 COMPILER V8.02 DRX3973D 02/11/2009 09:42:41 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE DRX3973D
OBJECT MODULE PLACED IN drx3973d.OBJ
COMPILER INVOKED BY: D:\Program Files\KeilUv3\C51\BIN\C51.EXE drx3973d.c BROWSE DEBUG OBJECTEXTEND
line level source
1 /**
2 * \file $Id: drx3973d.c,v 1.114 2005/12/13 18:46:11 paulja Exp $
3 *
4 * \brief DRX3973D specific implementation of DRX driver.
5 *
6 * \author Paul Janssen
7 */
8
9 /*
10 * $(c) 2004-2005 Micronas GmbH. All rights reserved.
11 *
12 * This software and related documentation (the 'Software') are intellectual
13 * property owned by Micronas and are copyright of Micronas, unless specifically
14 * noted otherwise.
15 *
16 * Any use of the Software is permitted only pursuant to the terms of the
17 * license agreement, if any, which accompanies, is included with or applicable
18 * to the Software ('License Agreement') or upon express written consent of
19 * Micronas. Any copying, reproduction or redistribution of the Software in
20 * whole or in part by any means not in accordance with the License Agreement
21 * or as agreed in writing by Micronas is expressly prohibited.
22 *
23 * THE SOFTWARE IS WARRANTED, IF AT ALL, ONLY ACCORDING TO THE TERMS OF THE
24 * LICENSE AGREEMENT. EXCEPT AS WARRANTED IN THE LICENSE AGREEMENT THE SOFTWARE
25 * IS DELIVERED 'AS IS' AND MICRONAS HEREBY DISCLAIMS ALL WARRANTIES AND
26 * CONDITIONS WITH REGARD TO THE SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
27 * AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIT
28 * ENJOYMENT, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL
29 * PROPERTY OR OTHER RIGHTS WHICH MAY RESULT FROM THE USE OR THE INABILITY
30 * TO USE THE SOFTWARE.
31 *
32 * IN NO EVENT SHALL MICRONAS BE LIABLE FOR INDIRECT, INCIDENTAL, CONSEQUENTIAL,
33 * PUNITIVE, SPECIAL OR OTHER DAMAGES WHATSOEVER INCLUDING WITHOUT LIMITATION,
34 * DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
35 * INFORMATION, AND THE LIKE, ARISING OUT OF OR RELATING TO THE USE OF OR THE
36 * INABILITY TO USE THE SOFTWARE, EVEN IF MICRONAS HAS BEEN ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGES, EXCEPT PERSONAL INJURY OR DEATH RESULTING FROM
38 * MICRONAS' NEGLIGENCE. $
39 *
40 */
41
42 /*-----------------------------------------------------------------------------
43 INCLUDE FILES
44 ----------------------------------------------------------------------------*/
45
46 #include "drx_dap_wasi.h" /* data access protocol */
*** ERROR C141 IN LINE 736 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 744 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 751 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 758 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 773 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 780 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 795 OF DRX_DRIVER.H: syntax error near ','
*** ERROR C141 IN LINE 802 OF DRX_DRIVER.H: syntax error near ','
47 #include "drx3973d.h"
C51 COMPILER V8.02 DRX3973D 02/11/2009 09:42:41 PAGE 2
48 #include "drx3973d_map.h"
49
50 /*-----------------------------------------------------------------------------
51 ENUMS
52 ----------------------------------------------------------------------------*/
53
54 /*-----------------------------------------------------------------------------
55 DEFINES
56 ----------------------------------------------------------------------------*/
57
58 /**
59 * \def DRX3973D_DEF_I2C_ADDR
60 * \brief Default I2C addres of a demodulator instance.
61 */
62 #define DRX3973D_DEF_I2C_ADDR ((0x70)<<1)
63
64 /**
65 * \def DRX3973D_DEF_DEMOD_DEV_ID
66 * \brief Default device identifier of a demodultor instance.
67 */
68 #define DRX3973D_DEF_DEMOD_DEV_ID (1)
69
70
71 /**
72 * \def DRX3973D_SCAN_TIMEOUT
73 * \brief Timeout value for waiting on demod lock during channel scan (millisec).
74 */
75 #define DRX3973D_SCAN_TIMEOUT 604
76
77 /**
78 * \def DRX3973D_DAP
79 * \brief Name of structure containing all data access protocol functions.
80 */
81 #define DRX3973D_DAP drxDapWasiFunct_g
82
83 /**
84 * \def HI_I2C_DELAY
85 * \brief HI timing delay for I2C timing (in nano seconds)
86 *
87 * Used to compute HI_CFG_DIV, should be 250 ns.
88 *
89 */
90 #define HI_I2C_DELAY 84
91
92 /**
93 * \def HI_I2C_BRIDGE_DELAY
94 * \brief HI timing delay for I2C timing (in nano seconds)
95 *
96 * Used to compute HI_CFG_BDL, should be 1000 ns.
97 * Set to 1550 to enable working with murata tuner.
98 *
99 */
100 #define HI_I2C_BRIDGE_DELAY 750
101
102 /**
103 * \def EQ_TD_TPS_PWR_XXXX
104 * \brief TD_TPS_PWR constants
105 *
106 * Used in SetChannel.
107 *
108 */
109 #define EQ_TD_TPS_PWR_UNKNOWN 0x00C0 /* Unknown configurations */
C51 COMPILER V8.02 DRX3973D 02/11/2009 09:42:41 PAGE 3
110 #define EQ_TD_TPS_PWR_QPSK 0x016A
111 #define EQ_TD_TPS_PWR_QAM16_ALPHAN 0x0195
112 #define EQ_TD_TPS_PWR_QAM16_ALPHA1 0x0195
113 #define EQ_TD_TPS_PWR_QAM16_ALPHA2 0x011E
114 #define EQ_TD_TPS_PWR_QAM16_ALPHA4 0x01CE
115 #define EQ_TD_TPS_PWR_QAM64_ALPHAN 0x019F
116 #define EQ_TD_TPS_PWR_QAM64_ALPHA1 0x019F
117 #define EQ_TD_TPS_PWR_QAM64_ALPHA2 0x00F8
118 #define EQ_TD_TPS_PWR_QAM64_ALPHA4 0x014D
119
120
121 /**
122 * \def DRX3973D_DEF_XXXX
123 * \brief Shadow register default values
124 *
125 * Needed for AGC IF/RF control.
126 *
127 */
128 #define DRX3973D_DEF_AG_PWD_CONSUMER 0x000E
129 #define DRX3973D_DEF_AG_PWD_PRO 0x0000
130 #define DRX3973D_DEF_AG_AGC_SIO 0x0000
131
132 /**
133 * \def DRX3973D_OSCDEV_DO_SCAN
134 * \brief Instruct SC to do a scan for oscillator frequency deviation.
135 *
136 * This defines the search range for a clock deviation. Has to be even.
137 * If set to n the search range will be from -n/2 ... n/2 times the specified
138 * step size.
139 */
140 #define DRX3973D_OSCDEV_DO_SCAN (16)
141
142 /**
143 * \def DRX3973D_OSCDEV_DONT_SCAN
144 * \brief Instruct SC to skip the scan for oscillator frequency deviation.
145 *
146 * Search range is set to 0.
147 */
148 #define DRX3973D_OSCDEV_DONT_SCAN (0)
149
150 /**
151 * \def DRX3973D_OSCDEV_STEP
152 * \brief Step size for scan for oscillator frequency deviation.
153 *
154 * This defines the stepsize used during the search.
155 * 275 is approx. a 25 ppm step when tuning to an 8 Mhz channel (worst case).
156 * 220 is approx. a 20 ppm step when tuning to an 8 Mhz channel (worst case).
157 */
158 #define DRX3973D_OSCDEV_STEP (275)
159
160 /**
161 * \def DRX3973D_BANDWIDTH_8MHZ_IN_HZ
162 * \brief Defines for bandwidths in Hz (6,7 & 8Mhz).
163 */
164 /* (64/7)*(8/8)*1000000 Hz */
165 #define DRX3973D_BANDWIDTH_8MHZ_IN_HZ (0x8B8249L)
166 /* (64/7)*(7/8)*1000000 */
167 #define DRX3973D_BANDWIDTH_7MHZ_IN_HZ (0x7A1200L)
168 /* (64/7)*(6/8)*1000000 */
169 #define DRX3973D_BANDWIDTH_6MHZ_IN_HZ (0x68A1B6L)
170
171 /*============================================================================*/
C51 COMPILER V8.02 DRX3973D 02/11/2009 09:42:41 PAGE 4
172 /*=== WORKAROUNDS ============================================================*/
173 /*============================================================================*/
174
175 /**
176 * \def USE_LC_INIT
177 * \brief If defined compile with usage of InitLC routine, otherwise without
178 *
179 * LCInit() is needed by LC code version 0.1.32.
180 * LCInit() is NOT needed by LC code version 0.1.67 or higher.
181 * TODO remove
182 *
183 */
184 /*
185 #define USE_LC_INIT
186 */
187
188 /**
189 * \def COMPILE_FOR_QT
190 * \brief If defined compile for QT.
191 *
192 * Several settings are different for QT environment.
193 * TODO remove
194 *
195 */
196 /*
197 #define COMPILE_FOR_QT
198 */
199
200 /**
201 * \def DONT_USE_SEMAPHORES
202 * \brief If defined , do not use semaphores for HI or SC communication.
203 *
204 * Due to problem with read-modify-write access originaly spec-ed semaphores
205 * cannot be used. The semaphores may not reside in HI or SC data RAM.
206 *
207 */
208 #define DONT_USE_SEMAPHORES
209
210 /*============================================================================*/
211 /*=== REGISTER ACCESS MACROS =================================================*/
212 /*============================================================================*/
213
214 #ifdef DRX3973DDRIVER_DEBUG
#include <stdio.h>
#define CHK_ERROR( s ) \
do{ \
if ( (s) != DRX_STS_OK ) \
{ \
fprintf(stderr, \
"ERROR[\n file : %s\n line : %d\n]\n", \
__FILE__,__LINE__); \
goto rw_error; }; \
} \
while (0)
#else
227 #define CHK_ERROR( s ) \
228 do{ \
229 if ( (s) != DRX_STS_OK ) \
230 { \
231 goto rw_error; }; \
232 } \
233 while (0)
C51 COMPILER V8.02 DRX3973D 02/11/2009 09:42:41 PAGE 5
234 #endif
235
236 #define WR16( dev, addr, val, flags) \
237 CHK_ERROR( DRX3973D_DAP.writeReg16Func( (dev), \
238 (addr), \
239 (val), \
240 (flags) ) )
241
242 #define RR16( dev, addr, val, flags) \
243 CHK_ERROR( DRX3973D_DAP.readReg16Func( (dev), \
244 (addr), \
245 (val), \
246 (flags) ) )
247
248 #define RMWR16( dev, addr, wval, rval) \
249 CHK_ERROR( DRX3973D_DAP.readModifyWriteReg16Func( (dev), \
250 (addr), \
251 (HI_RA_RAM_SLV0_READBACK__A), \
252 (wval), \
253 (rval) ) )
254
255 #define BCWR16( dev, addr, val ) \
256 CHK_ERROR( DRX3973D_DAP.writeReg16Func( (dev), \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -