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

📄 main.txt

📁 stm32.rar
💻 TXT
📖 第 1 页 / 共 3 页
字号:
;;;123    
;;;124      /* Enable GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG and AFIO clocks */
;;;125      RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |RCC_APB2Periph_GPIOC 
000064  2101              MOVS     r1,#1
000066  f24010fd          MOV      r0,#0x1fd
00006a  f7fffffe          BL       RCC_APB2PeriphClockCmd
;;;126             | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE | RCC_APB2Periph_GPIOF | RCC_APB2Periph_GPIOG 
;;;127             | RCC_APB2Periph_AFIO, ENABLE);
;;;128      
;;;129      /* TIM1 Periph clock enable */
;;;130      RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE);
00006e  2101              MOVS     r1,#1
000070  02c8              LSLS     r0,r1,#11
000072  f7fffffe          BL       RCC_APB2PeriphClockCmd
;;;131     
;;;132    /*------------------- Resources Initialization -----------------------------*/
;;;133      /* GPIO Configuration */
;;;134      GPIO_Config();
000076  f7fffffe          BL       GPIO_Config
;;;135    
;;;136      /* Interrupt Configuration */
;;;137      InterruptConfig();
00007a  f7fffffe          BL       InterruptConfig
;;;138    
;;;139      /* Configure the systick */    
;;;140      SysTick_Config();
00007e  f7fffffe          BL       SysTick_Config
;;;141    
;;;142    /*------------------- Drivers Initialization -------------------------------*/
;;;143      /* Initialize the LEDs toogling */
;;;144      LedShow_Init();
000082  f7fffffe          BL       LedShow_Init
;;;145    
;;;146      /* Initialize the Low Power application */
;;;147      //LowPower_Init();
;;;148    
;;;149      /* Initialize the LCD */
;;;150      STM3210E_LCD_Init();
000086  f7fffffe          BL       STM3210E_LCD_Init
;;;151    
;;;152      /* Clear the LCD */ 
;;;153      LCD_Clear(White);
00008a  f64f75ff          MOV      r5,#0xffff
00008e  4628              MOV      r0,r5
000090  f7fffffe          BL       LCD_Clear
;;;154      
;;;155      /* If HSE is not detected at program startup */
;;;156      if(HSEStartUpStatus == ERROR)
000094  7820              LDRB     r0,[r4,#0]  ; HSEStartUpStatus
000096  b910              CBNZ     r0,|L8.158|
;;;157      {
;;;158        /* Generate NMI exception */
;;;159        NVIC_SetSystemHandlerPendingBit(SystemHandler_NMI);
000098  201f              MOVS     r0,#0x1f
00009a  f7fffffe          BL       NVIC_SetSystemHandlerPendingBit
                  |L8.158|
;;;160      }  
;;;161       
;;;162    #ifndef STM3210E
;;;163      /* Initialize the SPI FLASH driver */
;;;164      SPI_FLASH_Init();
00009e  f7fffffe          BL       SPI_FLASH_Init
;;;165    #endif
;;;166     
;;;167    	  /* Checks the availability of the bitmap files */
;;;168      CheckBitmapFilesStatus();
0000a2  f7fffffe          BL       CheckBitmapFilesStatus
;;;169      
;;;170      /* Display the STM32 introduction */
;;;171      STM32Intro();
0000a6  f7fffffe          BL       STM32Intro
;;;172    
;;;173      /* Clear the LCD */ 
;;;174      LCD_Clear(White);
0000aa  4628              MOV      r0,r5
0000ac  f7fffffe          BL       LCD_Clear
;;;175    
;;;176      /* Initialize the Calendar */
;;;177      Calendar_Init();
0000b0  f7fffffe          BL       Calendar_Init
;;;178    
;;;179      /* Enable Leds toggling */
;;;180      LedShow(ENABLE);
0000b4  2001              MOVS     r0,#1
0000b6  f7fffffe          BL       LedShow
;;;181      
;;;182      /* Initialize the Low Power application*/ 
;;;183      LowPower_Init();
0000ba  f7fffffe          BL       LowPower_Init
;;;184    
;;;185      /* Set the LCD Back Color */
;;;186      LCD_SetBackColor(Blue);
0000be  201f              MOVS     r0,#0x1f
0000c0  f7fffffe          BL       LCD_SetBackColor
;;;187    
;;;188      /* Set the LCD Text Color */
;;;189      LCD_SetTextColor(White);
0000c4  4628              MOV      r0,r5
0000c6  f7fffffe          BL       LCD_SetTextColor
;;;190    
;;;191      //LCD_DisplayStringLine(Line2, "files. Demo can't be");
;;;192      
;;;193      /* Initialize the Menu */
;;;194      Menu_Init();
0000ca  f7fffffe          BL       Menu_Init
;;;195    
;;;196      /* Display the main menu icons */
;;;197      ShowMenuIcons();
0000ce  e8bd4070          POP      {r4-r6,lr}
0000d2  f7ffbffe          B.W      ShowMenuIcons
;;;198    }
;;;199    
                          ENDP

0000d6  0000              DCW      0x0000
                  |L8.216|
0000d8  00000000          DCD      ||.data||

                          AREA ||i.main||, CODE, READONLY, ALIGN=2

                  main PROC
;;;40     int main(void)
;;;41     {
000000  b570              PUSH     {r4-r6,lr}
;;;42     #ifdef DEBUG
;;;43       debug();
;;;44     #endif
;;;45     
;;;46       /* Initialize the Demo */
;;;47       Demo_Init();
000002  f7fffffe          BL       Demo_Init
000006  4c07              LDR      r4,|L9.36|
000008  2500              MOVS     r5,#0
                  |L9.10|
;;;48     
;;;49       while (1)
;;;50       {
;;;51         /* If SEL pushbutton is pressed */
;;;52         if(SELStatus == 1)
00000a  68e0              LDR      r0,[r4,#0xc]  ; SELStatus
00000c  2801              CMP      r0,#1
00000e  d1fc              BNE      |L9.10|
;;;53         {
;;;54           /* External Interrupt Disable */
;;;55           IntExtOnOffConfig(DISABLE);
000010  2000              MOVS     r0,#0
000012  f7fffffe          BL       IntExtOnOffConfig
;;;56     
;;;57           /* Execute Sel Function */
;;;58           SelFunc();
000016  f7fffffe          BL       SelFunc
;;;59     
;;;60           /* External Interrupt Enable */
;;;61           IntExtOnOffConfig(ENABLE);
00001a  2001              MOVS     r0,#1
00001c  f7fffffe          BL       IntExtOnOffConfig
;;;62           /* Reset SELStatus value */
;;;63           SELStatus = 0;
000020  60e5              STR      r5,[r4,#0xc]  ; SELStatus
000022  e7f2              B        |L9.10|
;;;64         } 
;;;65       }
;;;66     }
;;;67     
                          ENDP

                  |L9.36|
000024  00000000          DCD      ||.data||

                          AREA ||i.Delay||, CODE, READONLY, ALIGN=2

                  Delay PROC
;;;393    void Delay(u32 nCount)
;;;394    {
000000  b510              PUSH     {r4,lr}
;;;395      TimingDelay = nCount;
000002  4c08              LDR      r4,|L10.36|
000004  6060              STR      r0,[r4,#4]  ; TimingDelay
;;;396    
;;;397      /* Enable the SysTick Counter */
;;;398      SysTick_CounterCmd(SysTick_Counter_Enable);
000006  2001              MOVS     r0,#1
000008  f7fffffe          BL       SysTick_CounterCmd
                  |L10.12|
;;;399      
;;;400      while(TimingDelay != 0)
00000c  6860              LDR      r0,[r4,#4]  ; TimingDelay
00000e  2800              CMP      r0,#0
000010  d1fc              BNE      |L10.12|
;;;401      {
;;;402      }
;;;403    
;;;404      /* Disable the SysTick Counter */
;;;405      SysTick_CounterCmd(SysTick_Counter_Disable);
000012  1e80              SUBS     r0,r0,#2
000014  f7fffffe          BL       SysTick_CounterCmd
;;;406    
;;;407      /* Clear the SysTick Counter */
;;;408      SysTick_CounterCmd(SysTick_Counter_Clear);
000018  e8bd4010          POP      {r4,lr}
00001c  2000              MOVS     r0,#0
00001e  f7ffbffe          B.W      SysTick_CounterCmd
;;;409    }
;;;410    
                          ENDP

000022  0000              DCW      0x0000
                  |L10.36|
000024  00000000          DCD      ||.data||

                          AREA ||i.DelayJoyStick||, CODE, READONLY, ALIGN=2

                  DelayJoyStick PROC
;;;419    u32 DelayJoyStick(u32 nTime)
;;;420    {
000000  b570              PUSH     {r4-r6,lr}
000002  4606              MOV      r6,r0
;;;421      vu32 keystate = 0;
000004  2400              MOVS     r4,#0
;;;422    
;;;423      /* Enable the SysTick Counter */
;;;424      SysTick_CounterCmd(SysTick_Counter_Enable);
000006  2001              MOVS     r0,#1
000008  f7fffffe          BL       SysTick_CounterCmd
;;;425    
;;;426      TimingDelay = nTime;
00000c  4d08              LDR      r5,|L11.48|
00000e  606e              STR      r6,[r5,#4]  ; TimingDelay
;;;427     
;;;428      while((TimingDelay != 0) && (keystate != RIGHT) && (keystate != LEFT) && (keystate != SEL))
000010  e003              B        |L11.26|
;;;429      {
;;;430        keystate = ReadKey();
000012  bf00              NOP      
                  |L11.20|
000014  f7fffffe          BL       ReadKey
000018  4604              MOV      r4,r0
                  |L11.26|
00001a  6868              LDR      r0,[r5,#4]            ;428  ; TimingDelay
00001c  b128              CBZ      r0,|L11.42|
00001e  2c02              CMP      r4,#2                 ;428
000020  d003              BEQ      |L11.42|
000022  2c03              CMP      r4,#3                 ;428
000024  d001              BEQ      |L11.42|
000026  2c01              CMP      r4,#1                 ;428
000028  d1f4              BNE      |L11.20|
                  |L11.42|
;;;431      } 
;;;432      
;;;433      return keystate;
00002a  4620              MOV      r0,r4
;;;434    }
00002c  bd70              POP      {r4-r6,pc}
;;;435    
                          ENDP

00002e  0000              DCW      0x0000
                  |L11.48|
000030  00000000          DCD      ||.data||

                          AREA ||i.Decrement_TimingDelay||, CODE, READONLY, ALIGN=2

                  Decrement_TimingDelay PROC
;;;444    {
;;;445      if (TimingDelay != 0x00)
000000  4803              LDR      r0,|L12.16|
000002  6841              LDR      r1,[r0,#4]  ; TimingDelay
000004  2900              CMP      r1,#0
000006  d002              BEQ      |L12.14|
;;;446      {
;;;447        TimingDelay--;
000008  6841              LDR      r1,[r0,#4]  ; TimingDelay
00000a  1e49              SUBS     r1,r1,#1
00000c  6041              STR      r1,[r0,#4]  ; TimingDelay
                  |L12.14|
;;;448      }
;;;449    }
00000e  4770              BX       lr
;;;450    
                          ENDP

                  |L12.16|
000010  00000000          DCD      ||.data||

                          AREA ||i.Set_SELStatus||, CODE, READONLY, ALIGN=2

                  Set_SELStatus PROC
;;;459    {
;;;460      SELStatus = 1;
000000  4901              LDR      r1,|L13.8|
000002  2001              MOVS     r0,#1
000004  60c8              STR      r0,[r1,#0xc]  ; SELStatus
;;;461    }
000006  4770              BX       lr
;;;462    
                          ENDP

                  |L13.8|
000008  00000000          DCD      ||.data||

                          AREA ||i.Get_LedShowStatus||, CODE, READONLY, ALIGN=2

                  Get_LedShowStatus PROC
;;;550    {
;;;551      return LedShowStatus;
000000  4801              LDR      r0,|L14.8|
000002  6880              LDR      r0,[r0,#8]  ; LedShowStatus
;;;552    }
000004  4770              BX       lr
;;;553    
                          ENDP

000006  0000              DCW      0x0000
                  |L14.8|
000008  00000000          DCD      ||.data||

                          AREA ||i.Get_HSEStartUpStatus||, CODE, READONLY, ALIGN=2

                  Get_HSEStartUpStatus PROC
;;;604    {
;;;605      return (HSEStartUpStatus);
000000  4801              LDR      r0,|L15.8|
000002  7800              LDRB     r0,[r0,#0]  ; HSEStartUpStatus
;;;606    }
000004  4770              BX       lr
;;;607    
                          ENDP

000006  0000              DCW      0x0000
                  |L15.8|
000008  00000000          DCD      ||.data||

                          AREA ||.data||, DATA, ALIGN=2

                  HSEStartUpStatus
000000  01000000          DCB      0x01,0x00,0x00,0x00
                  TimingDelay
000004  00000000          DCD      0x00000000
                  LedShowStatus
000008  00000000          DCD      0x00000000
                  SELStatus
00000c  00000000          DCD      0x00000000

                  __ARM_use_no_argv EQU 0

⌨️ 快捷键说明

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