📄 stm32f10x_adc.lst
字号:
\ 00000016 00BF Nop
\ ??ADC_DMACmd_1:
\ 00000018 FFFE0000 DC32 0xfeff
294
295 /*******************************************************************************
296 * Function Name : ADC_ITConfig
297 * Description : Enables or disables the specified ADC interrupts.
298 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
299 * - ADC_IT: specifies the ADC interrupt sources to be enabled
300 * or disabled.
301 * This parameter can be any combination of the following values:
302 * - ADC_IT_EOC: End of conversion interrupt mask
303 * - ADC_IT_AWD: Analog watchdog interrupt mask
304 * - ADC_IT_JEOC: End of injected conversion interrupt mask
305 * - NewState: new state of the specified ADC interrupts.
306 * This parameter can be: ENABLE or DISABLE.
307 * Output : None
308 * Return : None
309 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
310 void ADC_ITConfig(ADC_TypeDef* ADCx, u16 ADC_IT, FunctionalState NewState)
311 {
312 u8 itmask = 0;
313
314 /* Check the parameters */
315 assert(IS_FUNCTIONAL_STATE(NewState));
316 assert(IS_ADC_IT(ADC_IT));
317
318 /* Get the ADC IT index */
319 itmask = (u8)ADC_IT;
\ ADC_ITConfig:
\ 00000000 C9B2 UXTB R1,R1
320
321 if (NewState != DISABLE)
\ 00000002 002A CMP R2,#+0
\ 00000004 4268 LDR R2,[R0, #+4]
\ 00000006 02D0 BEQ.N ??ADC_ITConfig_0
322 {
323 /* Enable the selected ADC interrupts */
324 ADCx->CR1 |= itmask;
\ 00000008 1143 ORRS R1,R1,R2
\ 0000000A 4160 STR R1,[R0, #+4]
\ 0000000C 7047 BX LR
325 }
326 else
327 {
328 /* Disable the selected ADC interrupts */
329 ADCx->CR1 &= (~(u32)itmask);
\ ??ADC_ITConfig_0:
\ 0000000E 8A43 BICS R2,R2,R1
\ 00000010 4260 STR R2,[R0, #+4]
330 }
331 }
\ 00000012 7047 BX LR ;; return
332
333 /*******************************************************************************
334 * Function Name : ADC_ResetCalibration
335 * Description : Resets the selected ADC calibration registers.
336 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
337 * Output : None
338 * Return : None
339 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
340 void ADC_ResetCalibration(ADC_TypeDef* ADCx)
341 {
342 /* Resets the selected ADC calibartion registers */
343 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]
344 }
\ 00000008 7047 BX LR ;; return
345
346 /*******************************************************************************
347 * Function Name : ADC_GetResetCalibrationStatus
348 * Description : Gets the selected ADC reset calibration registers status.
349 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
350 * Output : None
351 * Return : The new state of ADC reset calibration registers (SET or RESET).
352 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
353 FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx)
354 {
355 FlagStatus bitstatus = RESET;
356
357 /* Check the status of RSTCAL bit */
358 if ((ADCx->CR2 & CR2_RSTCAL_Set) != (u16)RESET)
\ ADC_GetResetCalibrationStatus:
\ 00000000 8068 LDR R0,[R0, #+8]
359 {
360 /* RSTCAL bit is set */
361 bitstatus = SET;
362 }
363 else
364 {
365 /* RSTCAL bit is reset */
366 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
367 }
368 /* Return the RSTCAL bit status */
369 return bitstatus;
\ 0000000C 7047 BX LR ;; return
370 }
371
372 /*******************************************************************************
373 * Function Name : ADC_StartCalibration
374 * Description : Starts the selected ADC calibration process.
375 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
376 * Output : None
377 * Return : None
378 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
379 void ADC_StartCalibration(ADC_TypeDef* ADCx)
380 {
381 /* Enable the selected ADC calibration process */
382 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]
383 }
\ 00000008 7047 BX LR ;; return
384
385 /*******************************************************************************
386 * Function Name : ADC_GetCalibrationStatus
387 * Description : Gets the selected ADC calibration status.
388 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
389 * Output : None
390 * Return : The new state of ADC calibration (SET or RESET).
391 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
392 FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx)
393 {
394 FlagStatus bitstatus = RESET;
395
396 /* Check the status of CAL bit */
397 if ((ADCx->CR2 & CR2_CAL_Set) != (u16)RESET)
\ ADC_GetCalibrationStatus:
\ 00000000 8068 LDR R0,[R0, #+8]
398 {
399 /* CAL bit is set: calibration on going */
400 bitstatus = SET;
401 }
402 else
403 {
404 /* CAL bit is reset: end of calibration */
405 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
406 }
407 /* Return the CAL bit status */
408 return bitstatus;
\ 0000000C 7047 BX LR ;; return
409 }
410
411 /*******************************************************************************
412 * Function Name : ADC_SoftwareStartConvCmd
413 * Description : Enables or disables the selected ADC software start conversion .
414 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
415 * - NewState: new state of the selected ADC software start conversion.
416 * This parameter can be: ENABLE or DISABLE.
417 * Output : None
418 * Return : None
419 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
420 void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
421 {
422 /* Check the parameters */
423 assert(IS_FUNCTIONAL_STATE(NewState));
424
425 if (NewState != DISABLE)
\ ADC_SoftwareStartConvCmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 8168 LDR R1,[R0, #+8]
\ 00000004 03D0 BEQ.N ??ADC_SoftwareStartConvCmd_0
426 {
427 /* Enable the selected ADC conversion on external event */
428 /* Starts the selected ADC conversion */
429 ADCx->CR2 |= CR2_EXTTRIG_SWSTRT_Set;
\ 00000006 51F4A001 ORRS R1,R1,#0x500000
\ 0000000A 8160 STR R1,[R0, #+8]
\ 0000000C 7047 BX LR
430 }
431 else
432 {
433 /* Stops the selected ADC conversion */
434 /* Disable the selected ADC conversion on external event */
435 ADCx->CR2 &= CR2_EXTTRIG_SWSTRT_Reset;
\ ??ADC_SoftwareStartConvCmd_0:
\ 0000000E 7FF4A002 MVNS R2,#+5242880
\ 00000012 0A40 ANDS R2,R2,R1
\ 00000014 8260 STR R2,[R0, #+8]
436 }
437 }
\ 00000016 7047 BX LR ;; return
438
439 /*******************************************************************************
440 * Function Name : ADC_GetSoftwareStartConvStatus
441 * Description : Gets the selected ADC Software start conversion Status.
442 * Input : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
443 * Output : None
444 * Return : The new state of ADC software start conversion (SET or RESET).
445 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
446 FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx)
447 {
448 FlagStatus bitstatus = RESET;
449
450 /* Check the status of SWSTRT bit */
451 if ((ADCx->CR2 & CR2_SWSTRT_Set) != (u32)RESET)
\ ADC_GetSoftwareStartConvStatus:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -