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

📄 stm32f10x_adc.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
    294          * Return         : None
    295          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    296          void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    297          {
    298            /* Check the parameters */
    299            assert_param(IS_ADC_DMA_PERIPH(ADCx));
    300            assert_param(IS_FUNCTIONAL_STATE(NewState));
    301          
    302            if (NewState != DISABLE)
   \                     ADC_DMACmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   8168               LDR      R1,[R0, #+8]
   \   00000004   03D0               BEQ.N    ??ADC_DMACmd_0
    303            {
    304              /* Enable the selected ADC DMA request */
    305              ADCx->CR2 |= CR2_DMA_Set;
   \   00000006   51F48071           ORRS     R1,R1,#0x100
   \   0000000A   8160               STR      R1,[R0, #+8]
   \   0000000C   7047               BX       LR
    306            }
    307            else
    308            {
    309              /* Disable the selected ADC DMA request */
    310              ADCx->CR2 &= CR2_DMA_Reset;
   \                     ??ADC_DMACmd_0:
   \   0000000E   7FF48072           MVNS     R2,#+256
   \   00000012   0A40               ANDS     R2,R2,R1
   \   00000014   8260               STR      R2,[R0, #+8]
    311            }
    312          }
   \   00000016   7047               BX       LR               ;; return
    313          
    314          /*******************************************************************************
    315          * Function Name  : ADC_ITConfig
    316          * Description    : Enables or disables the specified ADC interrupts.
    317          * Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
    318          *                  - ADC_IT: specifies the ADC interrupt sources to be enabled
    319          *                    or disabled. 
    320          *                    This parameter can be any combination of the following values:
    321          *                       - ADC_IT_EOC: End of conversion interrupt mask
    322          *                       - ADC_IT_AWD: Analog watchdog interrupt mask
    323          *                       - ADC_IT_JEOC: End of injected conversion interrupt mask
    324          *                  - NewState: new state of the specified ADC interrupts.
    325          *                    This parameter can be: ENABLE or DISABLE.
    326          * Output         : None
    327          * Return         : None
    328          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    329          void ADC_ITConfig(ADC_TypeDef* ADCx, u16 ADC_IT, FunctionalState NewState)
    330          {
    331            u8 itmask = 0;
    332          
    333            /* Check the parameters */
    334            assert_param(IS_ADC_ALL_PERIPH(ADCx));
    335            assert_param(IS_FUNCTIONAL_STATE(NewState));
    336            assert_param(IS_ADC_IT(ADC_IT));
    337          
    338            /* Get the ADC IT index */
    339            itmask = (u8)ADC_IT;
   \                     ADC_ITConfig:
   \   00000000   C9B2               UXTB     R1,R1
    340          
    341            if (NewState != DISABLE)
   \   00000002   002A               CMP      R2,#+0
   \   00000004   4268               LDR      R2,[R0, #+4]
   \   00000006   02D0               BEQ.N    ??ADC_ITConfig_0
    342            {
    343              /* Enable the selected ADC interrupts */
    344              ADCx->CR1 |= itmask;
   \   00000008   1143               ORRS     R1,R1,R2
   \   0000000A   4160               STR      R1,[R0, #+4]
   \   0000000C   7047               BX       LR
    345            }
    346            else
    347            {
    348              /* Disable the selected ADC interrupts */
    349              ADCx->CR1 &= (~(u32)itmask);
   \                     ??ADC_ITConfig_0:
   \   0000000E   8A43               BICS     R2,R2,R1
   \   00000010   4260               STR      R2,[R0, #+4]
    350            }
    351          }
   \   00000012   7047               BX       LR               ;; return
    352          
    353          /*******************************************************************************
    354          * Function Name  : ADC_ResetCalibration
    355          * Description    : Resets the selected ADC calibration registers.
    356          * Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
    357          * Output         : None
    358          * Return         : None
    359          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    360          void ADC_ResetCalibration(ADC_TypeDef* ADCx)
    361          {
    362            /* Check the parameters */
    363            assert_param(IS_ADC_ALL_PERIPH(ADCx));
    364          
    365            /* Resets the selected ADC calibartion registers */  
    366            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]
    367          }
   \   00000008   7047               BX       LR               ;; return
    368          
    369          /*******************************************************************************
    370          * Function Name  : ADC_GetResetCalibrationStatus
    371          * Description    : Gets the selected ADC reset calibration registers status.
    372          * Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
    373          * Output         : None
    374          * Return         : The new state of ADC reset calibration registers (SET or RESET).
    375          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    376          FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx)
    377          {
    378            FlagStatus bitstatus = RESET;
    379          
    380            /* Check the parameters */
    381            assert_param(IS_ADC_ALL_PERIPH(ADCx));
    382          
    383            /* Check the status of RSTCAL bit */
    384            if ((ADCx->CR2 & CR2_RSTCAL_Set) != (u32)RESET)
   \                     ADC_GetResetCalibrationStatus:
   \   00000000   8068               LDR      R0,[R0, #+8]
    385            {
    386              /* RSTCAL bit is set */
    387              bitstatus = SET;
    388            }
    389            else
    390            {
    391              /* RSTCAL bit is reset */
    392              bitstatus = RESET;
   \   00000002   0007               LSLS     R0,R0,#+28
   \   00000004   01D5               BPL.N    ??ADC_GetResetCalibrationStatus_0
   \   00000006   0120               MOVS     R0,#+1
   \   00000008   7047               BX       LR
   \                     ??ADC_GetResetCalibrationStatus_0:
   \   0000000A   0020               MOVS     R0,#+0
    393            }
    394          
    395            /* Return the RSTCAL bit status */
    396            return  bitstatus;
   \   0000000C   7047               BX       LR               ;; return
    397          }
    398          
    399          /*******************************************************************************
    400          * Function Name  : ADC_StartCalibration
    401          * Description    : Starts the selected ADC calibration process.
    402          * Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
    403          * Output         : None
    404          * Return         : None
    405          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    406          void ADC_StartCalibration(ADC_TypeDef* ADCx)
    407          {
    408            /* Check the parameters */
    409            assert_param(IS_ADC_ALL_PERIPH(ADCx));
    410          
    411            /* Enable the selected ADC calibration process */  
    412            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]
    413          }
   \   00000008   7047               BX       LR               ;; return
    414          
    415          /*******************************************************************************
    416          * Function Name  : ADC_GetCalibrationStatus
    417          * Description    : Gets the selected ADC calibration status.
    418          * Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
    419          * Output         : None
    420          * Return         : The new state of ADC calibration (SET or RESET).
    421          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    422          FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx)
    423          {
    424            FlagStatus bitstatus = RESET;
    425          
    426            /* Check the parameters */
    427            assert_param(IS_ADC_ALL_PERIPH(ADCx));
    428          
    429            /* Check the status of CAL bit */
    430            if ((ADCx->CR2 & CR2_CAL_Set) != (u32)RESET)
   \                     ADC_GetCalibrationStatus:
   \   00000000   8068               LDR      R0,[R0, #+8]
    431            {
    432              /* CAL bit is set: calibration on going */
    433              bitstatus = SET;
    434            }
    435            else
    436            {
    437              /* CAL bit is reset: end of calibration */
    438              bitstatus = RESET;
   \   00000002   4007               LSLS     R0,R0,#+29
   \   00000004   01D5               BPL.N    ??ADC_GetCalibrationStatus_0
   \   00000006   0120               MOVS     R0,#+1
   \   00000008   7047               BX       LR
   \                     ??ADC_GetCalibrationStatus_0:
   \   0000000A   0020               MOVS     R0,#+0
    439            }
    440          
    441            /* Return the CAL bit status */
    442            return  bitstatus;
   \   0000000C   7047               BX       LR               ;; return
    443          }
    444          
    445          /*******************************************************************************
    446          * Function Name  : ADC_SoftwareStartConvCmd
    447          * Description    : Enables or disables the selected ADC software start conversion .
    448          * Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
    449          *                  - NewState: new state of the selected ADC software start conversion.
    450          *                    This parameter can be: ENABLE or DISABLE.
    451          * Output         : None
    452          * Return         : None
    453          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    454          void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    455          {

⌨️ 快捷键说明

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