⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 waveplayer.txt

📁 stm32.rar
💻 TXT
📖 第 1 页 / 共 4 页
字号:
000020  4856              LDR      r0,|L4.380|
000022  f7fffffe          BL       LCD_Update
;;;79     
;;;80     #if STM3210E
;;;81       /* Choose number of repetitions: 0 => infinite repetitions */
;;;82       I2S_CODEC_ReplayConfig(0);
;;;83       I2S_CODEC_Init(OutputDevice_SPEAKER, AUDIO_FILE_ADDRESS);
;;;84     #else
;;;85       DAC_CODEC_Init(AUDIO_FILE_ADDRESS);
000026  2000              MOVS     r0,#0
000028  f7fffffe          BL       DAC_CODEC_Init
00002c  f44f3880          MOV      r8,#0x10000
000030  f44f7980          MOV      r9,#0x100
000034  f04f7a80          MOV      r10,#0x1000000
                  |L4.56|
;;;86     #endif
;;;87     
;;;88       /* Endless loop */
;;;89       while(1)
;;;90       {
;;;91         /* Check which key is pressed */
;;;92         MyKey = ReadKey();
000038  f7fffffe          BL       ReadKey
00003c  4604              MOV      r4,r0
;;;93         
;;;94         if(Counter == 0)
00003e  b945              CBNZ     r5,|L4.82|
;;;95         { /* Mask All Interrupts */
;;;96           NVIC_SETPRIMASK();
000040  f7fffffe          BL       NVIC_SETPRIMASK
;;;97           /* Update the displayed progression information */
;;;98           LCD_Update(PROGRESS);
000044  f44f5080          MOV      r0,#0x1000
000048  f7fffffe          BL       LCD_Update
;;;99           Counter = 0x5FFFF;
00004c  4d4c              LDR      r5,|L4.384|
;;;100          /* Disable mask of all interrupts */
;;;101          NVIC_RESETPRIMASK();
00004e  f7fffffe          BL       NVIC_RESETPRIMASK
                  |L4.82|
;;;102        }
;;;103        Counter--;
000052  1e6d              SUBS     r5,r5,#1
;;;104        /* If "UP" pushbutton is pressed */
;;;105        if(MyKey == UP)
000054  2c04              CMP      r4,#4
000056  d117              BNE      |L4.136|
;;;106        {
;;;107          /* Mask All Interrupts */
;;;108          NVIC_SETPRIMASK();
000058  f7fffffe          BL       NVIC_SETPRIMASK
;;;109          /* Check if the Codec is PLAYING audio file */
;;;110          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
00005c  f7fffffe          BL       GetVar_AudioPlayStatus
000060  2801              CMP      r0,#1
000062  d11f              BNE      |L4.164|
;;;111          {
;;;112    #if STM3210E
;;;113            I2S_CODEC_ControlVolume(VolumeDirection_HIGH, VOLStep);
;;;114    #else
;;;115            DAC_CODEC_ControlVolume(VolumeDirection_HIGH, VOLStep);
000064  2104              MOVS     r1,#4
000066  200f              MOVS     r0,#0xf
;;;116    #endif
;;;117    
;;;118            /* Update the display information */
;;;119            LCD_Update(VOL);
000068  e018              B        |L4.156|
                  |L4.106|
;;;120          }
;;;121          /* UP bottomn pushed in PAUSE mode => Enable the Speaker device output ---*/
;;;122          else
;;;123          {
;;;124            /* Update the display information */
;;;125            LCD_Update(PLAY);
;;;126    
;;;127    #if STM3210E
;;;128            /* Configure the Speaker as output and reinitialize all devices */
;;;129            err = I2S_CODEC_SpeakerHeadphoneSwap(OutputDevice_SPEAKER, AUDIO_FILE_ADDRESS);
;;;130    #else
;;;131    #endif
;;;132      
;;;133            /* Error message display if failure */
;;;134            if (err != 0)
;;;135            {
;;;136              LCD_DisplayError(err);
00006a  4630              MOV      r0,r6
00006c  f7fffffe          BL       LCD_DisplayError
;;;137    
;;;138              /* Enable the FSMC that share a pin w/ I2C1 (LBAR) */
;;;139              RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
000070  2101              MOVS     r1,#1
000072  4648              MOV      r0,r9
000074  f7fffffe          BL       RCC_AHBPeriphClockCmd
;;;140    
;;;141              /* Clear the LCD */
;;;142              LCD_Clear(White);
000078  4638              MOV      r0,r7
00007a  f7fffffe          BL       LCD_Clear
;;;143    
;;;144              /* Display the previous menu */
;;;145              DisplayMenu();
00007e  f7fffffe          BL       DisplayMenu
;;;146    
;;;147              /* Disable mask of all interrupts */
;;;148              NVIC_RESETPRIMASK();
000082  f7fffffe          BL       NVIC_RESETPRIMASK
;;;149    
;;;150              /* Enable the JoyStick interrupts */
;;;151              IntExtOnOffConfig(ENABLE); 
;;;152              return; 
000086  e049              B        |L4.284|
                  |L4.136|
;;;153            }      
;;;154          } 
;;;155          /* Disable mask of all interrupts */
;;;156          NVIC_RESETPRIMASK();
;;;157        }
;;;158    
;;;159        /* If "DOWN" pushbutton is pressed */
;;;160        if(MyKey == DOWN)
000088  2c05              CMP      r4,#5
00008a  d111              BNE      |L4.176|
;;;161        {
;;;162          /* Mask All Interrupts */
;;;163          NVIC_SETPRIMASK();
00008c  f7fffffe          BL       NVIC_SETPRIMASK
;;;164    
;;;165          /* If the Codec is PLAYING => Decrease Volume*/
;;;166          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
000090  f7fffffe          BL       GetVar_AudioPlayStatus
000094  2801              CMP      r0,#1
000096  d105              BNE      |L4.164|
;;;167          {
;;;168    #if STM3210E
;;;169            /* Increase the audio codec digital volume */
;;;170            I2S_CODEC_ControlVolume(VolumeDirection_LOW, VOLStep);
;;;171    #else
;;;172            DAC_CODEC_ControlVolume(VolumeDirection_LOW, VOLStep);
000098  2104              MOVS     r1,#4
00009a  200a              MOVS     r0,#0xa
                  |L4.156|
00009c  f7fffffe          BL       DAC_CODEC_ControlVolume
;;;173    #endif
;;;174    
;;;175            /* Update the LCD display */ 
;;;176            LCD_Update(VOL); 
0000a0  4640              MOV      r0,r8
0000a2  e011              B        |L4.200|
                  |L4.164|
;;;177          }
;;;178          else /* If the Codec is PAUSED => Headphone Enable */
;;;179          {
;;;180            /* Update the LCD display */ 
;;;181            LCD_Update(PLAY);
0000a4  4650              MOV      r0,r10
0000a6  f7fffffe          BL       LCD_Update
;;;182          
;;;183    #if STM3210E
;;;184            /* Enable the Headphone output and reinitialize all devices */ 
;;;185            err = I2S_CODEC_SpeakerHeadphoneSwap(OutputDevice_HEADPHONE, AUDIO_FILE_ADDRESS);
;;;186    #endif
;;;187    
;;;188            /* Error message display if failure */
;;;189            if (err != 0)
0000aa  2e00              CMP      r6,#0
                  |L4.172|
0000ac  d1dd              BNE      |L4.106|
0000ae  e01b              B        |L4.232|
                  |L4.176|
;;;190            {
;;;191              LCD_DisplayError(err);
;;;192    
;;;193              /* Enable the FSMC that share a pin w/ I2C1 (LBAR) */
;;;194              RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
;;;195    
;;;196              /* Clear the LCD */
;;;197              LCD_Clear(White);
;;;198    
;;;199              /* Display the previous menu */
;;;200              DisplayMenu();
;;;201    
;;;202              /* Disable mask of all interrupts */
;;;203              NVIC_RESETPRIMASK();
;;;204    
;;;205              /* Enable the JoyStick interrupts */
;;;206              IntExtOnOffConfig(ENABLE); 
;;;207              return; 
;;;208            }  
;;;209          }
;;;210          /* Disable mask of all interrupts */
;;;211          NVIC_RESETPRIMASK();
;;;212        }
;;;213    
;;;214        /* If "RIGHT" pushbutton is pressed */
;;;215        if(MyKey == RIGHT)
0000b0  2c02              CMP      r4,#2
0000b2  d10c              BNE      |L4.206|
;;;216        {
;;;217          /* Mask All Interrupts */
;;;218          NVIC_SETPRIMASK();
0000b4  f7fffffe          BL       NVIC_SETPRIMASK
;;;219    
;;;220          /* Check if the Codec is PLAYING audio file */
;;;221          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
0000b8  f7fffffe          BL       GetVar_AudioPlayStatus
0000bc  2801              CMP      r0,#1
0000be  d113              BNE      |L4.232|
;;;222          {
;;;223    #if STM3210E
;;;224            I2S_CODEC_ForwardPlay(STEP_FORWARD); 
;;;225    #else
;;;226            DAC_CODEC_ForwardPlay(STEP_FORWARD); 
0000c0  2002              MOVS     r0,#2
0000c2  f7fffffe          BL       DAC_CODEC_ForwardPlay
;;;227    #endif
;;;228            /* Update the display information */
;;;229            LCD_Update(FRWD); 
0000c6  e00d              B        |L4.228|
                  |L4.200|
0000c8  f7fffffe          BL       LCD_Update
0000cc  e00c              B        |L4.232|
                  |L4.206|
;;;230          }
;;;231          /* Disable mask of all interrupts */
;;;232          NVIC_RESETPRIMASK(); 
;;;233        }
;;;234        /* If "LEFT" pushbutton is pressed */
;;;235        if(MyKey == LEFT)
0000ce  2c03              CMP      r4,#3
0000d0  d10d              BNE      |L4.238|
;;;236        {
;;;237          /* Mask All Interrupts */
;;;238          NVIC_SETPRIMASK();
0000d2  f7fffffe          BL       NVIC_SETPRIMASK
;;;239    
;;;240          /* Check if the Codec is PLAYING audio file */
;;;241          if (GetVar_AudioPlayStatus() == AudioPlayStatus_PLAYING)
0000d6  f7fffffe          BL       GetVar_AudioPlayStatus
0000da  2801              CMP      r0,#1
0000dc  d104              BNE      |L4.232|
;;;242          {
;;;243    #if STM3210E
;;;244            I2S_CODEC_RewindPlay(STEP_BACK);
;;;245    #else
;;;246            DAC_CODEC_RewindPlay(STEP_BACK);
0000de  2006              MOVS     r0,#6
0000e0  f7fffffe          BL       DAC_CODEC_RewindPlay
                  |L4.228|
;;;247    #endif
;;;248            /* Update the display information */
;;;249            LCD_Update(FRWD);  
0000e4  4648              MOV      r0,r9
0000e6  e7ef              B        |L4.200|
                  |L4.232|
;;;250          } 
;;;251          /* Disable mask of all interrupts */
;;;252          NVIC_RESETPRIMASK();
0000e8  f7fffffe          BL       NVIC_RESETPRIMASK
0000ec  e7a4              B        |L4.56|
                  |L4.238|
;;;253        }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -