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

📄 stm32f10x_adc.lst

📁 完成数据的采集
💻 LST
📖 第 1 页 / 共 5 页
字号:
    295          *                    or disabled. 
    296          *                    This parameter can be any combination of the following values:
    297          *                       - ADC_IT_EOC: End of conversion interrupt mask
    298          *                       - ADC_IT_AWD: Analog watchdog interrupt mask
    299          *                       - ADC_IT_JEOC: End of injected conversion interrupt mask
    300          *                  - NewState: new state of the specified ADC interrupts.
    301          *                    This parameter can be: ENABLE or DISABLE.
    302          * Output         : None
    303          * Return         : None
    304          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    305          void ADC_ITConfig(ADC_TypeDef* ADCx, u16 ADC_IT, FunctionalState NewState)
    306          {
   \                     ADC_ITConfig:
   \   00000000   11B4               PUSH     {R0,R4}
    307            u8 itmask = 0;
   \   00000002   0024               MOVS     R4,#+0
   \   00000004   2300               MOVS     R3,R4
    308          
    309            /* Check the parameters */
    310            assert_param(IS_FUNCTIONAL_STATE(NewState));
    311            assert_param(IS_ADC_IT(ADC_IT));
    312          
    313            /* Get the ADC IT index */
    314            itmask = (u8)ADC_IT;
   \   00000006   0C00               MOVS     R4,R1
   \   00000008   2300               MOVS     R3,R4
    315          
    316            if (NewState != DISABLE)
   \   0000000A   D2B2               UXTB     R2,R2            ;; ZeroExtS R2,R2,#+24,#+24
   \   0000000C   002A               CMP      R2,#+0
   \   0000000E   04D0               BEQ.N    ??ADC_ITConfig_0
    317            {
    318              /* Enable the selected ADC interrupts */
    319              ADCx->CR1 |= itmask;
   \   00000010   4468               LDR      R4,[R0, #+4]
   \   00000012   DBB2               UXTB     R3,R3            ;; ZeroExtS R3,R3,#+24,#+24
   \   00000014   1C43               ORRS     R4,R4,R3
   \   00000016   4460               STR      R4,[R0, #+4]
   \   00000018   03E0               B.N      ??ADC_ITConfig_1
    320            }
    321            else
    322            {
    323              /* Disable the selected ADC interrupts */
    324              ADCx->CR1 &= (~(u32)itmask);
   \                     ??ADC_ITConfig_0:
   \   0000001A   4468               LDR      R4,[R0, #+4]
   \   0000001C   DBB2               UXTB     R3,R3            ;; ZeroExtS R3,R3,#+24,#+24
   \   0000001E   9C43               BICS     R4,R4,R3
   \   00000020   4460               STR      R4,[R0, #+4]
    325            }
    326          }
   \                     ??ADC_ITConfig_1:
   \   00000022   01B0               ADD      SP,SP,#+4
   \   00000024   10BC               POP      {R4}
   \   00000026   7047               BX       LR               ;; return
    327          
    328          /*******************************************************************************
    329          * Function Name  : ADC_ResetCalibration
    330          * Description    : Resets the selected ADC calibration registers.
    331          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    332          * Output         : None
    333          * Return         : None
    334          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    335          void ADC_ResetCalibration(ADC_TypeDef* ADCx)
    336          {
    337            /* Resets the selected ADC calibartion registers */  
    338            ADCx->CR2 |= CR2_RSTCAL_Set;
   \                     ADC_ResetCalibration:
   \   00000000   8168               LDR      R1,[R0, #+8]
   \   00000002   51F00801           ORRS     R1,R1,#0x8
   \   00000006   8160               STR      R1,[R0, #+8]
    339          }
   \   00000008   7047               BX       LR               ;; return
    340          
    341          /*******************************************************************************
    342          * Function Name  : ADC_GetResetCalibrationStatus
    343          * Description    : Gets the selected ADC reset calibration registers status.
    344          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    345          * Output         : None
    346          * Return         : The new state of ADC reset calibration registers (SET or RESET).
    347          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    348          FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx)
    349          {
   \                     ADC_GetResetCalibrationStatus:
   \   00000000   0100               MOVS     R1,R0
    350            FlagStatus bitstatus = RESET;
   \   00000002   0022               MOVS     R2,#+0
   \   00000004   1000               MOVS     R0,R2
    351          
    352            /* Check the status of RSTCAL bit */
    353            if ((ADCx->CR2 & CR2_RSTCAL_Set) != (u16)RESET)
   \   00000006   8A68               LDR      R2,[R1, #+8]
   \   00000008   0823               MOVS     R3,#+8
   \   0000000A   1340               ANDS     R3,R3,R2
   \   0000000C   5A1E               SUBS     R2,R3,#+1
   \   0000000E   9241               SBCS     R2,R2,R2
   \   00000010   D243               MVNS     R2,R2
   \   00000012   D20F               LSRS     R2,R2,#+31
   \   00000014   1000               MOVS     R0,R2
    354            {
    355              /* RSTCAL bit is set */
    356              bitstatus = SET;
    357            }
    358            else
    359            {
    360              /* RSTCAL bit is reset */
    361              bitstatus = RESET;
    362            }
    363            /* Return the RSTCAL bit status */
    364            return  bitstatus;
   \   00000016   C0B2               UXTB     R0,R0            ;; ZeroExtS R0,R0,#+24,#+24
   \   00000018   7047               BX       LR               ;; return
    365          }
    366          
    367          /*******************************************************************************
    368          * Function Name  : ADC_StartCalibration
    369          * Description    : Starts the selected ADC calibration process.
    370          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    371          * Output         : None
    372          * Return         : None
    373          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    374          void ADC_StartCalibration(ADC_TypeDef* ADCx)
    375          {
    376            /* Enable the selected ADC calibration process */  
    377            ADCx->CR2 |= CR2_CAL_Set;
   \                     ADC_StartCalibration:
   \   00000000   8168               LDR      R1,[R0, #+8]
   \   00000002   51F00401           ORRS     R1,R1,#0x4
   \   00000006   8160               STR      R1,[R0, #+8]
    378          }
   \   00000008   7047               BX       LR               ;; return
    379          
    380          /*******************************************************************************
    381          * Function Name  : ADC_GetCalibrationStatus
    382          * Description    : Gets the selected ADC calibration status.
    383          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    384          * Output         : None
    385          * Return         : The new state of ADC calibration (SET or RESET).
    386          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    387          FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx)
    388          {
   \                     ADC_GetCalibrationStatus:
   \   00000000   0100               MOVS     R1,R0
    389            FlagStatus bitstatus = RESET;
   \   00000002   0022               MOVS     R2,#+0
   \   00000004   1000               MOVS     R0,R2
    390          
    391            /* Check the status of CAL bit */
    392            if ((ADCx->CR2 & CR2_CAL_Set) != (u16)RESET)
   \   00000006   8A68               LDR      R2,[R1, #+8]
   \   00000008   0423               MOVS     R3,#+4
   \   0000000A   1340               ANDS     R3,R3,R2
   \   0000000C   5A1E               SUBS     R2,R3,#+1
   \   0000000E   9241               SBCS     R2,R2,R2
   \   00000010   D243               MVNS     R2,R2
   \   00000012   D20F               LSRS     R2,R2,#+31
   \   00000014   1000               MOVS     R0,R2
    393            {
    394              /* CAL bit is set: calibration on going */
    395              bitstatus = SET;
    396            }
    397            else
    398            {
    399              /* CAL bit is reset: end of calibration */
    400              bitstatus = RESET;
    401            }
    402            /* Return the CAL bit status */
    403            return  bitstatus;
   \   00000016   C0B2               UXTB     R0,R0            ;; ZeroExtS R0,R0,#+24,#+24
   \   00000018   7047               BX       LR               ;; return
    404          }
    405          
    406          /*******************************************************************************
    407          * Function Name  : ADC_SoftwareStartConvCmd
    408          * Description    : Enables or disables the selected ADC software start conversion .
    409          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    410          *                  - NewState: new state of the selected ADC software start conversion.
    411          *                    This parameter can be: ENABLE or DISABLE.
    412          * Output         : None
    413          * Return         : None
    414          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    415          void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    416          {
    417            /* Check the parameters */
    418            assert_param(IS_FUNCTIONAL_STATE(NewState));
    419          
    420            if (NewState != DISABLE)
   \                     ADC_SoftwareStartConvCmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??ADC_SoftwareStartConvCmd_0
    421            {
    422              /* Enable the selected ADC conversion on external event */
    423          	/* Starts the selected ADC conversion */
    424          	ADCx->CR2 |= CR2_EXTTRIG_SWSTRT_Set;
   \   00000006   8268               LDR      R2,[R0, #+8]
   \   00000008   52F4A002           ORRS     R2,R2,#0x500000
   \   0000000C   8260               STR      R2,[R0, #+8]
   \   0000000E   04E0               B.N      ??ADC_SoftwareStartConvCmd_1
    425            }
    426            else
    427            {
    428              /* Stops the selected ADC conversion */
    429              /* Disable the selected ADC conversion on external event */
    430          	ADCx->CR2 &= CR2_EXTTRIG_SWSTRT_Reset;
   \                     ??ADC_SoftwareStartConvCmd_0:
   \   00000010   8268               LDR      R2,[R0, #+8]
   \   00000012   7FF4A003           MVNS     R3,#+5242880
   \   00000016   1340               ANDS     R3,R3,R2
   \   00000018   8360               STR      R3,[R0, #+8]
    431            }
    432          }
   \                     ??ADC_SoftwareStartConvCmd_1:
   \   0000001A   7047               BX       LR               ;; return
    433          
    434          /*******************************************************************************
    435          * Function Name  : ADC_GetSoftwareStartConvStatus

⌨️ 快捷键说明

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