📄 stm32f10x_tim.lst
字号:
540 {
\ TIM_DMACmd:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 0300 MOVS R3,R0
541 u32 tmpdier = 0;
542
543 /* Check the parameters */
544 assert(IS_TIM_DMA_SOURCE(TIM_DMASource));
545 assert(IS_FUNCTIONAL_STATE(Newstate));
546
547 tmpdier = TIMx->DIER;
\ 00000004 9C89 LDRH R4,[R3, #+12]
548
549 if (Newstate != DISABLE)
\ 00000006 002A CMP R2,#+0
\ 00000008 01D0 BEQ.N ??TIM_DMACmd_0
550 {
551 /* Enable the DMA sources */
552 tmpdier |= TIM_DMASource;
\ 0000000A 2143 ORRS R1,R1,R4
\ 0000000C 03E0 B.N ??TIM_DMACmd_1
553 }
554 else
555 {
556 /* Disable the DMA sources */
557 tmpdier &= (u16)(~TIM_DMASource);
\ ??TIM_DMACmd_0:
\ 0000000E C843 MVNS R0,R1
\ 00000010 80B2 UXTH R0,R0
\ 00000012 0100 MOVS R1,R0
\ 00000014 2140 ANDS R1,R1,R4
558 }
559 TIMx->DIER = (u16)tmpdier;
\ ??TIM_DMACmd_1:
\ 00000016 9981 STRH R1,[R3, #+12]
560 }
\ 00000018 10BD POP {R4,PC} ;; return
561
562 /*******************************************************************************
563 * Function Name : TIM_InternalClockConfig
564 * Description : Configures the TIMx interrnal Clock
565 * Input : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
566 * Output : None
567 * Return : None
568 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
569 void TIM_InternalClockConfig(TIM_TypeDef* TIMx)
570 {
571 /* Disable slave mode to clock the prescaler directly with the internal clock */
572 TIMx->SMCR &= SMCR_SMS_Mask;
\ TIM_InternalClockConfig:
\ 00000000 0189 LDRH R1,[R0, #+8]
\ 00000002 .... LDR.N R2,??DataTable23 ;; 0xfff0
\ 00000004 0A40 ANDS R2,R2,R1
\ 00000006 0281 STRH R2,[R0, #+8]
573 }
\ 00000008 7047 BX LR ;; return
574 /*******************************************************************************
575 * Function Name : TIM_ITRxExternalClockConfig
576 * Description : Configures the TIMx Internal Trigger as External Clock
577 * Input : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
578 * - TIM_ITRSource: Trigger source.
579 * This parameter can be one of the following values:
580 * - TIM_TS_ITR0: Internal Trigger 0
581 * - TIM_TS_ITR1: Internal Trigger 1
582 * - TIM_TS_ITR2: Internal Trigger 2
583 * - TIM_TS_ITR3: Internal Trigger 3
584 * Output : None
585 * Return : None
586 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
587 void TIM_ITRxExternalClockConfig(TIM_TypeDef* TIMx, u16 TIM_InputTriggerSource)
588 {
\ TIM_ITRxExternalClockConfig:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 0400 MOVS R4,R0
589 /* Check the parameters */
590 assert(IS_TIM_INTERNAL_TRIGGER_SELECTION(TIM_InputTriggerSource));
591
592 /* Select the Internal Trigger */
593 TIM_SelectInputTrigger(TIMx, TIM_InputTriggerSource);
\ 00000004 ........ BL TIM_SelectInputTrigger
594
595 /* Select the External clock mode1 */
596 TIMx->SMCR |= TIM_SlaveMode_External1;
\ 00000008 2089 LDRH R0,[R4, #+8]
\ 0000000A 50F00700 ORRS R0,R0,#0x7
\ 0000000E 2081 STRH R0,[R4, #+8]
597 }
\ 00000010 10BD POP {R4,PC} ;; return
598 /*******************************************************************************
599 * Function Name : TIM_TIxExternalClockConfig
600 * Description : Configures the TIMx Trigger as External Clock
601 * Input : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
602 * - TIM_TIxExternalCLKSource: Trigger source.
603 * This parameter can be one of the following values:
604 * - TIM_TS_TI1F_ED: TI1 Edge Detector
605 * - TIM_TS_TI1FP1: Filtered Timer Input 1
606 * - TIM_TS_TI2FP2: Filtered Timer Input 2
607 * - TIM_ICPolarity: specifies the TIx Polarity.
608 * This parameter can be:
609 * - TIM_ICPolarity_Rising
610 * - TIM_ICPolarity_Falling
611 * - ICFilter : specifies the filter value.
612 * This parameter must be a value between 0x0 and 0xF.
613 * Output : None
614 * Return : None
615 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
616 void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, u16 TIM_TIxExternalCLKSource,
617 u16 TIM_ICPolarity, u8 ICFilter)
618 {
\ TIM_TIxExternalClockConfig:
\ 00000000 30B5 PUSH {R4,R5,LR}
\ 00000002 0400 MOVS R4,R0
\ 00000004 0D00 MOVS R5,R1
\ 00000006 1100 MOVS R1,R2
619 /* Check the parameters */
620 assert(IS_TIM_TIX_TRIGGER_SELECTION(TIM_TIxExternalCLKSource));
621 assert(IS_TIM_IC_POLARITY(TIM_ICPolarity));
622 assert(IS_TIM_IC_FILTER(ICFilter));
623
624 /* Configure the Timer Input Clock Source */
625 if (TIM_TIxExternalCLKSource == TIM_TIxExternalCLK1Source_TI2)
\ 00000008 602D CMP R5,#+96
\ 0000000A 03D1 BNE.N ??TIM_TIxExternalClockConfig_0
626 {
627 TI2_Config(TIMx, TIM_ICPolarity, TIM_ICSelection_DirectTI, ICFilter);
\ 0000000C 0122 MOVS R2,#+1
\ 0000000E ........ BL TI2_Config
\ 00000012 02E0 B.N ??TIM_TIxExternalClockConfig_1
628 }
629 else
630 {
631 TI1_Config(TIMx, TIM_ICPolarity, TIM_ICSelection_DirectTI, ICFilter);
\ ??TIM_TIxExternalClockConfig_0:
\ 00000014 0122 MOVS R2,#+1
\ 00000016 ........ BL TI1_Config
632 }
633
634 /* Select the Trigger source */
635 TIM_SelectInputTrigger(TIMx, TIM_TIxExternalCLKSource);
\ ??TIM_TIxExternalClockConfig_1:
\ 0000001A 2900 MOVS R1,R5
\ 0000001C 2000 MOVS R0,R4
\ 0000001E ........ BL TIM_SelectInputTrigger
636
637 /* Select the External clock mode1 */
638 TIMx->SMCR |= TIM_SlaveMode_External1;
\ 00000022 2089 LDRH R0,[R4, #+8]
\ 00000024 50F00700 ORRS R0,R0,#0x7
\ 00000028 2081 STRH R0,[R4, #+8]
639 }
\ 0000002A 30BD POP {R4,R5,PC} ;; return
640
641 /*******************************************************************************
642 * Function Name : TIM_ETRClockMode1Config
643 * Description : Configures the External clock Mode1
644 * Input : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
645 * - TIM_ExtTRGPrescaler: The external Trigger Prescaler.
646 * It can be one of the following values:
647 * - TIM_ExtTRGPSC_OFF
648 * - TIM_ExtTRGPSC_DIV2
649 * - TIM_ExtTRGPSC_DIV4
650 * - TIM_ExtTRGPSC_DIV8.
651 * - TIM_ExtTRGPolarity: The external Trigger Polarity.
652 * It can be one of the following values:
653 * - TIM_ExtTRGPolarity_Inverted
654 * - TIM_ExtTRGPolarity_NonInverted
655 * - ExtTRGFilter: External Trigger Filter.
656 * This parameter must be a value between 0x00 and 0x0F
657 * Output : None
658 * Return : None
659 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
660 void TIM_ETRClockMode1Config(TIM_TypeDef* TIMx, u16 TIM_ExtTRGPrescaler, u16 TIM_ExtTRGPolarity,
661 u8 ExtTRGFilter)
662 {
\ TIM_ETRClockMode1Config:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 0400 MOVS R4,R0
663 /* Check the parameters */
664 assert(IS_TIM_EXT_PRESCALER(TIM_ExtTRGPrescaler));
665 assert(IS_TIM_EXT_POLARITY(TIM_ExtTRGPolarity));
666
667 /* Configure the ETR Clock source */
668 TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);
\ 00000004 ........ BL TIM_ETRConfig
669
670 /* Select the External clock mode1 */
671 TIMx->SMCR &= SMCR_SMS_Mask;
\ 00000008 2089 LDRH R0,[R4, #+8]
\ 0000000A .... LDR.N R1,??DataTable23 ;; 0xfff0
\ 0000000C 0140 ANDS R1,R1,R0
\ 0000000E 2181 STRH R1,[R4, #+8]
672 TIMx->SMCR |= TIM_SlaveMode_External1;
\ 00000010 2089 LDRH R0,[R4, #+8]
\ 00000012 50F00700 ORRS R0,R0,#0x7
\ 00000016 2081 STRH R0,[R4, #+8]
673
674 /* Select the Trigger selection : ETRF */
675 TIMx->SMCR &= SMCR_TS_Mask;
\ 00000018 2089 LDRH R0,[R4, #+8]
\ 0000001A .... LDR.N R1,??DataTable7 ;; 0xff87
\ 0000001C 0140 ANDS R1,R1,R0
\ 0000001E 2181 STRH R1,[R4, #+8]
676 TIMx->SMCR |= TIM_TS_ETRF;
\ 00000020 2089 LDRH R0,[R4, #+8]
\ 00000022 50F07000 ORRS R0,R0,#0x70
\ 00000026 2081 STRH R0,[R4, #+8]
677 }
\ 00000028 10BD POP {R4,PC} ;; return
678
679 /*******************************************************************************
680 * Function Name : TIM_ETRClockMode2Config
681
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -