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

📄 stm32f10x_rcc.lst

📁 针对STM32F103的UCOS移植
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000026   1368               LDR      R3,[R2, #+0]
   \   00000028   094C               LDR.N    R4,??RCC_DeInit_0  ;; 0xfffffffff8ff0000
   \   0000002A   1C40               ANDS     R4,R4,R3
   \   0000002C   1460               STR      R4,[R2, #+0]
    146            
    147            /* Reset HSEON, CSSON and PLLON bits */
    148            RCC->CR &= 0xFEF6FFFF;
   \   0000002E   0B68               LDR      R3,[R1, #+0]
   \   00000030   084C               LDR.N    R4,??RCC_DeInit_0+0x4  ;; 0xfffffffffef6ffff
   \   00000032   1C40               ANDS     R4,R4,R3
   \   00000034   0C60               STR      R4,[R1, #+0]
    149          
    150            /* Reset HSEBYP bit */
    151            RCC->CR &= 0xFFFBFFFF;
   \   00000036   0B68               LDR      R3,[R1, #+0]
   \   00000038   7FF48024           MVNS     R4,#+262144
   \   0000003C   1C40               ANDS     R4,R4,R3
   \   0000003E   0C60               STR      R4,[R1, #+0]
    152          
    153            /* Reset PLLSRC, PLLXTPRE, PLLMUL[3:0] and USBPRE bits */
    154            RCC->CFGR &= 0xFF80FFFF;
   \   00000040   1168               LDR      R1,[R2, #+0]
   \   00000042   7FF4FE03           MVNS     R3,#+8323072
   \   00000046   0B40               ANDS     R3,R3,R1
   \   00000048   1360               STR      R3,[R2, #+0]
    155          
    156            /* Disable all interrupts */
    157            RCC->CIR = 0x00000000;
   \   0000004A   ....               LDR.N    R1,??DataTable20  ;; 0x40021008
   \   0000004C   0860               STR      R0,[R1, #+0]
    158          }
   \   0000004E   10BD               POP      {R4,PC}          ;; return
   \                     ??RCC_DeInit_0:
   \   00000050   0000FFF8           DC32     0xfffffffff8ff0000
   \   00000054   FFFFF6FE           DC32     0xfffffffffef6ffff
    159          
    160          /*******************************************************************************
    161          * Function Name  : RCC_HSEConfig
    162          * Description    : Configures the External High Speed oscillator (HSE).
    163          *                  HSE can not be stopped if it is used directly or through the 
    164          *                  PLL as system clock.
    165          * Input          : - RCC_HSE: specifies the new state of the HSE.
    166          *                    This parameter can be one of the following values:
    167          *                       - RCC_HSE_OFF: HSE oscillator OFF
    168          *                       - RCC_HSE_ON: HSE oscillator ON
    169          *                       - RCC_HSE_Bypass: HSE oscillator bypassed with external
    170          *                         clock
    171          * Output         : None
    172          * Return         : None
    173          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    174          void RCC_HSEConfig(u32 RCC_HSE)
    175          {
   \                     RCC_HSEConfig:
   \   00000000   00B5               PUSH     {LR}
    176            /* Check the parameters */
    177            assert(IS_RCC_HSE(RCC_HSE));
    178          
    179            /* Reset HSEON and HSEBYP bits before configuring the HSE ------------------*/
    180            /* Reset HSEON bit */
    181            RCC->CR &= CR_HSEON_Reset;
   \   00000002   ....               LDR.N    R1,??DataTable16  ;; 0x40021000
   \   00000004   0A68               LDR      R2,[R1, #+0]
   \   00000006   7FF48033           MVNS     R3,#+65536
   \   0000000A   1340               ANDS     R3,R3,R2
   \   0000000C   0B60               STR      R3,[R1, #+0]
    182          
    183            /* Reset HSEBYP bit */
    184            RCC->CR &= CR_HSEBYP_Reset;
   \   0000000E   0A68               LDR      R2,[R1, #+0]
   \   00000010   7FF48023           MVNS     R3,#+262144
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   0B60               STR      R3,[R1, #+0]
    185          
    186            /* Configure HSE (RCC_HSE_OFF is already covered by the code section above) */
    187            switch(RCC_HSE)
   \   00000018   5FF48032           MOVS     R2,#+65536
   \   0000001C   9042               CMP      R0,R2
   \   0000001E   03D0               BEQ.N    ??RCC_HSEConfig_0
   \   00000020   9200               LSLS     R2,R2,#+2
   \   00000022   9042               CMP      R0,R2
   \   00000024   05D0               BEQ.N    ??RCC_HSEConfig_1
   \   00000026   00BD               POP      {PC}
    188            {
    189              case RCC_HSE_ON:
    190                /* Set HSEON bit */
    191                RCC->CR |= CR_HSEON_Set;
   \                     ??RCC_HSEConfig_0:
   \   00000028   0868               LDR      R0,[R1, #+0]
   \   0000002A   50F48030           ORRS     R0,R0,#0x10000
   \   0000002E   0860               STR      R0,[R1, #+0]
   \   00000030   00BD               POP      {PC}
    192                break;
    193                
    194              case RCC_HSE_Bypass:
    195                /* Set HSEBYP and HSEON bits */
    196                RCC->CR |= CR_HSEBYP_Set | CR_HSEON_Set;
   \                     ??RCC_HSEConfig_1:
   \   00000032   0868               LDR      R0,[R1, #+0]
   \   00000034   50F4A020           ORRS     R0,R0,#0x50000
   \   00000038   0860               STR      R0,[R1, #+0]
    197                break;            
    198                
    199              default:
    200                break;      
    201            }
    202          }
   \   0000003A   00BD               POP      {PC}             ;; return
    203          
    204          /*******************************************************************************
    205          * Function Name  : RCC_WaitForHSEStartUp
    206          * Description    : Waits for HSE start-up.
    207          * Input          : None
    208          * Output         : None
    209          * Return         : An ErrorStatus enumuration value:
    210          *                         - SUCCESS: HSE oscillator is stable and ready to use
    211          *                         - ERROR: HSE oscillator not yet ready
    212          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    213          ErrorStatus RCC_WaitForHSEStartUp(void)
    214          {
   \                     RCC_WaitForHSEStartUp:
   \   00000000   01B5               PUSH     {R0,LR}
    215            vu32 StartUpCounter = 0;
   \   00000002   0020               MOVS     R0,#+0
   \   00000004   0090               STR      R0,[SP, #+0]
   \   00000006   02E0               B.N      ??RCC_WaitForHSEStartUp_0
    216          
    217            /* Wait till HSE is ready and if Time out is reached exit */
    218            while((RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET) &&
    219                  (StartUpCounter != HSEStartUp_TimeOut))
    220            {
    221              StartUpCounter++;
   \                     ??RCC_WaitForHSEStartUp_1:
   \   00000008   0098               LDR      R0,[SP, #+0]
   \   0000000A   401C               ADDS     R0,R0,#+1
   \   0000000C   0090               STR      R0,[SP, #+0]
    222            }
   \                     ??RCC_WaitForHSEStartUp_0:
   \   0000000E   3120               MOVS     R0,#+49
   \   00000010   ........           BL       RCC_GetFlagStatus
   \   00000014   0028               CMP      R0,#+0
   \   00000016   02D1               BNE.N    ??RCC_WaitForHSEStartUp_2
   \   00000018   0098               LDR      R0,[SP, #+0]
   \   0000001A   8028               CMP      R0,#+128
   \   0000001C   F4D1               BNE.N    ??RCC_WaitForHSEStartUp_1
    223           
    224            if(RCC_GetFlagStatus(RCC_FLAG_HSERDY) != RESET)
   \                     ??RCC_WaitForHSEStartUp_2:
   \   0000001E   3120               MOVS     R0,#+49
   \   00000020   ........           BL       RCC_GetFlagStatus
   \   00000024   0028               CMP      R0,#+0
   \   00000026   00D0               BEQ.N    ??RCC_WaitForHSEStartUp_3
    225            {
    226              return SUCCESS;
   \   00000028   0120               MOVS     R0,#+1
    227            }
    228            else
    229            {
    230              return ERROR;
   \                     ??RCC_WaitForHSEStartUp_3:
   \   0000002A   02BD               POP      {R1,PC}          ;; return
    231            }
    232          }
    233          
    234          /*******************************************************************************
    235          * Function Name  : RCC_AdjustHSICalibrationValue
    236          * Description    : Adjusts the Internal High Speed oscillator (HSI) calibration
    237          *                  value.
    238          * Input          : - HSICalibrationValue: specifies the calibration trimming value.
    239          *                    This parameter must be a number between 0 and 0x1F.
    240          * Output         : None
    241          * Return         : None
    242          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    243          void RCC_AdjustHSICalibrationValue(u8 HSICalibrationValue)
    244          {
    245            u32 tmpreg = 0;
    246          
    247            /* Check the parameters */
    248            assert(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue));
    249          
    250            tmpreg = RCC->CR;
   \                     RCC_AdjustHSICalibrationValue:
   \   00000000   ....               LDR.N    R1,??DataTable16  ;; 0x40021000
   \   00000002   0A68               LDR      R2,[R1, #+0]
    251          
    252            /* Clear HSITRIM[7:3] bits */
    253            tmpreg &= CR_HSITRIM_Mask;
    254          
    255            /* Set the HSITRIM[7:3] bits according to HSICalibrationValue value */
    256            tmpreg |= (u32)HSICalibrationValue << 3;
    257          
    258            /* Store the new value */
    259            RCC->CR = tmpreg;
   \   00000004   F823               MOVS     R3,#+248
   \   00000006   9A43               BICS     R2,R2,R3
   \   00000008   52EAC000           ORRS     R0,R2,R0, LSL #+3
   \   0000000C   0860               STR      R0,[R1, #+0]
    260          }
   \   0000000E   7047               BX       LR               ;; return
    261          
    262          /*******************************************************************************
    263          * Function Name  : RCC_HSICmd
    264          * Description    : Enables or disables the Internal High Speed oscillator (HSI).
    265          *                  HSI can not be stopped if it is used directly or through the 
    266          *                  PLL as system clock.
    267          * Input          : - NewState: new state of the HSI.
    268          *                    This parameter can be: ENABLE or DISABLE.
    269          * Output         : None
    270          * Return         : None
    271          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    272          void RCC_HSICmd(FunctionalState NewState)
    273          {
    274            /* Check the parameters */
    275            assert(IS_FUNCTIONAL_STATE(NewState));
    276          
    277            *(vu32 *) CR_HSION_BB = (u32)NewState;
   \                     RCC_HSICmd:
   \   00000000   0149               LDR.N    R1,??RCC_HSICmd_0  ;; 0x42420000
   \   00000002   0860               STR      R0,[R1, #+0]
    278          }
   \   00000004   7047               BX       LR               ;; return
   \   00000006   00BF               Nop      
   \                     ??RCC_HSICmd_0:
   \   00000008   00004242           DC32     0x42420000

⌨️ 快捷键说明

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