📄 ac97.txt
字号:
000c0c e3a0344a MOV r3,#0x4a000000
000c10 e5832000 STR r2,[r3,#0]
000c14 e3a02f80 MOV r2,#0x200
000c18 e3a0344a MOV r3,#0x4a000000
000c1c e5832010 STR r2,[r3,#0x10]
000c20 e3a0244a MOV r2,#0x4a000000
000c24 e5922010 LDR r2,[r2,#0x10]
;;;1319
;;;1320 rINTSUBMSK &= ~(BIT_SUB_AC97);
000c28 e3a0244a MOV r2,#0x4a000000
000c2c e592201c LDR r2,[r2,#0x1c]
000c30 e3c22c40 BIC r2,r2,#0x4000
000c34 e3a0344a MOV r3,#0x4a000000
000c38 e583201c STR r2,[r3,#0x1c]
;;;1321 rINTMSK &= ~(BIT_WDT_AC97);
000c3c e3a0244a MOV r2,#0x4a000000
000c40 e5922008 LDR r2,[r2,#8]
000c44 e3c22f80 BIC r2,r2,#0x200
000c48 e3a0344a MOV r3,#0x4a000000
000c4c e5832008 STR r2,[r3,#8]
;;;1322 }
000c50 e8bd100f LDMFD sp!,{r0-r3,r12}
000c54 e25ef004 SUBS pc,lr,#4
ENDP
AC97_PCMout_INT PROC
;;;867 void AC97_PCMout_INT(U32 PCM_Size)
;;;868 {
000c58 e92d4010 STMFD sp!,{r4,lr}
000c5c e1a04000 MOV r4,r0
;;;869 //Record AC97_BUF initialize
;;;870 Rec_AC97_BUF = (U32 *)(DOWN_BUF);
000c60 e3a005c4 MOV r0,#0x31000000
000c64 e59f1220 LDR r1,|L1.3724|
000c68 e5810000 STR r0,[r1,#0] ; Rec_AC97_BUF
;;;871 Play_AC97_BUF = (Rec_AC97_BUF + 0x30);
000c6c e59f0218 LDR r0,|L1.3724|
000c70 e5900000 LDR r0,[r0,#0] ; Rec_AC97_BUF
000c74 e28000c0 ADD r0,r0,#0xc0
000c78 e51f1248 LDR r1,|L1.2616|
000c7c e5810000 STR r0,[r1,#0] ; Play_AC97_BUF
;;;872 End_AC97_BUF = (Rec_AC97_BUF + 0x30 + PCM_Size/4);
000c80 e1a00124 MOV r0,r4,LSR #2
000c84 e59f1200 LDR r1,|L1.3724|
000c88 e5911000 LDR r1,[r1,#0] ; Rec_AC97_BUF
000c8c e0810100 ADD r0,r1,r0,LSL #2
000c90 e28000c0 ADD r0,r0,#0xc0
000c94 e59f11e8 LDR r1,|L1.3716|
000c98 e5810000 STR r0,[r1,#0] ; End_AC97_BUF
;;;873
;;;874 //IRQ Initialization
;;;875 pISR_WDT_AC97= (unsigned)Irq_AC97_PCMout;
000c9c e59f01ec LDR r0,|L1.3728|
000ca0 e51f1280 LDR r1,|L1.2600|
000ca4 e5810f44 STR r0,[r1,#0xf44]
;;;876
;;;877 Uart_Printf("\nConnect Head Phone Line In to CON21 on SMDK2442 and Press any key.\n");
000ca8 e59f01e4 LDR r0,|L1.3732|
000cac ebfffffe BL Uart_Printf
;;;878 Uart_Getch();
000cb0 ebfffffe BL Uart_Getch
;;;879 Uart_Printf("\nNow Play...\n");
000cb4 e24f0f9d ADR r0,|L1.2632|
000cb8 ebfffffe BL Uart_Printf
;;;880 Uart_Printf("Headphone Volume Register = 0x%x\n", Output_Volume);
000cbc e51f05a8 LDR r0,|L1.1820|
000cc0 e5901000 LDR r1,[r0,#0] ; Output_Volume
000cc4 e24f0f76 ADR r0,|L1.2804|
000cc8 ebfffffe BL Uart_Printf
;;;881
;;;882 ClearPending(BIT_WDT_AC97);
000ccc e3a00f80 MOV r0,#0x200
000cd0 e3a0144a MOV r1,#0x4a000000
000cd4 e5810000 STR r0,[r1,#0]
000cd8 e3a00f80 MOV r0,#0x200
000cdc e3a0144a MOV r1,#0x4a000000
000ce0 e5810010 STR r0,[r1,#0x10]
000ce4 e3a0044a MOV r0,#0x4a000000
000ce8 e5900010 LDR r0,[r0,#0x10]
;;;883 rSUBSRCPND=(BIT_SUB_AC97);
000cec e3a00c40 MOV r0,#0x4000
000cf0 e3a0144a MOV r1,#0x4a000000
000cf4 e5810018 STR r0,[r1,#0x18]
;;;884
;;;885 rINTMSK=~(BIT_WDT_AC97);
000cf8 e3e00f80 MVN r0,#0x200
000cfc e3a0144a MOV r1,#0x4a000000
000d00 e5810008 STR r0,[r1,#8]
;;;886 rINTSUBMSK=~(BIT_SUB_AC97);
000d04 e3e00c40 MVN r0,#0x4000
000d08 e3a0144a MOV r1,#0x4a000000
000d0c e581001c STR r0,[r1,#0x1c]
;;;887
;;;888 rAC_GLBCTRL = 0x4100C; //PCM Out channel threshold INT enable, PIO Mode On
000d10 e59f0180 LDR r0,|L1.3736|
000d14 e3a0145b MOV r1,#0x5b000000
000d18 e5810000 STR r0,[r1,#0]
;;;889
;;;890 while(1)
000d1c e1a00000 NOP
|L1.3360|
000d20 e1a00000 NOP
;;;891 {
;;;892 if(PCM_Out_INT_Exit == 1)
000d24 e59f015c LDR r0,|L1.3720|
000d28 e1d000f0 LDRSH r0,[r0,#0] ; PCM_Out_INT_Exit
000d2c e3500001 CMP r0,#1
000d30 1a000000 BNE |L1.3384|
;;;893 break;
000d34 ea000000 B |L1.3388|
;;;894 }
|L1.3384|
000d38 eafffff8 B |L1.3360|
;;;895
;;;896 rAC_GLBCTRL &= ~(1<<12); //PCM Out Transfer PIO Mode Off
|L1.3388|
000d3c e3a0045b MOV r0,#0x5b000000
000d40 e5900000 LDR r0,[r0,#0]
000d44 e3c00d40 BIC r0,r0,#0x1000
000d48 e3a0145b MOV r1,#0x5b000000
000d4c e5810000 STR r0,[r1,#0]
;;;897
;;;898 rINTSUBMSK|=(BIT_SUB_WDT|BIT_SUB_AC97);
000d50 e3a0044a MOV r0,#0x4a000000
000d54 e590001c LDR r0,[r0,#0x1c]
000d58 e3800c60 ORR r0,r0,#0x6000
000d5c e3a0144a MOV r1,#0x4a000000
000d60 e581001c STR r0,[r1,#0x1c]
;;;899 rINTMSK|=(BIT_WDT_AC97);
000d64 e3a0044a MOV r0,#0x4a000000
000d68 e5900008 LDR r0,[r0,#8]
000d6c e3800f80 ORR r0,r0,#0x200
000d70 e3a0144a MOV r1,#0x4a000000
000d74 e5810008 STR r0,[r1,#8]
;;;900
;;;901 Uart_Printf("\nEnd of Play!\n");
000d78 e24f0f98 ADR r0,|L1.2848|
000d7c ebfffffe BL Uart_Printf
;;;902 }
000d80 e8bd8010 LDMFD sp!,{r4,pc}
ENDP
AC97_CodecInit_PCMOut PROC
;;;620 void AC97_CodecInit_PCMOut( U16 AC97_fs)
;;;621 {
000d84 e92d4038 STMFD sp!,{r3-r5,lr}
000d88 e1a04000 MOV r4,r0
;;;622
;;;623 AC97_Codec_Cmd(0,0x00,0x683F); //codec soft reset
000d8c e59f2108 LDR r2,|L1.3740|
000d90 e3a01000 MOV r1,#0
000d94 e3a00000 MOV r0,#0
000d98 ebfffffe BL AC97_Codec_Cmd
;;;624
;;;625 AC97_Codec_Cmd(0,0x2A,0x0001); //variable rate enable
000d9c e3a02001 MOV r2,#1
000da0 e3a0102a MOV r1,#0x2a
000da4 e3a00000 MOV r0,#0
000da8 ebfffffe BL AC97_Codec_Cmd
;;;626 //Uart_Printf("\nVRA Enable(1)/Disable(0): 0x%x\n", (0x1&AC97_Codec_Cmd(1,0x2A,0x0001)));
;;;627
;;;628 if(AC97_fs==48000){
000dac e244cc80 SUB r12,r4,#0x8000
000db0 e25ccdee SUBS r12,r12,#0x3b80
000db4 1a000004 BNE |L1.3532|
;;;629 //DAC Sampling frequency 48kHz
;;;630 AC97_Codec_Cmd(0,0x2C,0xbb80);
000db8 e59f20e0 LDR r2,|L1.3744|
000dbc e3a0102c MOV r1,#0x2c
000dc0 e3a00000 MOV r0,#0
000dc4 ebfffffe BL AC97_Codec_Cmd
000dc8 ea00000e B |L1.3592|
;;;631 }
;;;632 else if(AC97_fs==44100){
|L1.3532|
000dcc e244ccac SUB r12,r4,#0xac00
000dd0 e25cc044 SUBS r12,r12,#0x44
000dd4 1a000004 BNE |L1.3564|
;;;633 //DAC Sampling frequency 44.1kHz
;;;634 AC97_Codec_Cmd(0,0x2C,0xac44);
000dd8 e59f20c4 LDR r2,|L1.3748|
000ddc e3a0102c MOV r1,#0x2c
000de0 e3a00000 MOV r0,#0
000de4 ebfffffe BL AC97_Codec_Cmd
000de8 ea000006 B |L1.3592|
;;;635 }
;;;636 else if(AC97_fs==22050){
|L1.3564|
000dec e244cc56 SUB r12,r4,#0x5600
000df0 e25cc022 SUBS r12,r12,#0x22
000df4 1a000003 BNE |L1.3592|
;;;637 //DAC Sampling frequency 22.05kHz
;;;638 AC97_Codec_Cmd(0,0x2C,0x5622);
000df8 e59f20a8 LDR r2,|L1.3752|
000dfc e3a0102c MOV r1,#0x2c
000e00 e3a00000 MOV r0,#0
000e04 ebfffffe BL AC97_Codec_Cmd
;;;639 }
;;;640
;;;641 AC97_Codec_Cmd(0,0x26, (1<<8)); // all power on except ADC blcok
|L1.3592|
000e08 e3a02f40 MOV r2,#0x100
000e0c e3a01026 MOV r1,#0x26
000e10 e3a00000 MOV r0,#0
000e14 ebfffffe BL AC97_Codec_Cmd
;;;642 Uart_Printf("AC97 Codec 0x26 Reg.: 0x%x\n\n", AC97_Codec_Cmd(1,0x26,0x0000));
000e18 e3a02000 MOV r2,#0
000e1c e3a01026 MOV r1,#0x26
000e20 e3a00001 MOV r0,#1
000e24 ebfffffe BL AC97_Codec_Cmd
000e28 e1a05000 MOV r5,r0
000e2c e1a01000 MOV r1,r0
000e30 e28f0074 ADR r0,|L1.3756|
000e34 ebfffffe BL Uart_Printf
;;;643
;;;644 AC97_Codec_Cmd(0,0x18,0x0000); // PCM out volume on
000e38 e3a02000 MOV r2,#0
000e3c e3a01018 MOV r1,#0x18
000e40 e3a00000 MOV r0,#0
000e44 ebfffffe BL AC97_Codec_Cmd
;;;645 AC97_Codec_Cmd(0,0x20,0x0000); // general purpose
000e48 e3a02000 MOV r2,#0
000e4c e3a01020 MOV r1,#0x20
000e50 e3a00000 MOV r0,#0
000e54 ebfffffe BL AC97_Codec_Cmd
;;;646 AC97_Codec_Cmd(0,0x04,0x1A1A); // Aux out(HP out) volume on
000e58 e59f206c LDR r2,|L1.3788|
000e5c e3a01004 MOV r1,#4
000e60 e3a00000 MOV r0,#0
000e64 ebfffffe BL AC97_Codec_Cmd
;;;647
;;;648 Output_Volume = AC97_Codec_Cmd(1,0x04,0x00000); //HP out volume
000e68 e3a02000 MOV r2,#0
000e6c e3a01004 MOV r1,#4
000e70 e3a00001 MOV r0,#1
000e74 ebfffffe BL AC97_Codec_Cmd
000e78 e51f1764 LDR r1,|L1.1820|
000e7c e5810000 STR r0,[r1,#0] ; Output_Volume
;;;649 }
000e80 e8bd8038 LDMFD sp!,{r3-r5,pc}
|L1.3716|
000e84 0000002c DCD ||.bss$2|| + 44
|L1.3720|
000e88 00000000 DCD ||.bss$2||
|L1.3724|
000e8c 00000024 DCD ||.bss$2|| + 36
|L1.3728|
000e90 00000000 DCD Irq_AC97_PCMout
|L1.3732|
000e94 00000124 DCD ||.constdata$1|| + 292
|L1.3736|
000e98 0004100c DCD 0x0004100c
|L1.3740|
000e9c 0000683f DCD 0x0000683f
|L1.3744|
000ea0 0000bb80 DCD 0x0000bb80
|L1.3748|
000ea4 0000ac44 DCD 0x0000ac44
|L1.3752|
000ea8 00005622 DCD 0x00005622
|L1.3756|
000eac 37394341 DCB "AC97"
000eb0 646f4320 DCB " Cod"
000eb4 30206365 DCB "ec 0"
000eb8 20363278 DCB "x26 "
000ebc 2e676552 DCB "Reg."
000ec0 7830203a DCB ": 0x"
000ec4 0a0a7825 DCB "%x\n\n"
000ec8 00000000 DCB "\0\0\0\0"
|L1.3788|
000ecc 00001a1a DCD 0x00001a1a
ENDP
Delay_Init PROC
;;;1248 void Delay_Init(void)
;;;1249 {
000ed0 e92d4008 STMFD sp!,{r3,lr}
;;;1250 Delay(0); //Delay Time Resolution => 100us Adjust
000ed4 e3a00000 MOV r0,#0
000ed8 ebfffffe BL Delay
;;;1251 Delay_After_CommandWrite(0); //Delay Time Resolution => 30us Adjust
000edc e3a00000 MOV r0,#0
000ee0 ebfffffe BL Delay_After_CommandWrite
;;;1252 }
000ee4 e8bd8008 LDMFD sp!,{r3,pc}
ENDP
AC97_Codec_Ready PROC
;;;1255 void __irq AC97_Codec_Ready(void)
;;;1256 {
000ee8 e92d500f STMFD sp!,{r0-r3,r12,lr}
;;;1257 Delay_Init();
000eec ebfffffe BL Delay_Init
;;;1258
;;;1259 if ( (rAC_GLBSTAT& 0x400000))
000ef0 e3a0045b MOV r0,#0x5b000000
000ef4 e5900004 LDR r0,[r0,#4]
000ef8 e3100840 TST r0,#0x400000
000efc 0a000009 BEQ |L1.3880|
;;;1260 {
;;;1261 Codec_Ready_Irq=1;
000f00 e3a00001 MOV r0,#1
000f04 e59f1078 LDR r1,|L1.3972|
000f08 e5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -