📄 vs1003.s
字号:
_vs1003_infor::
.dbline -1
.dbline 129
; }
; void vs1003_infor(void)
; {
.dbline 130
; Print_str("VS1003B_STATUS = 0x");
ldi R16,<L32
ldi R17,>L32
xcall _Print_str
.dbline 131
; Print_int(mp3ReadReg(SPI_STATUS));
ldi R16,1
xcall _mp3ReadReg
xcall _Print_int
.dbline 132
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline 133
; Print_str("VS1003B_MODE = 0x");
ldi R16,<L34
ldi R17,>L34
xcall _Print_str
.dbline 134
; Print_int(mp3ReadReg(SPI_MODE));
clr R16
xcall _mp3ReadReg
xcall _Print_int
.dbline 135
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline 136
; Print_str("VS1003B_CLOCKF = 0x");
ldi R16,<L35
ldi R17,>L35
xcall _Print_str
.dbline 137
; Print_int(mp3ReadReg(SPI_CLOCKF));
ldi R16,3
xcall _mp3ReadReg
xcall _Print_int
.dbline 138
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline 139
; Print_str("VS1003B_VOL = 0x");
ldi R16,<L36
ldi R17,>L36
xcall _Print_str
.dbline 140
; Print_int(mp3ReadReg(SPI_VOL));
ldi R16,11
xcall _mp3ReadReg
xcall _Print_int
.dbline 141
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline 142
; Print_str("VS1003B_BASS = 0x");
ldi R16,<L37
ldi R17,>L37
xcall _Print_str
.dbline 143
; Print_int(mp3ReadReg(SPI_BASS));
ldi R16,2
xcall _mp3ReadReg
xcall _Print_int
.dbline 144
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline 145
; Print_str("VS1003B_SIHDA0 = 0x");
ldi R16,<L38
ldi R17,>L38
xcall _Print_str
.dbline 146
; Print_int(mp3ReadReg(0X08));
ldi R16,8
xcall _mp3ReadReg
xcall _Print_int
.dbline 147
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline 148
; Print_str("VS1003B_SIHDA1= 0x");
ldi R16,<L39
ldi R17,>L39
xcall _Print_str
.dbline 149
; Print_int(mp3ReadReg(0X09));
ldi R16,9
xcall _mp3ReadReg
xcall _Print_int
.dbline 150
; Print_str("\r\n");
ldi R16,<L33
ldi R17,>L33
xcall _Print_str
.dbline -2
L31:
.dbline 0 ; func end
ret
.dbend
.dbfunc e mp3SineTest _mp3SineTest fV
.even
_mp3SineTest::
sbiw R28,1
.dbline -1
.dbline 153
; }
; void mp3SineTest(void)
; {
.dbline 154
; mp3InRst();
.dbline 154
cbi 0x18,7
.dbline 154
.dbline 154
.dbline 155
; delay_ms(1);
ldi R16,1
xcall _delay_ms
.dbline 156
; spiByte(0xFF);
ldi R16,255
xcall _spiByte
.dbline 157
; mp3OutCmd();
.dbline 157
sbi 0x12,3
.dbline 157
.dbline 157
.dbline 158
; mp3OutData();
.dbline 158
sbi 0x12,2
.dbline 158
.dbline 158
.dbline 159
; mp3OutRst();
.dbline 159
sbi 0x18,7
.dbline 159
.dbline 159
.dbline 160
; delay_ms(100);
ldi R16,100
xcall _delay_ms
.dbline 161
; mp3WriteReg(SPI_MODE,0x08,0x20); //进入测试模式
ldi R24,32
std y+0,R24
ldi R18,8
clr R16
xcall _mp3WriteReg
L41:
.dbline 162
L42:
.dbline 162
; while((PIND & DREQ) == 0);
sbis 0x10,0
rjmp L41
.dbline 163
; mp3InData();
.dbline 163
cbi 0x12,2
.dbline 163
.dbline 163
.dbline 164
; spiByte(0x53);
ldi R16,83
xcall _spiByte
.dbline 165
; spiByte(0xEF);
ldi R16,239
xcall _spiByte
.dbline 166
; spiByte(0x6E);
ldi R16,110
xcall _spiByte
.dbline 167
; spiByte(0x24);
ldi R16,36
xcall _spiByte
.dbline 168
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 169
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 170
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 171
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 172
; mp3OutData();
.dbline 172
sbi 0x12,2
.dbline 172
.dbline 172
.dbline 173
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 174
; delay_ms(250);
ldi R16,250
xcall _delay_ms
L44:
.dbline 176
L45:
.dbline 176
;
; while((PIND & DREQ) == 0);
sbis 0x10,0
rjmp L44
.dbline 177
; mp3InData();
.dbline 177
cbi 0x12,2
.dbline 177
.dbline 177
.dbline 178
; spiByte(0x45);
ldi R16,69
xcall _spiByte
.dbline 179
; spiByte(0x78);
ldi R16,120
xcall _spiByte
.dbline 180
; spiByte(0x69);
ldi R16,105
xcall _spiByte
.dbline 181
; spiByte(0x74);
ldi R16,116
xcall _spiByte
.dbline 182
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 183
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 184
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 185
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 186
; mp3OutData();
.dbline 186
sbi 0x12,2
.dbline 186
.dbline 186
.dbline 187
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 188
; delay_ms(250);
ldi R16,250
xcall _delay_ms
L47:
.dbline 190
L48:
.dbline 190
;
; while((PIND & DREQ) == 0);
sbis 0x10,0
rjmp L47
.dbline 191
; mp3InData();
.dbline 191
cbi 0x12,2
.dbline 191
.dbline 191
.dbline 192
; spiByte(0x53);
ldi R16,83
xcall _spiByte
.dbline 193
; spiByte(0xEF);
ldi R16,239
xcall _spiByte
.dbline 194
; spiByte(0x6E);
ldi R16,110
xcall _spiByte
.dbline 195
; spiByte(0x44);
ldi R16,68
xcall _spiByte
.dbline 196
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 197
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 198
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 199
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 200
; mp3OutData();
.dbline 200
sbi 0x12,2
.dbline 200
.dbline 200
.dbline 201
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 202
; delay_ms(250);
ldi R16,250
xcall _delay_ms
L50:
.dbline 204
L51:
.dbline 204
;
; while((PIND & DREQ) == 0);
sbis 0x10,0
rjmp L50
.dbline 205
; mp3InData();
.dbline 205
cbi 0x12,2
.dbline 205
.dbline 205
.dbline 206
; spiByte(0x45);
ldi R16,69
xcall _spiByte
.dbline 207
; spiByte(0x78);
ldi R16,120
xcall _spiByte
.dbline 208
; spiByte(0x69);
ldi R16,105
xcall _spiByte
.dbline 209
; spiByte(0x74);
ldi R16,116
xcall _spiByte
.dbline 210
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 211
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 212
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 213
; spiByte(0x00);
clr R16
xcall _spiByte
.dbline 214
; mp3OutData();
.dbline 214
sbi 0x12,2
.dbline 214
.dbline 214
.dbline 215
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 216
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline -2
L40:
adiw R28,1
.dbline 0 ; func end
ret
.dbend
.dbfunc e record_init _record_init fV
.even
_record_init::
sbiw R28,1
.dbline -1
.dbline 223
;
; }
; /******************************************************************
; record
; ******************************************************************/
; void record_init(void)
; { //mp3WriteReg(SPI_MODE, 0x58, 0x04); /* Normal SW reset + other bits */
.dbline 225
;
; mp3WriteReg(SPI_BASS, 0x00, 0x00); /* Bass/treble disabled */
clr R2
std y+0,R2
clr R18
ldi R16,2
xcall _mp3WriteReg
.dbline 226
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 227
; mp3WriteReg(SPI_CLOCKF, 0x58, 0x00); /* 2.0x 12.288MHz */
clr R2
std y+0,R2
ldi R18,88
ldi R16,3
xcall _mp3WriteReg
.dbline 228
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 229
; mp3WriteReg(SPI_AICTRL0, 0x00, 12); /* Div -> 12=8kHz 8=12kHz 6=16kHz */
ldi R24,12
std y+0,R24
clr R18
ldi R16,12
xcall _mp3WriteReg
.dbline 230
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 231
; mp3WriteReg(SPI_AICTRL1, 0x00, 0x00); /* Auto gain */
clr R2
std y+0,R2
clr R18
ldi R16,13
xcall _mp3WriteReg
.dbline 232
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline 233
; mp3WriteReg(SPI_MODE, 0x58, 0x04); /* Normal SW reset + other bits */
ldi R24,4
std y+0,R24
ldi R18,88
clr R16
xcall _mp3WriteReg
.dbline 234
; delay_ms(250);
ldi R16,250
xcall _delay_ms
.dbline -2
L53:
adiw R28,1
.dbline 0 ; func end
ret
.dbend
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L39:
.blkb 19
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'S,'I,'H,'D,'A,49,61,32
.byte 48,'x,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L38:
.blkb 20
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'S,'I,'H,'D,'A,48,32,61
.byte 32,48,'x,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L37:
.blkb 18
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'B,'A,'S,'S,32,61,32,48
.byte 'x,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L36:
.blkb 17
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'V,'O,'L,32,61,32,48,'x
.byte 0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L35:
.blkb 20
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'C,'L,'O,'C,'K,'F,32,61
.byte 32,48,'x,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L34:
.blkb 18
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'M,'O,'D,'E,32,61,32,48
.byte 'x,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L33:
.blkb 3
.area idata
.byte 13,10,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
L32:
.blkb 20
.area idata
.byte 'V,'S,49,48,48,51,'B,95,'S,'T,'A,'T,'U,'S,32,61
.byte 32,48,'x,0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\Vs1003\vs1003.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -