📄 msm9841.lst
字号:
C51 COMPILER V7.09 MSM9841 09/17/2008 16:09:50 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE MSM9841
OBJECT MODULE PLACED IN .\output\msm9841.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE audio\msm9841.c LARGE BROWSE INCDIR(audio\;eeprom\;extendUART\;flash\;gps\;
-inter\;key\;mcu\;menu\;usb\;gprs\;main\;1wire\) DEBUG OBJECTEXTEND PRINT(.\output\msm9841.lst) OBJECT(.\output\msm9841.o
-bj)
line level source
1 #include "typedef.h"
2 #include "msm9841.h"
3 #include <intrins.h>
4 #include "nf_drv.h"
5
6
7 Uchar volatile xdata COMMAND_INPUT _at_ 0xc800;
8 Uchar volatile xdata DATA_INPUT _at_ 0xc801;
9
10 Uint8 voiceSynMethod;
11 Uint8 volumeVal;
12 Uint8 samplingFreq;
13
14 extern Uchar volatile xdata D12_Y1;//原来的xCONTROLBYTE81K;
15 extern idata Byte D16CS;//原来的xConByte81KValue;
16
17 Byte msm_is_full()
18 {
19 1 if (1 == MSM_FULL)
20 1 return OK;
21 1 else
22 1 return KO;
23 1 }
24
25 #define msm_input_command(command) (COMMAND_INPUT = (command))
26 /*
27 void msm_input_command(Uint8 command)
28 {
29 COMMAND_INPUT = command;
30 }*/
31
32 #define msm_input_data(databuf) (DATA_INPUT = (databuf))
33 /*void msm_input_data(Uint8 databuf)
34 {
35 DATA_INPUT = databuf;
36 }*/
37
38 void msm_read_status(Byte* pbuf)
39 {
40 1 *pbuf = COMMAND_INPUT;
41 1 }
42
43 /**change strobe to 4 machine cycles**/
44 void msm_modify_strobe_width()
45 {
46 1 // CKCON |= 0x02;
47 1 }
48
49 void msm_default_strobe_width()
50 {
51 1 // CKCON &= 0xf9;
52 1 }
53
C51 COMPILER V7.09 MSM9841 09/17/2008 16:09:50 PAGE 2
54 void msm_stop_playback()
55 {
56 1 Uint8 configData;
57 1 msm_modify_strobe_width();
58 1 configData = STOP|BOTH_SIDEVOICE;
59 1 msm_input_command(configData);
60 1 msm_default_strobe_width();
61 1 }
62
63 void msm_change_volume(Byte volume)
64 {
65 1 volatile Uint8 configData;
66 1 msm_modify_strobe_width();
67 1 configData = VOLUME_SETTING|volume;
68 1 //left voice
69 1 msm_input_command(configData);
70 1 _nop_();
71 1 _nop_();
72 1 //right voice
73 1 configData += 8;
74 1 msm_input_command(configData);
75 1 msm_default_strobe_width();
76 1 }
77
78 void msm_set_toneformat()
79 {
80 1 Uint8 configData;
81 1 configData = VOICE_SYN+voiceSynMethod;
82 1 msm_input_command(configData);
83 1 _nop_();
84 1 _nop_();
85 1 _nop_();
86 1 }
87 /*
88 void tts_reset()
89 {
90 Byte i;
91 MSM_RESET = 0;
92
93 for (i=0; i<0xff; i++)
94 {
95 _nop_();
96 _nop_();
97 _nop_();
98 _nop_();
99 _nop_();
100 _nop_();
101 _nop_();
102 _nop_();
103 _nop_();
104 _nop_();
105 _nop_();
106 _nop_();
107 _nop_();
108 _nop_();
109 _nop_();
110 _nop_();
111 _nop_();
112 _nop_();
113 _nop_();
114 _nop_();
115 }
C51 COMPILER V7.09 MSM9841 09/17/2008 16:09:50 PAGE 3
116
117 for (i=0; i<0xff; i++)
118 {
119 _nop_();
120 _nop_();
121 _nop_();
122 _nop_();
123 _nop_();
124 _nop_();
125 _nop_();
126 _nop_();
127 _nop_();
128 _nop_();
129 _nop_();
130 _nop_();
131 _nop_();
132 _nop_();
133 _nop_();
134 _nop_();
135 _nop_();
136 _nop_();
137 _nop_();
138 _nop_();
139 }
140 MSM_RESET = 1;
141 }
142 */
143 void msm9841_reset_init()
144 {
145 1 volatile Uint8 configData;
146 1
147 1 D16CS &= 0x7f;
148 1 D12_Y1 = D16CS;//reset=0
149 1 _nop_();
150 1 _nop_();
151 1 _nop_();
152 1 _nop_();
153 1 _nop_();
154 1 _nop_();
155 1 _nop_();
156 1 _nop_();
157 1 _nop_();
158 1 D16CS |= 0x80;
159 1 D12_Y1 = D16CS;//reset = 1
160 1 _nop_();
161 1 _nop_();
162 1 _nop_();
163 1 _nop_();
164 1
165 1 msm_modify_strobe_width();
166 1 msm_set_toneformat();
167 1 //analog specification 1;
168 1 //we use default config,use monaural playback
169 1 configData = ANALOG_SPEC1+0;
170 1 msm_input_command(configData);
171 1 _nop_();
172 1 _nop_();
173 1 _nop_();
174 1
175 1 //analog specification 2;
176 1 //we use default config
177 1 configData = ANALOG_SPEC2+0;
C51 COMPILER V7.09 MSM9841 09/17/2008 16:09:50 PAGE 4
178 1 msm_input_command(configData);
179 1 _nop_();
180 1 _nop_();
181 1 _nop_();
182 1
183 1 //set fifo byte configuration
184 1 configData = FIFO_CONFIG+BIT1024;//BIT1024;
185 1 msm_input_command(configData);
186 1 _nop_();
187 1 _nop_();
188 1 _nop_();
189 1
190 1 //set output signal
191 1 configData = SIGNAL_FORMAT+0;
192 1 msm_input_command(configData);
193 1 _nop_();
194 1 _nop_();
195 1 _nop_();
196 1 msm_default_strobe_width();
197 1 }
198
199 void msm9841_init()
200 {
201 1 volatile Uint8 configData;
202 1 //first should reset msm9841
203 1 //MSM_CH = 0;
204 1
205 1 D16CS |= 0x80;
206 1 D12_Y1 = D16CS;//reset = 1
207 1 for (configData=0; configData<0xff; configData++)
208 1 {
209 2 _nop_();
210 2 _nop_();
211 2 _nop_();
212 2 _nop_();
213 2 _nop_();
214 2 _nop_();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -