📄 stm32f10x_tim.lst
字号:
546 tmpccer |= (u16)(TIM_OCInitStruct->TIM_OCPolarity << 12);
547
548 /* Set the Output State */
549 tmpccer |= (u16)(TIM_OCInitStruct->TIM_OutputState << 12);
\ 0000001A .... LDR.N R5,??DataTable26 ;; 0xdfff
\ 0000001C 1D40 ANDS R5,R5,R3
\ 0000001E 0B89 LDRH R3,[R1, #+8]
\ 00000020 4E88 LDRH R6,[R1, #+2]
\ 00000022 1E43 ORRS R6,R6,R3
\ 00000024 55EA0633 ORRS R3,R5,R6, LSL #+12
550
551 /* Set the Capture Compare Register value */
552 TIMx->CCR4 = TIM_OCInitStruct->TIM_Pulse;
\ 00000028 CD88 LDRH R5,[R1, #+6]
\ 0000002A A0F84050 STRH R5,[R0, #+64]
553
554 if((*(u32*)&TIMx == TIM1_BASE) || (*(u32*)&TIMx == TIM8_BASE))
\ 0000002E .... LDR.N R5,??DataTable27 ;; 0x40012c00
\ 00000030 A842 CMP R0,R5
\ 00000032 02D0 BEQ.N ??TIM_OC4Init_0
\ 00000034 .... LDR.N R5,??DataTable28 ;; 0x40013400
\ 00000036 A842 CMP R0,R5
\ 00000038 04D1 BNE.N ??TIM_OC4Init_1
555 {
556 assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState));
557
558 /* Reset the Ouput Compare IDLE State */
559 tmpcr2 &= CR2_OIS4_Reset;
560
561 /* Set the Output Idle state */
562 tmpcr2 |= (u16)(TIM_OCInitStruct->TIM_OCIdleState << 6);
\ ??TIM_OC4Init_0:
\ 0000003A 9204 LSLS R2,R2,#+18
\ 0000003C 920C LSRS R2,R2,#+18
\ 0000003E 8989 LDRH R1,[R1, #+12]
\ 00000040 52EA8112 ORRS R2,R2,R1, LSL #+6
563 }
564
565 /* Write to TIMx CR2 */
566 TIMx->CR2 = tmpcr2;
\ ??TIM_OC4Init_1:
\ 00000044 8280 STRH R2,[R0, #+4]
567
568 /* Write to TIMx CCMR2 */
569 TIMx->CCMR2 = tmpccmrx;
\ 00000046 8483 STRH R4,[R0, #+28]
570
571 /* Write to TIMx CCER */
572 TIMx->CCER = tmpccer;
\ 00000048 0384 STRH R3,[R0, #+32]
573 }
\ 0000004A 70BD POP {R4-R6,PC} ;; return
574
575 /*******************************************************************************
576 * Function Name : TIM_ICInit
577 * Description : Initializes the TIM peripheral according to the specified
578 * parameters in the TIM_ICInitStruct.
579 * Input : - TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM
580 * peripheral.
581 * - TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure
582 * that contains the configuration information for the specified
583 * TIM peripheral.
584 * Output : None
585 * Return : None
586 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
587 void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
588 {
\ TIM_ICInit:
\ 00000000 30B5 PUSH {R4,R5,LR}
\ 00000002 0400 MOVS R4,R0
\ 00000004 0D00 MOVS R5,R1
589 /* Check the parameters */
590 assert_param(IS_TIM_123458_PERIPH(TIMx));
591 assert_param(IS_TIM_CHANNEL(TIM_ICInitStruct->TIM_Channel));
592 assert_param(IS_TIM_IC_POLARITY(TIM_ICInitStruct->TIM_ICPolarity));
593 assert_param(IS_TIM_IC_SELECTION(TIM_ICInitStruct->TIM_ICSelection));
594 assert_param(IS_TIM_IC_PRESCALER(TIM_ICInitStruct->TIM_ICPrescaler));
595 assert_param(IS_TIM_IC_FILTER(TIM_ICInitStruct->TIM_ICFilter));
596
597 if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_1)
\ 00000006 2888 LDRH R0,[R5, #+0]
\ 00000008 0028 CMP R0,#+0
\ 0000000A 0AD1 BNE.N ??TIM_ICInit_0
598 {
599 /* TI1 Configuration */
600 TI1_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
601 TIM_ICInitStruct->TIM_ICSelection,
602 TIM_ICInitStruct->TIM_ICFilter);
\ 0000000C 2B89 LDRH R3,[R5, #+8]
\ 0000000E AA88 LDRH R2,[R5, #+4]
\ 00000010 6988 LDRH R1,[R5, #+2]
\ 00000012 2000 MOVS R0,R4
\ 00000014 ........ BL TI1_Config
603
604 /* Set the Input Capture Prescaler value */
605 TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
\ 00000018 E988 LDRH R1,[R5, #+6]
\ 0000001A 2000 MOVS R0,R4
\ 0000001C ........ BL TIM_SetIC1Prescaler
\ 00000020 30BD POP {R4,R5,PC}
606 }
607 else if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_2)
\ ??TIM_ICInit_0:
\ 00000022 0428 CMP R0,#+4
\ 00000024 0AD1 BNE.N ??TIM_ICInit_1
608 {
609 /* TI2 Configuration */
610 TI2_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
611 TIM_ICInitStruct->TIM_ICSelection,
612 TIM_ICInitStruct->TIM_ICFilter);
\ 00000026 2B89 LDRH R3,[R5, #+8]
\ 00000028 AA88 LDRH R2,[R5, #+4]
\ 0000002A 6988 LDRH R1,[R5, #+2]
\ 0000002C 2000 MOVS R0,R4
\ 0000002E ........ BL TI2_Config
613
614 /* Set the Input Capture Prescaler value */
615 TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
\ 00000032 E988 LDRH R1,[R5, #+6]
\ 00000034 2000 MOVS R0,R4
\ 00000036 ........ BL TIM_SetIC2Prescaler
\ 0000003A 30BD POP {R4,R5,PC}
616 }
617 else if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_3)
\ ??TIM_ICInit_1:
\ 0000003C 0828 CMP R0,#+8
\ 0000003E 2B89 LDRH R3,[R5, #+8]
\ 00000040 AA88 LDRH R2,[R5, #+4]
\ 00000042 6988 LDRH R1,[R5, #+2]
\ 00000044 07D1 BNE.N ??TIM_ICInit_2
618 {
619 /* TI3 Configuration */
620 TI3_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
621 TIM_ICInitStruct->TIM_ICSelection,
622 TIM_ICInitStruct->TIM_ICFilter);
\ 00000046 2000 MOVS R0,R4
\ 00000048 ........ BL TI3_Config
623
624 /* Set the Input Capture Prescaler value */
625 TIM_SetIC3Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
\ 0000004C E988 LDRH R1,[R5, #+6]
\ 0000004E 2000 MOVS R0,R4
\ 00000050 ........ BL TIM_SetIC3Prescaler
\ 00000054 30BD POP {R4,R5,PC}
626 }
627 else
628 {
629 /* TI4 Configuration */
630 TI4_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
631 TIM_ICInitStruct->TIM_ICSelection,
632 TIM_ICInitStruct->TIM_ICFilter);
\ ??TIM_ICInit_2:
\ 00000056 2000 MOVS R0,R4
\ 00000058 ........ BL TI4_Config
633
634 /* Set the Input Capture Prescaler value */
635 TIM_SetIC4Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
\ 0000005C E988 LDRH R1,[R5, #+6]
\ 0000005E 2000 MOVS R0,R4
\ 00000060 ........ BL TIM_SetIC4Prescaler
636 }
637 }
\ 00000064 30BD POP {R4,R5,PC} ;; return
638
639 /*******************************************************************************
640 * Function Name : TIM_PWMIConfig
641 * Description : Configures the TIM peripheral according to the specified
642 * parameters in the TIM_ICInitStruct to measure an external PWM
643 * signal.
644 * Input : - TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM
645 * peripheral.
646 * - TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure
647 * that contains the configuration information for the specified
648 * TIM peripheral.
649 * Output : None
650 * Return : None
651 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
652 void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
653 {
\ TIM_PWMIConfig:
\ 00000000 F0B5 PUSH {R4-R7,LR}
\ 00000002 0400 MOVS R4,R0
\ 00000004 0D00 MOVS R5,R1
654 u16 icoppositepolarity = TIM_ICPolarity_Rising;
655 u16 icoppositeselection = TIM_ICSelection_DirectTI;
656
657 /* Check the parameters */
658 assert_param(IS_TIM_123458_PERIPH(TIMx));
659
660 /* Select the Opposite Input Polarity */
661 if (TIM_ICInitStruct->TIM_ICPolarity == TIM_ICPolarity_Rising)
\ 00000006 0227 MOVS R7,#+2
\ 00000008 6888 LDRH R0,[R5, #+2]
\ 0000000A 0028 CMP R0,#+0
\ 0000000C 01D1 BNE.N ??TIM_PWMIConfig_0
662 {
663 icoppositepolarity = TIM_ICPolarity_Falling;
\ 0000000E 3E00 MOVS R6,R7
\ 00000010 00E0 B.N ??TIM_PWMIConfig_1
664 }
665 else
666 {
667 icoppositepolarity = TIM_ICPolarity_Rising;
\ ??TIM_PWMIConfig_0:
\ 00000012 0026 MOVS R6,#+0
668 }
669
670 /* Select the Opposite Input */
671 if (TIM_ICInitStruct->TIM_ICSelection == TIM_ICSelection_DirectTI)
\ ??TIM_PWMIConfig_1:
\ 00000014 A888 LDRH R0,[R5, #+4]
\ 00000016 0128 CMP R0,#+1
\ 00000018 00D0 BEQ.N ??TIM_PWMIConfig_2
672 {
673 icoppositeselection = TIM_ICSelection_IndirectTI;
674 }
675 else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -