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

📄 stm32f10x_adc.lst

📁 完成数据的采集
💻 LST
📖 第 1 页 / 共 5 页
字号:
    161            /* Check the parameters */
    162            assert_param(IS_ADC_MODE(ADC_InitStruct->ADC_Mode));
    163            assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ScanConvMode));
    164            assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ContinuousConvMode));  		    
    165            assert_param(IS_ADC_EXT_TRIG(ADC_InitStruct->ADC_ExternalTrigConv));   
    166            assert_param(IS_ADC_DATA_ALIGN(ADC_InitStruct->ADC_DataAlign)); 
    167            assert_param(IS_ADC_REGULAR_LENGTH(ADC_InitStruct->ADC_NbrOfChannel));
    168          
    169            /*---------------------------- ADCx CR1 Configuration -----------------*/
    170            /* Get the ADCx CR1 value */
    171            tmpreg1 = ADCx->CR1;
   \   0000000A   4468               LDR      R4,[R0, #+4]
   \   0000000C   2300               MOVS     R3,R4
    172            /* Clear DUALMODE and SCAN bits */
    173            tmpreg1 &= CR1_CLEAR_Mask;
   \   0000000E   1C00               MOVS     R4,R3
   \   00000010   134B               LDR.N    R3,??ADC_Init_0  ;; 0xfff0feff
   \   00000012   2340               ANDS     R3,R3,R4
    174            /* Configure ADCx: Dual mode and scan conversion mode */
    175            /* Set DUALMODE bits according to ADC_Mode value */
    176            /* Set SCAN bit according to ADC_ScanConvMode value */
    177            tmpreg1 |= (u32)(ADC_InitStruct->ADC_Mode | ((u32)ADC_InitStruct->ADC_ScanConvMode << 8));
   \   00000014   1D00               MOVS     R5,R3
   \   00000016   0B68               LDR      R3,[R1, #+0]
   \   00000018   0C79               LDRB     R4,[R1, #+4]
   \   0000001A   53EA0423           ORRS     R3,R3,R4, LSL #+8
   \   0000001E   2B43               ORRS     R3,R3,R5
    178            /* Write to ADCx CR1 */
    179            ADCx->CR1 = tmpreg1;
   \   00000020   4360               STR      R3,[R0, #+4]
    180          
    181            /*---------------------------- ADCx CR2 Configuration -----------------*/
    182            /* Get the ADCx CR2 value */
    183            tmpreg1 = ADCx->CR2;
   \   00000022   8468               LDR      R4,[R0, #+8]
   \   00000024   2300               MOVS     R3,R4
    184            /* Clear CONT, ALIGN and EXTTRIG bits */
    185            tmpreg1 &= CR2_CLEAR_Mask;
   \   00000026   1C00               MOVS     R4,R3
   \   00000028   0E4B               LDR.N    R3,??ADC_Init_0+0x4  ;; 0xfff1f7fd
   \   0000002A   2340               ANDS     R3,R3,R4
    186            /* Configure ADCx: external trigger event and continuous conversion mode */
    187            /* Set ALIGN bit according to ADC_DataAlign value */
    188            /* Set EXTTRIG bits according to ADC_ExternalTrigConv value */
    189            /* Set CONT bit according to ADC_ContinuousConvMode value */
    190            tmpreg1 |= (u32)(ADC_InitStruct->ADC_DataAlign | ADC_InitStruct->ADC_ExternalTrigConv |
    191                      ((u32)ADC_InitStruct->ADC_ContinuousConvMode << 1));
   \   0000002C   1D00               MOVS     R5,R3
   \   0000002E   CB68               LDR      R3,[R1, #+12]
   \   00000030   8C68               LDR      R4,[R1, #+8]
   \   00000032   1C43               ORRS     R4,R4,R3
   \   00000034   4B79               LDRB     R3,[R1, #+5]
   \   00000036   54EA4303           ORRS     R3,R4,R3, LSL #+1
   \   0000003A   2B43               ORRS     R3,R3,R5
    192            /* Write to ADCx CR2 */
    193            ADCx->CR2 = tmpreg1;
   \   0000003C   8360               STR      R3,[R0, #+8]
    194          
    195            /*---------------------------- ADCx SQR1 Configuration -----------------*/
    196            /* Get the ADCx SQR1 value */
    197            tmpreg1 = ADCx->SQR1;
   \   0000003E   C46A               LDR      R4,[R0, #+44]
   \   00000040   2300               MOVS     R3,R4
    198            /* Clear L bits */
    199            tmpreg1 &= SQR1_CLEAR_Mask;
   \   00000042   1C00               MOVS     R4,R3
   \   00000044   7FF47003           MVNS     R3,#+15728640
   \   00000048   2340               ANDS     R3,R3,R4
    200            /* Configure ADCx: regular channel sequence length */
    201            /* Set L bits according to ADC_NbrOfChannel value */
    202            tmpreg2 |= (ADC_InitStruct->ADC_NbrOfChannel - 1);
   \   0000004A   1400               MOVS     R4,R2
   \   0000004C   0A7C               LDRB     R2,[R1, #+16]
   \   0000004E   521E               SUBS     R2,R2,#+1
   \   00000050   2243               ORRS     R2,R2,R4
    203            tmpreg1 |= ((u32)tmpreg2 << 20);
   \   00000052   D2B2               UXTB     R2,R2            ;; ZeroExtS R2,R2,#+24,#+24
   \   00000054   53EA0253           ORRS     R3,R3,R2, LSL #+20
    204            /* Write to ADCx SQR1 */
    205            ADCx->SQR1 = tmpreg1;
   \   00000058   C362               STR      R3,[R0, #+44]
    206          }
   \   0000005A   30BC               POP      {R4,R5}
   \   0000005C   7047               BX       LR               ;; return
   \   0000005E   00BF               Nop      
   \                     ??ADC_Init_0:
   \   00000060   FFFEF0FF           DC32     0xfff0feff
   \   00000064   FDF7F1FF           DC32     0xfff1f7fd
    207          
    208          /*******************************************************************************
    209          * Function Name  : ADC_StructInit
    210          * Description    : Fills each ADC_InitStruct member with its default value.
    211          * Input          : ADC_InitStruct : pointer to an ADC_InitTypeDef structure
    212          *                  which will be initialized.
    213          * Output         : None
    214          * Return         : None
    215          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    216          void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct)
    217          {
    218            /* Reset ADC init structure parameters values */
    219            /* Initialize the ADC_Mode member */
    220            ADC_InitStruct->ADC_Mode = ADC_Mode_Independent;
   \                     ADC_StructInit:
   \   00000000   0021               MOVS     R1,#+0
   \   00000002   0160               STR      R1,[R0, #+0]
    221          
    222            /* initialize the ADC_ScanConvMode member */
    223            ADC_InitStruct->ADC_ScanConvMode = DISABLE;
   \   00000004   0021               MOVS     R1,#+0
   \   00000006   0171               STRB     R1,[R0, #+4]
    224          
    225            /* Initialize the ADC_ContinuousConvMode member */
    226            ADC_InitStruct->ADC_ContinuousConvMode = DISABLE;
   \   00000008   0021               MOVS     R1,#+0
   \   0000000A   4171               STRB     R1,[R0, #+5]
    227          
    228            /* Initialize the ADC_ExternalTrigConv member */
    229            ADC_InitStruct->ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1;
   \   0000000C   0021               MOVS     R1,#+0
   \   0000000E   8160               STR      R1,[R0, #+8]
    230          
    231            /* Initialize the ADC_DataAlign member */
    232            ADC_InitStruct->ADC_DataAlign = ADC_DataAlign_Right;
   \   00000010   0021               MOVS     R1,#+0
   \   00000012   C160               STR      R1,[R0, #+12]
    233          
    234            /* Initialize the ADC_NbrOfChannel member */
    235            ADC_InitStruct->ADC_NbrOfChannel = 1;
   \   00000014   0121               MOVS     R1,#+1
   \   00000016   0174               STRB     R1,[R0, #+16]
    236          }
   \   00000018   7047               BX       LR               ;; return
    237          
    238          /*******************************************************************************
    239          * Function Name  : ADC_Cmd
    240          * Description    : Enables or disables the specified ADC peripheral.
    241          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    242          *                  - NewState: new state of the ADCx peripheral. This parameter
    243          *                    can be: ENABLE or DISABLE.
    244          * Output         : None
    245          * Return         : None
    246          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    247          void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    248          {
    249            /* Check the parameters */
    250            assert_param(IS_FUNCTIONAL_STATE(NewState));
    251          
    252            if (NewState != DISABLE)
   \                     ADC_Cmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??ADC_Cmd_0
    253            {
    254              /* Set the ADON bit to wake up the ADC from power down mode */
    255              ADCx->CR2 |= CR2_ADON_Set;
   \   00000006   8268               LDR      R2,[R0, #+8]
   \   00000008   52F00102           ORRS     R2,R2,#0x1
   \   0000000C   8260               STR      R2,[R0, #+8]
   \   0000000E   03E0               B.N      ??ADC_Cmd_1
    256            }
    257            else
    258            {
    259              /* Disable the selected ADC peripheral */
    260              ADCx->CR2 &= CR2_ADON_Reset;
   \                     ??ADC_Cmd_0:
   \   00000010   8268               LDR      R2,[R0, #+8]
   \   00000012   0123               MOVS     R3,#+1
   \   00000014   9A43               BICS     R2,R2,R3
   \   00000016   8260               STR      R2,[R0, #+8]
    261            }
    262          }
   \                     ??ADC_Cmd_1:
   \   00000018   7047               BX       LR               ;; return
    263          
    264          /*******************************************************************************
    265          * Function Name  : ADC_DMACmd
    266          * Description    : Enables or disables the specified ADC DMA request.
    267          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    268          *                  - NewState: new state of the selected ADC DMA transfer.
    269          *                    This parameter can be: ENABLE or DISABLE.
    270          * Output         : None
    271          * Return         : None
    272          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    273          void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState)
    274          {
    275            /* Check the parameters */
    276            assert_param(IS_FUNCTIONAL_STATE(NewState));
    277          
    278            if (NewState != DISABLE)
   \                     ADC_DMACmd:
   \   00000000   C9B2               UXTB     R1,R1            ;; ZeroExtS R1,R1,#+24,#+24
   \   00000002   0029               CMP      R1,#+0
   \   00000004   04D0               BEQ.N    ??ADC_DMACmd_0
    279            {
    280              /* Enable the selected ADC DMA request */
    281              ADCx->CR2 |= CR2_DMA_Set;
   \   00000006   8268               LDR      R2,[R0, #+8]
   \   00000008   52F48072           ORRS     R2,R2,#0x100
   \   0000000C   8260               STR      R2,[R0, #+8]
   \   0000000E   03E0               B.N      ??ADC_DMACmd_1
    282            }
    283            else
    284            {
    285              /* Disable the selected ADC DMA request */
    286              ADCx->CR2 &= CR2_DMA_Reset;
   \                     ??ADC_DMACmd_0:
   \   00000010   8268               LDR      R2,[R0, #+8]
   \   00000012   024B               LDR.N    R3,??ADC_DMACmd_2  ;; 0xfeff
   \   00000014   1340               ANDS     R3,R3,R2
   \   00000016   8360               STR      R3,[R0, #+8]
    287            }
    288          }
   \                     ??ADC_DMACmd_1:
   \   00000018   7047               BX       LR               ;; return
   \   0000001A   00BF               Nop      
   \                     ??ADC_DMACmd_2:
   \   0000001C   FFFE0000           DC32     0xfeff
    289          
    290          /*******************************************************************************
    291          * Function Name  : ADC_ITConfig
    292          * Description    : Enables or disables the specified ADC interrupts.
    293          * Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
    294          *                  - ADC_IT: specifies the ADC interrupt sources to be enabled

⌨️ 快捷键说明

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