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

📄 stm32f10x_adc.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 4 页
字号:
                  |L11.12|
;;;553      }
;;;554      else
;;;555      {
;;;556        /* Disable the selected ADC regular discontinuous mode */
;;;557        ADCx->CR1 &= CR1_DISCEN_Reset;
00000c  f4216100          BIC      r1,r1,#0x800
                  |L11.16|
000010  6041              STR      r1,[r0,#4]            ;552
;;;558      }
;;;559    }
000012  4770              BX       lr
;;;560    
                          ENDP


                          AREA ||i.ADC_ExternalTrigConvCmd||, CODE, READONLY, ALIGN=1

                  ADC_ExternalTrigConvCmd PROC
;;;702    *******************************************************************************/
;;;703    void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
000000  2900              CMP      r1,#0
;;;704    {
;;;705      /* Check the parameters */
;;;706      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;707      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;708    
;;;709      if (NewState != DISABLE)
;;;710      {
;;;711        /* Enable the selected ADC conversion on external event */
;;;712        ADCx->CR2 |= CR2_EXTTRIG_Set;
000002  6881              LDR      r1,[r0,#8]
000004  d002              BEQ      |L12.12|
000006  f4411180          ORR      r1,r1,#0x100000
00000a  e001              B        |L12.16|
                  |L12.12|
;;;713      }
;;;714      else
;;;715      {
;;;716        /* Disable the selected ADC conversion on external event */
;;;717        ADCx->CR2 &= CR2_EXTTRIG_Reset;
00000c  f4211180          BIC      r1,r1,#0x100000
                  |L12.16|
000010  6081              STR      r1,[r0,#8]            ;712
;;;718      }
;;;719    }
000012  4770              BX       lr
;;;720    
                          ENDP


                          AREA ||i.ADC_ExternalTrigInjectedConvCmd||, CODE, READONLY, ALIGN=1

                  ADC_ExternalTrigInjectedConvCmd PROC
;;;873    *******************************************************************************/
;;;874    void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
000000  2900              CMP      r1,#0
;;;875    {
;;;876      /* Check the parameters */
;;;877      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;878      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;879    
;;;880      if (NewState != DISABLE)
;;;881      {
;;;882        /* Enable the selected ADC external event selection for injected group */
;;;883        ADCx->CR2 |= CR2_JEXTTRIG_Set;
000002  6881              LDR      r1,[r0,#8]
000004  d002              BEQ      |L13.12|
000006  f4414100          ORR      r1,r1,#0x8000
00000a  e001              B        |L13.16|
                  |L13.12|
;;;884      }
;;;885      else
;;;886      {
;;;887        /* Disable the selected ADC external event selection for injected group */
;;;888        ADCx->CR2 &= CR2_JEXTTRIG_Reset;
00000c  f4214100          BIC      r1,r1,#0x8000
                  |L13.16|
000010  6081              STR      r1,[r0,#8]            ;883
;;;889      }
;;;890    }
000012  4770              BX       lr
;;;891    
                          ENDP


                          AREA ||i.ADC_ExternalTrigInjectedConvConfig||, CODE, READONLY, ALIGN=1

                  ADC_ExternalTrigInjectedConvConfig PROC
;;;844    *******************************************************************************/
;;;845    void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, u32 ADC_ExternalTrigInjecConv)
000000  6882              LDR      r2,[r0,#8]
;;;846    {
;;;847      u32 tmpreg = 0;
;;;848    
;;;849      /* Check the parameters */
;;;850      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;851      assert_param(IS_ADC_EXT_INJEC_TRIG(ADC_ExternalTrigInjecConv));
;;;852    
;;;853      /* Get the old register value */
;;;854      tmpreg = ADCx->CR2;
;;;855      /* Clear the old external event selection for injected group */
;;;856      tmpreg &= CR2_JEXTSEL_Reset;
000002  f42242e0          BIC      r2,r2,#0x7000
;;;857      /* Set the external event selection for injected group */
;;;858      tmpreg |= ADC_ExternalTrigInjecConv;
000006  430a              ORRS     r2,r2,r1
;;;859      /* Store the new register value */
;;;860      ADCx->CR2 = tmpreg;
000008  6082              STR      r2,[r0,#8]
;;;861    }
00000a  4770              BX       lr
;;;862    
                          ENDP


                          AREA ||i.ADC_GetCalibrationStatus||, CODE, READONLY, ALIGN=1

                  ADC_GetCalibrationStatus PROC
;;;419    *******************************************************************************/
;;;420    FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx)
000000  4601              MOV      r1,r0
;;;421    {
;;;422      FlagStatus bitstatus = RESET;
;;;423    
;;;424      /* Check the parameters */
;;;425      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;426    
;;;427      /* Check the status of CAL bit */
;;;428      if ((ADCx->CR2 & CR2_CAL_Set) != (u32)RESET)
000002  6889              LDR      r1,[r1,#8]
000004  2000              MOVS     r0,#0                 ;422
000006  0749              LSLS     r1,r1,#29
000008  d500              BPL      |L15.12|
;;;429      {
;;;430        /* CAL bit is set: calibration on going */
;;;431        bitstatus = SET;
00000a  2001              MOVS     r0,#1
                  |L15.12|
;;;432      }
;;;433      else
;;;434      {
;;;435        /* CAL bit is reset: end of calibration */
;;;436        bitstatus = RESET;
;;;437      }
;;;438    
;;;439      /* Return the CAL bit status */
;;;440      return  bitstatus;
;;;441    }
00000c  4770              BX       lr
;;;442    
                          ENDP


                          AREA ||i.ADC_GetConversionValue||, CODE, READONLY, ALIGN=1

                  ADC_GetConversionValue PROC
;;;727    *******************************************************************************/
;;;728    u16 ADC_GetConversionValue(ADC_TypeDef* ADCx)
000000  6cc0              LDR      r0,[r0,#0x4c]
;;;729    {
;;;730      /* Check the parameters */
;;;731      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;732    
;;;733      /* Return the selected ADC conversion value */
;;;734      return (u16) ADCx->DR;
000002  b280              UXTH     r0,r0
;;;735    }
000004  4770              BX       lr
;;;736    
                          ENDP


                          AREA ||i.ADC_GetDualModeConversionValue||, CODE, READONLY, ALIGN=2

                  ADC_GetDualModeConversionValue PROC
;;;742    *******************************************************************************/
;;;743    u32 ADC_GetDualModeConversionValue(void)
000000  4801              LDR      r0,|L17.8|
;;;744    {
;;;745      /* Return the dual mode conversion value */
;;;746      return (*(vu32 *) DR_ADDRESS);
000002  6800              LDR      r0,[r0,#0]
;;;747    }
000004  4770              BX       lr
;;;748    
                          ENDP

000006  0000              DCW      0x0000
                  |L17.8|
                          DCD      0x4001244c

                          AREA ||i.ADC_GetFlagStatus||, CODE, READONLY, ALIGN=1

                  ADC_GetFlagStatus PROC
;;;1283   *******************************************************************************/
;;;1284   FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, u8 ADC_FLAG)
000000  4602              MOV      r2,r0
;;;1285   {
;;;1286     FlagStatus bitstatus = RESET;
;;;1287   
;;;1288     /* Check the parameters */
;;;1289     assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;1290     assert_param(IS_ADC_GET_FLAG(ADC_FLAG));
;;;1291   
;;;1292     /* Check the status of the specified ADC flag */
;;;1293     if ((ADCx->SR & ADC_FLAG) != (u8)RESET)
000002  6812              LDR      r2,[r2,#0]
000004  2000              MOVS     r0,#0                 ;1286
000006  420a              TST      r2,r1
000008  d000              BEQ      |L18.12|
;;;1294     {
;;;1295       /* ADC_FLAG is set */
;;;1296       bitstatus = SET;
00000a  2001              MOVS     r0,#1
                  |L18.12|
;;;1297     }
;;;1298     else
;;;1299     {
;;;1300       /* ADC_FLAG is reset */
;;;1301       bitstatus = RESET;
;;;1302     }
;;;1303   
;;;1304     /* Return the ADC_FLAG status */
;;;1305     return  bitstatus;
;;;1306   }
00000c  4770              BX       lr
;;;1307   
                          ENDP


                          AREA ||i.ADC_GetITStatus||, CODE, READONLY, ALIGN=1

                  ADC_GetITStatus PROC
;;;1343   *******************************************************************************/
;;;1344   ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, u16 ADC_IT)
000000  b530              PUSH     {r4,r5,lr}
;;;1345   {
000002  4602              MOV      r2,r0
;;;1346     ITStatus bitstatus = RESET;
000004  2000              MOVS     r0,#0
;;;1347     u32 itmask = 0, enablestatus = 0;
;;;1348   
;;;1349     /* Check the parameters */
;;;1350     assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;1351     assert_param(IS_ADC_GET_IT(ADC_IT));
;;;1352   
;;;1353     /* Get the ADC IT index */
;;;1354     itmask = ADC_IT >> 8;
;;;1355   
;;;1356     /* Get the ADC_IT enable bit status */
;;;1357     enablestatus = (ADCx->CR1 & (u8)ADC_IT) ;
000006  6854              LDR      r4,[r2,#4]
000008  0a0b              LSRS     r3,r1,#8              ;1354
00000a  b2cd              UXTB     r5,r1
;;;1358   
;;;1359     /* Check the status of the specified ADC interrupt */
;;;1360     if (((ADCx->SR & itmask) != (u32)RESET) && enablestatus)
00000c  6811              LDR      r1,[r2,#0]
00000e  402c              ANDS     r4,r4,r5              ;1357
000010  4219              TST      r1,r3
000012  d002              BEQ      |L19.26|
000014  2c00              CMP      r4,#0
000016  d000              BEQ      |L19.26|
;;;1361     {
;;;1362       /* ADC_IT is set */
;;;1363       bitstatus = SET;
000018  2001              MOVS     r0,#1
                  |L19.26|
;;;1364     }
;;;1365     else
;;;1366     {
;;;1367       /* ADC_IT is reset */
;;;1368       bitstatus = RESET;
;;;1369     }
;;;1370   
;;;1371     /* Return the ADC_IT status */
;;;1372     return  bitstatus;
;;;1373   }
00001a  bd30              POP      {r4,r5,pc}
;;;1374   
                          ENDP


                          AREA ||i.ADC_GetInjectedConversionValue||, CODE, READONLY, ALIGN=1

                  ADC_GetInjectedConversionValue PROC
;;;1121   *******************************************************************************/
;;;1122   u16 ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, u8 ADC_InjectedChannel)
000000  4408              ADD      r0,r0,r1
;;;1123   {
;;;1124     /* Check the parameters */
;;;1125     assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;1126     assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));
;;;1127   
;;;1128     /* Returns the selected injected channel conversion data value */
;;;1129     return (u16) (*(vu32*) (((*(u32*)&ADCx) + ADC_InjectedChannel + JDR_Offset)));
000002  6a80              LDR      r0,[r0,#0x28]
000004  b280              UXTH     r0,r0
;;;1130   }
000006  4770              BX       lr
;;;1131   
                          ENDP


                          AREA ||i.ADC_GetResetCalibrationStatus||, CODE, READONLY, ALIGN=1

                  ADC_GetResetCalibrationStatus PROC
;;;373    *******************************************************************************/
;;;374    FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx)
000000  4601              MOV      r1,r0
;;;375    {
;;;376      FlagStatus bitstatus = RESET;
;;;377    
;;;378      /* Check the parameters */
;;;379      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;380    
;;;381      /* Check the status of RSTCAL bit */
;;;382      if ((ADCx->CR2 & CR2_RSTCAL_Set) != (u32)RESET)
000002  6889              LDR      r1,[r1,#8]
000004  2000              MOVS     r0,#0                 ;376
000006  0709              LSLS     r1,r1,#28
000008  d500              BPL      |L21.12|
;;;383      {
;;;384        /* RSTCAL bit is set */
;;;385        bitstatus = SET;
00000a  2001              MOVS     r0,#1
                  |L21.12|
;;;386      }
;;;387      else
;;;388      {
;;;389        /* RSTCAL bit is reset */
;;;390        bitstatus = RESET;
;;;391      }
;;;392    
;;;393      /* Return the RSTCAL bit status */
;;;394      return  bitstatus;
;;;395    }
00000c  4770              BX       lr
;;;396    
                          ENDP


                          AREA ||i.ADC_GetSoftwareStartConvStatus||, CODE, READONLY, ALIGN=1

                  ADC_GetSoftwareStartConvStatus PROC
;;;478    *******************************************************************************/
;;;479    FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx)
000000  4601              MOV      r1,r0
;;;480    {
;;;481      FlagStatus bitstatus = RESET;
;;;482    
;;;483      /* Check the parameters */
;;;484      assert_param(IS_ADC_ALL_PERIPH(ADCx));
;;;485    
;;;486      /* Check the status of SWSTART bit */
;;;487      if ((ADCx->CR2 & CR2_SWSTART_Set) != (u32)RESET)
000002  6889              LDR      r1,[r1,#8]
000004  2000              MOVS     r0,#0                 ;481
000006  0249              LSLS     r1,r1,#9
000008  d500              BPL      |L22.12|
;;;488      {

⌨️ 快捷键说明

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