📄 i2s_codec.txt
字号:
000002 6980 LDR r0,[r0,#0x18] ; AudioReplay
;;;804 }
000004 4770 BX lr
;;;805
ENDP
000006 0000 DCW 0x0000
|L10.8|
DCD ||.data||
AREA ||i.GetVar_CurrentOutputDevice||, CODE, READONLY, ALIGN=2
GetVar_CurrentOutputDevice PROC
;;;837 *******************************************************************************/
;;;838 u32 GetVar_CurrentOutputDevice(void)
000000 4801 LDR r0,|L11.8|
;;;839 {
;;;840 return CurrentOutputDevice;
000002 6a80 LDR r0,[r0,#0x28] ; CurrentOutputDevice
;;;841 }
000004 4770 BX lr
;;;842
ENDP
000006 0000 DCW 0x0000
|L11.8|
DCD ||.data||
AREA ||i.GetVar_CurrentVolume||, CODE, READONLY, ALIGN=2
GetVar_CurrentVolume PROC
;;;520 *******************************************************************************/
;;;521 u8 GetVar_CurrentVolume(void)
000000 4801 LDR r0,|L12.8|
;;;522 {
;;;523 return CurrentVolume;
000002 7840 LDRB r0,[r0,#1] ; CurrentVolume
;;;524 }
000004 4770 BX lr
;;;525
ENDP
000006 0000 DCW 0x0000
|L12.8|
DCD ||.data||
AREA ||i.GetVar_DataStartAddr||, CODE, READONLY, ALIGN=2
GetVar_DataStartAddr PROC
;;;507 *******************************************************************************/
;;;508 u32 GetVar_DataStartAddr(void)
000000 4801 LDR r0,|L13.8|
;;;509 {
;;;510 return DataStartAddr;
000002 6900 LDR r0,[r0,#0x10] ; DataStartAddr
;;;511 }
000004 4770 BX lr
;;;512
ENDP
000006 0000 DCW 0x0000
|L13.8|
DCD ||.data||
AREA ||i.GetVar_SendDummyData||, CODE, READONLY, ALIGN=2
GetVar_SendDummyData PROC
;;;733 *******************************************************************************/
;;;734 u32 GetVar_SendDummyData(void)
000000 4801 LDR r0,|L14.8|
;;;735 {
;;;736 return SendDummyData;
000002 6a00 LDR r0,[r0,#0x20] ; SendDummyData
;;;737 }
000004 4770 BX lr
;;;738
ENDP
000006 0000 DCW 0x0000
|L14.8|
DCD ||.data||
AREA ||i.GetVar_i2saudiofreq||, CODE, READONLY, ALIGN=2
GetVar_i2saudiofreq PROC
;;;861 *******************************************************************************/
;;;862 u16 GetVar_i2saudiofreq(void)
000000 4801 LDR r0,|L15.8|
;;;863 {
;;;864 return i2saudiofreq;
000002 8880 LDRH r0,[r0,#4] ; i2saudiofreq
;;;865 }
000004 4770 BX lr
;;;866
ENDP
000006 0000 DCW 0x0000
|L15.8|
DCD ||.data||
AREA ||i.I2C_Config||, CODE, READONLY, ALIGN=2
I2C_Config PROC
;;;1025 *******************************************************************************/
;;;1026 static void I2C_Config(void)
000000 b51f PUSH {r0-r4,lr}
;;;1027 {
;;;1028 I2C_InitTypeDef I2C_InitStructure;
;;;1029
;;;1030 /* I2C1 configuration */
;;;1031 I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
000002 2000 MOVS r0,#0
000004 f8ad0000 STRH r0,[sp,#0]
;;;1032 I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
000008 f64b70ff MOV r0,#0xbfff
00000c f8ad0002 STRH r0,[sp,#2]
;;;1033 I2C_InitStructure.I2C_OwnAddress1 = 0x33;
000010 2033 MOVS r0,#0x33
000012 f8ad0004 STRH r0,[sp,#4]
;;;1034 I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
000016 f44f6080 MOV r0,#0x400
00001a f8ad0006 STRH r0,[sp,#6]
;;;1035 I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
00001e 0100 LSLS r0,r0,#4
000020 f8ad0008 STRH r0,[sp,#8]
;;;1036 I2C_InitStructure.I2C_ClockSpeed = 200000;
000024 4803 LDR r0,|L16.52|
;;;1037 I2C_Init(I2C1, &I2C_InitStructure);
000026 9003 STR r0,[sp,#0xc]
000028 4669 MOV r1,sp
00002a 4803 LDR r0,|L16.56|
00002c f7fffffe BL I2C_Init
;;;1038 }
000030 bd1f POP {r0-r4,pc}
;;;1039
ENDP
000032 0000 DCW 0x0000
|L16.52|
DCD 0x00030d40
|L16.56|
DCD 0x40005400
AREA ||i.I2S_CODEC_ControlVolume||, CODE, READONLY, ALIGN=2
I2S_CODEC_ControlVolume PROC
;;;267 *******************************************************************************/
;;;268 u32 I2S_CODEC_ControlVolume(u32 direction, u8 Volume)
000000 b570 PUSH {r4-r6,lr}
;;;269 {
;;;270 u32 counter = 0;
;;;271
;;;272 if (direction == VolumeDirection_HIGH)
;;;273 {
;;;274 /* Check if the volume high limit is reached */
;;;275 if (CurrentVolume < VOLStep)
000002 4d12 LDR r5,|L17.76|
000004 460c MOV r4,r1 ;269
000006 7869 LDRB r1,[r5,#1]
000008 280f CMP r0,#0xf ;272
00000a d108 BNE |L17.30|
00000c 2904 CMP r1,#4
00000e d201 BCS |L17.20|
;;;276 {
;;;277 CurrentVolume = 0;
000010 2000 MOVS r0,#0
000012 e00e B |L17.50|
|L17.20|
;;;278 }
;;;279 else
;;;280 {
;;;281 /* Save the current volume level */
;;;282 CurrentVolume = CODEC_ReadRegister(0x0A) - Volume;
000014 200a MOVS r0,#0xa
000016 f7fffffe BL CODEC_ReadRegister
00001a 1b00 SUBS r0,r0,r4
00001c e009 B |L17.50|
|L17.30|
;;;283 }
;;;284
;;;285 /* Set the new volume */
;;;286 counter += CODEC_WriteRegister(0x0A, CurrentVolume);
;;;287 }
;;;288 else if (direction == VolumeDirection_LOW)
00001e 280a CMP r0,#0xa
000020 d10a BNE |L17.56|
;;;289 {
;;;290 /* Check if the volume low limit is reached */
;;;291 if (CurrentVolume > (0xFF - VOLStep))
000022 29fb CMP r1,#0xfb
000024 d901 BLS |L17.42|
;;;292 {
;;;293 CurrentVolume = 0xFF;
000026 20ff MOVS r0,#0xff
000028 e003 B |L17.50|
|L17.42|
;;;294 }
;;;295 else
;;;296 {
;;;297 /* Save the current volume level */
;;;298 CurrentVolume = CODEC_ReadRegister(0x0A) + Volume;
00002a 200a MOVS r0,#0xa
00002c f7fffffe BL CODEC_ReadRegister
000030 4420 ADD r0,r0,r4
|L17.50|
000032 7068 STRB r0,[r5,#1]
000034 b2c1 UXTB r1,r0 ;286
000036 e002 B |L17.62|
|L17.56|
;;;299 }
;;;300
;;;301 /* Set the new volume */
;;;302 counter += CODEC_WriteRegister(0x0A, CurrentVolume);
;;;303 }
;;;304 else if (direction == VolumeDirection_LEVEL)
000038 b930 CBNZ r0,|L17.72|
;;;305 {
;;;306 CurrentVolume = Volume;
00003a 706c STRB r4,[r5,#1]
;;;307
;;;308 /* Set the new volume */
;;;309 counter += CODEC_WriteRegister(0x0A, Volume);
00003c 4621 MOV r1,r4
|L17.62|
00003e e8bd4070 POP {r4-r6,lr}
000042 200a MOVS r0,#0xa
000044 f7ffbffe B.W CODEC_WriteRegister
|L17.72|
;;;310 }
;;;311 else
;;;312 {
;;;313 return 0xFF; //Error verifying the Codec registers
000048 20ff MOVS r0,#0xff
;;;314 }
;;;315
;;;316 return counter;
;;;317 }
00004a bd70 POP {r4-r6,pc}
;;;318
ENDP
|L17.76|
DCD ||.data||
AREA ||i.I2S_CODEC_DataTransfer||, CODE, READONLY, ALIGN=2
I2S_CODEC_DataTransfer PROC
;;;1611 *******************************************************************************/
;;;1612 void I2S_CODEC_DataTransfer(void)
000000 b510 PUSH {r4,lr}
000002 480d LDR r0,|L18.56|
000004 6a01 LDR r1,[r0,#0x20] ; SendDummyData
;;;1613 {
;;;1614 /* Audio codec configuration section -------------------------------------*/
;;;1615 if (GetVar_SendDummyData() == 1)
;;;1616 {
;;;1617 /* Send a dummy data just to generate the I2S clock */
;;;1618 SPI_I2S_SendData(SPI2, DUMMY_DATA);
000006 4c0d LDR r4,|L18.60|
000008 2901 CMP r1,#1 ;1615
00000a d106 BNE |L18.26|
00000c 4620 MOV r0,r4
00000e e8bd4010 POP {r4,lr}
000012 f2411111 MOV r1,#0x1111
000016 f7ffbffe B.W SPI_I2S_SendData
|L18.26|
;;;1619 }
;;;1620 /* Audio codec communication section -------------------------------------*/
;;;1621 else
;;;1622 {
;;;1623 /* Send the data read from the memory */
;;;1624 SPI_I2S_SendData(SPI2, (Media_ReadHalfWord(AudioDataIndex)));
00001a 6940 LDR r0,[r0,#0x14] ; AudioDataIndex
00001c f7fffffe BL Media_ReadHalfWord
000020 4601 MOV r1,r0
000022 4620 MOV r0,r4
000024 f7fffffe BL SPI_I2S_SendData
;;;1625
;;;1626 /* Increment the index */
;;;1627 IncrementVar_AudioDataIndex(WAVE_Format.NumChannels);
000028 4805 LDR r0,|L18.64|
00002a 88c0 LDRH r0,[r0,#6] ; WAVE_Format
00002c f7fffffe BL IncrementVar_AudioDataIndex
;;;1628
;;;1629 /* Check and update the stream playing status */
;;;1630 I2S_CODEC_UpdateStatus();
000030 e8bd4010 POP {r4,lr}
000034 f7ffbffe B.W I2S_CODEC_UpdateStatus
;;;1631 }
;;;1632 }
;;;1633 /*******************************************************************************
ENDP
|L18.56|
DCD ||.data||
|L18.60|
DCD 0x40003800
|L18.64|
DCD ||.bss||+0x64
AREA ||i.I2S_CODEC_ForwardPlay||, CODE, READONLY, ALIGN=2
I2S_CODEC_ForwardPlay PROC
;;;353 *******************************************************************************/
;;;354 void I2S_CODEC_ForwardPlay(u32 Step)
000000 b510 PUSH {r4,lr}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -