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

📄 stm32f10x_adc.lst

📁 针对STM32F103的UCOS移植
💻 LST
📖 第 1 页 / 共 5 页
字号:
    615              tmpreg1 |= tmpreg2;
    616              /* Store the new register value */
    617              ADCx->SQR3 = tmpreg1;
   \   0000003A   521E               SUBS     R2,R2,#+1
   \   0000003C   0524               MOVS     R4,#+5
   \   0000003E   02FB04F2           MUL      R2,R2,R4
   \   00000042   1F24               MOVS     R4,#+31
   \   00000044   9440               LSLS     R4,R4,R2
   \   00000046   A343               BICS     R3,R3,R4
   \   00000048   9140               LSLS     R1,R1,R2
   \   0000004A   1943               ORRS     R1,R1,R3
   \   0000004C   4163               STR      R1,[R0, #+52]
   \   0000004E   70BD               POP      {R4-R6,PC}
    618            }
    619            /* For Rank 7 to 12 */
    620            else if (Rank < 13)
   \                     ??ADC_RegularChannelConfig_2:
   \   00000050   0D2A               CMP      R2,#+13
   \   00000052   0BD2               BCS.N    ??ADC_RegularChannelConfig_3
    621            {
    622              /* Get the old register value */
    623              tmpreg1 = ADCx->SQR2;
   \   00000054   036B               LDR      R3,[R0, #+48]
    624              /* Calculate the mask to clear */
    625              tmpreg2 = (u32)SQR2_SQ_Set << (5 * (Rank - 7));
    626              /* Clear the old SQx bits for the selected rank */
    627              tmpreg1 &= ~tmpreg2;
    628              /* Calculate the mask to set */
    629              tmpreg2 = (u32)ADC_Channel << (5 * (Rank - 7));
    630              /* Set the SQx bits for the selected rank */
    631              tmpreg1 |= tmpreg2;
    632              /* Store the new register value */
    633              ADCx->SQR2 = tmpreg1;
   \   00000056   F932               ADDS     R2,R2,#+249
   \   00000058   0524               MOVS     R4,#+5
   \   0000005A   02FB04F2           MUL      R2,R2,R4
   \   0000005E   1F24               MOVS     R4,#+31
   \   00000060   9440               LSLS     R4,R4,R2
   \   00000062   A343               BICS     R3,R3,R4
   \   00000064   9140               LSLS     R1,R1,R2
   \   00000066   1943               ORRS     R1,R1,R3
   \   00000068   0163               STR      R1,[R0, #+48]
   \   0000006A   70BD               POP      {R4-R6,PC}
    634            }
    635            /* For Rank 13 to 16 */
    636            else
    637            {
    638              /* Get the old register value */
    639              tmpreg1 = ADCx->SQR1;
   \                     ??ADC_RegularChannelConfig_3:
   \   0000006C   C36A               LDR      R3,[R0, #+44]
    640              /* Calculate the mask to clear */
    641              tmpreg2 = (u32)SQR1_SQ_Set << (5 * (Rank - 13));
    642              /* Clear the old SQx bits for the selected rank */
    643              tmpreg1 &= ~tmpreg2;
    644              /* Calculate the mask to set */
    645              tmpreg2 = (u32)ADC_Channel << (5 * (Rank - 13));
    646              /* Set the SQx bits for the selected rank */
    647              tmpreg1 |= tmpreg2;
    648              /* Store the new register value */
    649              ADCx->SQR1 = tmpreg1;
   \   0000006E   F332               ADDS     R2,R2,#+243
   \   00000070   0524               MOVS     R4,#+5
   \   00000072   02FB04F2           MUL      R2,R2,R4
   \   00000076   1F24               MOVS     R4,#+31
   \   00000078   9440               LSLS     R4,R4,R2
   \   0000007A   A343               BICS     R3,R3,R4
   \   0000007C   9140               LSLS     R1,R1,R2
   \   0000007E   1943               ORRS     R1,R1,R3
   \   00000080   C162               STR      R1,[R0, #+44]
    650            }
    651          }
   \   00000082   70BD               POP      {R4-R6,PC}       ;; return
    652          
    653          /*******************************************************************************
    654          * Function Name  : ADC_ExternalTrigConvCmd
    655          * Description    : Enables or disables the ADCx conversion through external trigger.
    656          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    657          *                  - NewState: new state of the selected ADC external trigger
    658          *                    start of conversion.
    659          *                    This parameter can be: ENABLE or DISABLE.
    660          * Output         : None
    661          * Return         : None
    662          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    663          void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    664          {
    665            /* Check the parameters */
    666            assert(IS_FUNCTIONAL_STATE(NewState));
    667          
    668            if (NewState != DISABLE)
   \                     ADC_ExternalTrigConvCmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   8168               LDR      R1,[R0, #+8]
   \   00000004   03D0               BEQ.N    ??ADC_ExternalTrigConvCmd_0
    669            {
    670              /* Enable the selected ADC conversion on external event */
    671              ADCx->CR2 |= CR2_EXTTRIG_Set;
   \   00000006   51F48011           ORRS     R1,R1,#0x100000
   \   0000000A   8160               STR      R1,[R0, #+8]
   \   0000000C   7047               BX       LR
    672            }
    673            else
    674            {
    675              /* Disable the selected ADC conversion on external event */
    676              ADCx->CR2 &= CR2_EXTTRIG_Reset;
   \                     ??ADC_ExternalTrigConvCmd_0:
   \   0000000E   7FF48012           MVNS     R2,#+1048576
   \   00000012   0A40               ANDS     R2,R2,R1
   \   00000014   8260               STR      R2,[R0, #+8]
    677            }
    678          }
   \   00000016   7047               BX       LR               ;; return
    679          
    680          /*******************************************************************************
    681          * Function Name  : ADC_GetConversionValue
    682          * Description    : Returns the last ADCx conversion result data for regular channel.
    683          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    684          * Output         : None
    685          * Return         : The Data conversion value.
    686          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    687          u16 ADC_GetConversionValue(ADC_TypeDef* ADCx)
    688          {
    689            /* Return the selected ADC conversion value */
    690            return (u16) ADCx->DR;
   \                     ADC_GetConversionValue:
   \   00000000   C06C               LDR      R0,[R0, #+76]
   \   00000002   80B2               UXTH     R0,R0
   \   00000004   7047               BX       LR               ;; return
    691          }
    692          
    693          /*******************************************************************************
    694          * Function Name  : ADC_GetDualModeConversionValue
    695          * Description    : Returns the last ADCs conversion result data in dual mode.
    696          * Output         : None
    697          * Return         : The Data conversion value.
    698          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    699          u32 ADC_GetDualModeConversionValue(void)
    700          {
    701            /* Return the dual mode conversion value */
    702            return ADC1->DR;
   \                     ADC_GetDualModeConversionValue:
   \   00000000   0148               LDR.N    R0,??ADC_GetDualModeConversionValue_0  ;; 0x4001244c
   \   00000002   0068               LDR      R0,[R0, #+0]
   \   00000004   7047               BX       LR               ;; return
   \   00000006   00BF               Nop      
   \                     ??ADC_GetDualModeConversionValue_0:
   \   00000008   4C240140           DC32     0x4001244c
    703          }
    704          
    705          /*******************************************************************************
    706          * Function Name  : ADC_AutoInjectedConvCmd
    707          * Description    : Enables or disables the selected ADC automatic injected group
    708          *                  conversion after regular one.
    709          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    710          *                  - NewState: new state of the selected ADC auto injected
    711          *                    conversion
    712          *                    This parameter can be: ENABLE or DISABLE.
    713          * Output         : None
    714          * Return         : None
    715          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    716          void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    717          {
    718            /* Check the parameters */
    719            assert(IS_FUNCTIONAL_STATE(NewState));
    720          
    721            if (NewState != DISABLE)
   \                     ADC_AutoInjectedConvCmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   4168               LDR      R1,[R0, #+4]
   \   00000004   03D0               BEQ.N    ??ADC_AutoInjectedConvCmd_0
    722            {
    723              /* Enable the selected ADC automatic injected group conversion */
    724              ADCx->CR1 |= CR1_JAUTO_Set;
   \   00000006   51F48061           ORRS     R1,R1,#0x400
   \   0000000A   4160               STR      R1,[R0, #+4]
   \   0000000C   7047               BX       LR
    725            }
    726            else
    727            {
    728              /* Disable the selected ADC automatic injected group conversion */
    729              ADCx->CR1 &= CR1_JAUTO_Reset;
   \                     ??ADC_AutoInjectedConvCmd_0:
   \   0000000E   7FF48062           MVNS     R2,#+1024
   \   00000012   0A40               ANDS     R2,R2,R1
   \   00000014   4260               STR      R2,[R0, #+4]
    730            }
    731          }
   \   00000016   7047               BX       LR               ;; return
    732          
    733          /*******************************************************************************
    734          * Function Name  : ADC_InjectedDiscModeCmd
    735          * Description    : Enables or disables the discontinuous mode for injected group
    736          *                  channel for the specified ADC
    737          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    738          *                  - NewState: new state of the selected ADC discontinuous mode
    739          *                    on injected group channel.
    740          *                    This parameter can be: ENABLE or DISABLE.
    741          * Output         : None
    742          * Return         : None
    743          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    744          void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    745          {
    746            /* Check the parameters */
    747            assert(IS_FUNCTIONAL_STATE(NewState));
    748          
    749            if (NewState != DISABLE)
   \                     ADC_InjectedDiscModeCmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   4168               LDR      R1,[R0, #+4]
   \   00000004   03D0               BEQ.N    ??ADC_InjectedDiscModeCmd_0
    750            {
    751              /* Enable the selected ADC injected discontinuous mode */
    752              ADCx->CR1 |= CR1_JDISCEN_Set;
   \   00000006   51F48051           ORRS     R1,R1,#0x1000
   \   0000000A   4160               STR      R1,[R0, #+4]
   \   0000000C   7047               BX     

⌨️ 快捷键说明

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