📄 example_full.lst
字号:
C51 COMPILER V8.02 EXAMPLE_FULL 02/11/2009 09:41:00 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE EXAMPLE_FULL
OBJECT MODULE PLACED IN example_full.OBJ
COMPILER INVOKED BY: D:\Program Files\KeilUv3\C51\BIN\C51.EXE example_full.c BROWSE DEBUG OBJECTEXTEND
line level source
1 /**
2 * \file $Id: example_full.c,v 1.16 2005/11/29 16:24:03 jasper Exp $
3 *
4 * \brief example of a application with extensive usage of the drxdriver
5 *
6 * \author Jasper Schrader
7 *
8 *
9 * $(c) 2004-2005 Micronas GmbH. All rights reserved.
10 *
11 * This software and related documentation (the 'Software') are intellectual
12 * property owned by Micronas and are copyright of Micronas, unless specifically
13 * noted otherwise.
14 *
15 * Any use of the Software is permitted only pursuant to the terms of the
16 * license agreement, if any, which accompanies, is included with or applicable
17 * to the Software ('License Agreement') or upon express written consent of
18 * Micronas. Any copying, reproduction or redistribution of the Software in
19 * whole or in part by any means not in accordance with the License Agreement
20 * or as agreed in writing by Micronas is expressly prohibited.
21 *
22 * THE SOFTWARE IS WARRANTED, IF AT ALL, ONLY ACCORDING TO THE TERMS OF THE
23 * LICENSE AGREEMENT. EXCEPT AS WARRANTED IN THE LICENSE AGREEMENT THE SOFTWARE
24 * IS DELIVERED 'AS IS' AND MICRONAS HEREBY DISCLAIMS ALL WARRANTIES AND
25 * CONDITIONS WITH REGARD TO THE SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
26 * AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIT
27 * ENJOYMENT, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL
28 * PROPERTY OR OTHER RIGHTS WHICH MAY RESULT FROM THE USE OR THE INABILITY
29 * TO USE THE SOFTWARE.
30 *
31 * IN NO EVENT SHALL MICRONAS BE LIABLE FOR INDIRECT, INCIDENTAL, CONSEQUENTIAL,
32 * PUNITIVE, SPECIAL OR OTHER DAMAGES WHATSOEVER INCLUDING WITHOUT LIMITATION,
33 * DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
34 * INFORMATION, AND THE LIKE, ARISING OUT OF OR RELATING TO THE USE OF OR THE
35 * INABILITY TO USE THE SOFTWARE, EVEN IF MICRONAS HAS BEEN ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGES, EXCEPT PERSONAL INJURY OR DEATH RESULTING FROM
37 * MICRONAS' NEGLIGENCE. $
38 *
39 */
40
41 /*-----------------------------------------------------------------------------
42 INCLUDES
43 ------------------------------------------------------------------------------*/
44
45 /* application include */
46 #include "example_aux.c.inc" /* for logging text output */
*** ERROR C202 IN LINE 65 OF EXAMPLE_AUX.C.INC: 'stderr': undefined identifier
*** ERROR C241 IN LINE 66 OF EXAMPLE_AUX.C.INC: '_XPRINTF': auto segment too large
47
48 /* driver includes */
49 #include "drx3973d.h" /* drx397xd specific drxdriver include */
50 #include "drx3973d_mc.h" /* file containg the microcode (firmware) */
51
52
53 /*-----------------------------------------------------------------------------
C51 COMPILER V8.02 EXAMPLE_FULL 02/11/2009 09:41:00 PAGE 2
54 DEFINES
55 ------------------------------------------------------------------------------*/
56
57 #define DESIRED_FREQUENCY 578000 /* center freq. [kHz] of desired channel */
58 #define DESIRED_BANDWIDTH DRX_BANDWIDTH_8MHZ /* bandwidth of desired channel */
59 #define LOCK_TIMEOUT_ANY 700 /* timeout [msec] for 'any type of lock' */
60 #define LOCK_TIMEOUT_MPEG 3000 /* timeout [msec] for MPEG lock */
61
62 /* signal quality display options */
63 #define SHOW_SIGNAL_QUALITY_AS_FLOATS 1 /* set to 1 for floating-point display */
64 #define SHOW_SIGNAL_QUALITY_AS_INTEGERS 1 /* set to 1 for integer display */
65 #define SHOW_SIGNAL_QUALITY_AS_INDICATORS 1 /* set to 1 for 'OSD-indicator' display */
66
67 #if (SHOW_SIGNAL_QUALITY_AS_FLOATS)
68 #include <math.h>
69 #endif
70
71
72 /*------------------------------------------------------------------------------
73 TUNER SELECTION
74 ------------------------------------------------------------------------------*/
75
76 /* using pre-configured tuner */
77 #define TUNER_THOMSON_DTT_759X
78 #include "bsp_tuner_tables.h"
79
80
81 /*------------------------------------------------------------------------------
82 VARABLES
83 ------------------------------------------------------------------------------*/
84
85 /* declare demod instance */
86 static I2CDeviceAddr_t demodAddr;
87 static DRXCommonAttr_t demodCommAttr;
88 static DRXDemodInstance_t demod;
89
90 /* declare list for one demod instance */
91 static pDRXDemodInstance_t demodulators[] = { NULL, NULL };
92
93
94 /*------------------------------------------------------------------------------
95 MAIN APPLICATION
96 ------------------------------------------------------------------------------*/
97 /* This example application steps through the following phases:
98
99 (1) Customize demodulator attributes
100 (2) Initialize system and open demodulator
101 (3) Configure hardware dependent settings
102 (4) Program channel and wait for lock
103 (5) Retrieve channel parameters
104 (6) Show signal quality and strength
105 (7) Terminate system
106 */
107
108 int main ( void )
109 {
110 1 /* declare local variables */
111 1 DRXLockStatus_t lockStatus; /* used in step (4) */
112 1 u32_t start, delta; /* used in step (4) */
113 1 Bool_t everLocked; /* used in step (4) */
114 1 DRXChannel_t channelParams; /* used in step (4) & (5) */
115 1 DRXTPSInfo_t TPSInfo; /* used in step (5) */
C51 COMPILER V8.02 EXAMPLE_FULL 02/11/2009 09:41:00 PAGE 3
116 1 DRXSigQuality_t sigQuality; /* used in step (6) */
117 1 u16_t sigStrength; /* used in step (6) */
118 1 pDRXVersionList_t versionList = NULL;
119 1
120 1
121 1 /*-----------------------------------------------------------------------*/
122 1 /* (1) Customize demodulator attributes */
123 1 /*-----------------------------------------------------------------------*/
124 1
125 1 /* prepare demod data structure; start with default values */
126 1 demodAddr = DRX3973DDefaultAddr_g;
127 1 demodCommAttr = DRX3973DDefaultCommAttr_g;
128 1 demod = DRX3973DDefaultDemod_g;
129 1
130 1 /* connect datastructures through pointers */
131 1 demod.myI2CDevAddr = &demodAddr; /* connect address and ID to demod data structure
- */
132 1 demod.myCommonAttr = &demodCommAttr; /* connect common attributes to demod data structure
- */
133 1 demod.myTuner = &PRE_CONF_TUNER; /* connect pre-configured tuner to demod data structu
-re */
134 1 demodulators[0] = &demod; /* add demod to list of demodulators
- */
135 1
136 1 /* assign firmware attributes */
137 1 demodCommAttr.microcode = MC_IMAGE_ADDR; /* pointer to array containing firmware
- */
138 1 demodCommAttr.microcodeSize = MC_IMAGE_SIZE; /* size of the firmware image
- */
139 1
140 1 /* modify device address and ID */
141 1 demodAddr.i2cAddr = 0xE0; /* i2c address
- */
142 1 demodAddr.i2cDevId = 1; /* device ID
- */
143 1
144 1 /* set clock attributes */
145 1 demodCommAttr.sysClockFreq = 48000; /* system clock frequency in kHz
- */
146 1 demodCommAttr.oscClockFreq = 20000; /* oscillator/crystal frequency kHz
- */
147 1
148 1 /* set tuner i2c bus connection */
149 1 demodCommAttr.tunerPortNr = 1; /* 0 = tuner on main i2c bus, 1 = tuner behind i2c bri
-dge */
150 1 /* NOTE: only the XCeive XC3028 uses portNr = 0
- */
151 1
152 1 /* modify MPEG output attributes */
153 1 demodCommAttr.enableMPEGOutput = TRUE; /* switch to enable MPEG out
- */
154 1 demodCommAttr.insertRSByte = FALSE; /* switch to insert RS byte into MPEG-TS
- */
155 1 demodCommAttr.enableParallel = TRUE; /* select parallel (TRUE) or serial (FALSE) output
- */
156 1
157 1
158 1 /*-----------------------------------------------------------------------*/
159 1 /* (2) Initialize system and open demodulator */
160 1 /*-----------------------------------------------------------------------*/
161 1
162 1 /* enable I2C communication */
C51 COMPILER V8.02 EXAMPLE_FULL 02/11/2009 09:41:00 PAGE 4
163 1 if( DRXBSP_I2C_Init() != DRX_STS_OK )
164 1 {
165 2 XERROR( "failure: error initializing i2c\n" );
166 2 }
167 1 XPRINTF("success: I2C initialized\n");
168 1
169 1 /* initialize host bsp module */
170 1 if( DRXBSP_HST_Init() != DRX_STS_OK )
171 1 {
172 2 XERROR("failure: error initializing host bsp\n");
173 2 }
174 1 XPRINTF("success: Host bsp initialized\n");
175 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -