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

📄 stm32f10x_rcc.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000024   0360               STR      R3,[R0, #+0]
    140          
    141            /* Reset PLLSRC, PLLXTPRE, PLLMUL[3:0] and USBPRE bits */
    142            RCC->CFGR &= (u32)0xFF80FFFF;
   \   00000026   0868               LDR      R0,[R1, #+0]
   \   00000028   7FF4FE02           MVNS     R2,#+8323072
   \   0000002C   0240               ANDS     R2,R2,R0
   \   0000002E   0A60               STR      R2,[R1, #+0]
    143          
    144            /* Disable all interrupts */
    145            RCC->CIR = 0x00000000;
   \   00000030   ....               LDR.N    R0,??DataTable19  ;; 0x40021008
   \   00000032   0021               MOVS     R1,#+0
   \   00000034   0160               STR      R1,[R0, #+0]
    146          }
   \   00000036   7047               BX       LR               ;; return
   \                     ??RCC_DeInit_0:
   \   00000038   0000FFF8           DC32     0xfffffffff8ff0000
   \   0000003C   FFFFF6FE           DC32     0xfffffffffef6ffff
    147          
    148          /*******************************************************************************
    149          * Function Name  : RCC_HSEConfig
    150          * Description    : Configures the External High Speed oscillator (HSE).
    151          *                  HSE can not be stopped if it is used directly or through the 
    152          *                  PLL as system clock.
    153          * Input          : - RCC_HSE: specifies the new state of the HSE.
    154          *                    This parameter can be one of the following values:
    155          *                       - RCC_HSE_OFF: HSE oscillator OFF
    156          *                       - RCC_HSE_ON: HSE oscillator ON
    157          *                       - RCC_HSE_Bypass: HSE oscillator bypassed with external
    158          *                         clock
    159          * Output         : None
    160          * Return         : None
    161          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    162          void RCC_HSEConfig(u32 RCC_HSE)
    163          {
   \                     RCC_HSEConfig:
   \   00000000   00B5               PUSH     {LR}
    164            /* Check the parameters */
    165            assert_param(IS_RCC_HSE(RCC_HSE));
    166          
    167            /* Reset HSEON and HSEBYP bits before configuring the HSE ------------------*/
    168            /* Reset HSEON bit */
    169            RCC->CR &= CR_HSEON_Reset;
   \   00000002   ....               LDR.N    R1,??DataTable15  ;; 0x40021000
   \   00000004   0A68               LDR      R2,[R1, #+0]
   \   00000006   7FF48033           MVNS     R3,#+65536
   \   0000000A   1340               ANDS     R3,R3,R2
   \   0000000C   0B60               STR      R3,[R1, #+0]
    170          
    171            /* Reset HSEBYP bit */
    172            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]
    173          
    174            /* Configure HSE (RCC_HSE_OFF is already covered by the code section above) */
    175            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}
    176            {
    177              case RCC_HSE_ON:
    178                /* Set HSEON bit */
    179                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}
    180                break;
    181                
    182              case RCC_HSE_Bypass:
    183                /* Set HSEBYP and HSEON bits */
    184                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]
    185                break;            
    186                
    187              default:
    188                break;      
    189            }
    190          }
   \   0000003A   00BD               POP      {PC}             ;; return
    191          
    192          /*******************************************************************************
    193          * Function Name  : RCC_WaitForHSEStartUp
    194          * Description    : Waits for HSE start-up.
    195          * Input          : None
    196          * Output         : None
    197          * Return         : An ErrorStatus enumuration value:
    198          *                         - SUCCESS: HSE oscillator is stable and ready to use
    199          *                         - ERROR: HSE oscillator not yet ready
    200          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    201          ErrorStatus RCC_WaitForHSEStartUp(void)
    202          {
   \                     RCC_WaitForHSEStartUp:
   \   00000000   10B5               PUSH     {R4,LR}
   \   00000002   0B4C               LDR.N    R4,??RCC_WaitForHSEStartUp_0  ;; HSEStatus
    203            ErrorStatus status = ERROR;
    204          
    205            /* Wait till HSE is ready and if Time out is reached exit */
    206            do
    207            {
    208              HSEStatus = RCC_GetFlagStatus(RCC_FLAG_HSERDY);
   \                     ??RCC_WaitForHSEStartUp_1:
   \   00000004   3120               MOVS     R0,#+49
   \   00000006   ........           BL       RCC_GetFlagStatus
   \   0000000A   2070               STRB     R0,[R4, #+0]
    209              StartUpCounter++;  
   \   0000000C   6068               LDR      R0,[R4, #+4]
   \   0000000E   401C               ADDS     R0,R0,#+1
   \   00000010   6060               STR      R0,[R4, #+4]
    210            } while((HSEStatus == RESET) && (StartUpCounter != HSEStartUp_TimeOut));
   \   00000012   2078               LDRB     R0,[R4, #+0]
   \   00000014   0028               CMP      R0,#+0
   \   00000016   03D1               BNE.N    ??RCC_WaitForHSEStartUp_2
   \   00000018   6068               LDR      R0,[R4, #+4]
   \   0000001A   0649               LDR.N    R1,??RCC_WaitForHSEStartUp_0+0x4  ;; 0x1ff
   \   0000001C   8842               CMP      R0,R1
   \   0000001E   F1D1               BNE.N    ??RCC_WaitForHSEStartUp_1
    211          
    212          
    213            if (RCC_GetFlagStatus(RCC_FLAG_HSERDY) != RESET)
   \                     ??RCC_WaitForHSEStartUp_2:
   \   00000020   3120               MOVS     R0,#+49
   \   00000022   ........           BL       RCC_GetFlagStatus
   \   00000026   0028               CMP      R0,#+0
   \   00000028   00D0               BEQ.N    ??RCC_WaitForHSEStartUp_3
    214            {
    215              status = SUCCESS;
   \   0000002A   0120               MOVS     R0,#+1
    216            }
    217            else
    218            {
    219              status = ERROR;
    220            }  
    221          
    222            return (status);
   \                     ??RCC_WaitForHSEStartUp_3:
   \   0000002C   10BD               POP      {R4,PC}          ;; return
   \   0000002E   00BF               Nop      
   \                     ??RCC_WaitForHSEStartUp_0:
   \   00000030   ........           DC32     HSEStatus
   \   00000034   FF010000           DC32     0x1ff
    223          }
    224          
    225          /*******************************************************************************
    226          * Function Name  : RCC_AdjustHSICalibrationValue
    227          * Description    : Adjusts the Internal High Speed oscillator (HSI) calibration
    228          *                  value.
    229          * Input          : - HSICalibrationValue: specifies the calibration trimming value.
    230          *                    This parameter must be a number between 0 and 0x1F.
    231          * Output         : None
    232          * Return         : None
    233          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    234          void RCC_AdjustHSICalibrationValue(u8 HSICalibrationValue)
    235          {
    236            u32 tmpreg = 0;
    237          
    238            /* Check the parameters */
    239            assert_param(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue));
    240          
    241            tmpreg = RCC->CR;
   \                     RCC_AdjustHSICalibrationValue:
   \   00000000   ....               LDR.N    R1,??DataTable15  ;; 0x40021000
   \   00000002   0A68               LDR      R2,[R1, #+0]
    242          
    243            /* Clear HSITRIM[4:0] bits */
    244            tmpreg &= CR_HSITRIM_Mask;
    245          
    246            /* Set the HSITRIM[4:0] bits according to HSICalibrationValue value */
    247            tmpreg |= (u32)HSICalibrationValue << 3;
    248          
    249            /* Store the new value */
    250            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]
    251          }
   \   0000000E   7047               BX       LR               ;; return
    252          
    253          /*******************************************************************************
    254          * Function Name  : RCC_HSICmd
    255          * Description    : Enables or disables the Internal High Speed oscillator (HSI).
    256          *                  HSI can not be stopped if it is used directly or through the 
    257          *                  PLL as system clock.
    258          * Input          : - NewState: new state of the HSI.
    259          *                    This parameter can be: ENABLE or DISABLE.
    260          * Output         : None
    261          * Return         : None
    262          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    263          void RCC_HSICmd(FunctionalState NewState)
    264          {
    265            /* Check the parameters */
    266            assert_param(IS_FUNCTIONAL_STATE(NewState));
    267          
    268            *(vu32 *) CR_HSION_BB = (u32)NewState;
   \                     RCC_HSICmd:
   \   00000000   0149               LDR.N    R1,??RCC_HSICmd_0  ;; 0x42420000
   \   00000002   0860               STR      R0,[R1, #+0]
    269          }
   \   00000004   7047               BX       LR               ;; return
   \   00000006   00BF               Nop      
   \                     ??RCC_HSICmd_0:
   \   00000008   00004242           DC32     0x42420000
    270          
    271          /*******************************************************************************
    272          * Function Name  : RCC_PLLConfig
    273          * Description    : Configures the PLL clock source and multiplication factor.
    274          *                  This function must be used only when the PLL is disabled.
    275          * Input          : - RCC_PLLSource: specifies the PLL entry clock source.
    276          *                    This parameter can be one of the following values:
    277          *                       - RCC_PLLSource_HSI_Div2: HSI oscillator clock divided

⌨️ 快捷键说明

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