📄 stm32f10x_usart.s79
字号:
// 473 assert_param(IS_USART_WAKEUP(USART_WakeUp));
// 474
// 475 USARTx->CR1 &= CR1_WAKE_Mask;
USART_WakeUpConfig:
LDRH R2,[R0, #+12]
LDR.N R3,??USART_WakeUpConfig_0 ;; 0xf7ff
ANDS R3,R3,R2
STRH R3,[R0, #+12]
// 476 USARTx->CR1 |= USART_WakeUp;
LDRH R2,[R0, #+12]
ORRS R1,R1,R2
STRH R1,[R0, #+12]
// 477 }
BX LR ;; return
DATA
??USART_WakeUpConfig_0:
DC32 0xf7ff
CFI EndBlock cfiBlock9
// 478
// 479 /*******************************************************************************
// 480 * Function Name : USART_ReceiverWakeUpCmd
// 481 * Description : Determines if the USART is in mute mode or not.
// 482 * Input : - USARTx: Select the USART or the UART peripheral.
// 483 * This parameter can be one of the following values:
// 484 * - USART1, USART2, USART3, UART4 or UART5.
// 485 * - NewState: new state of the USART mute mode.
// 486 * This parameter can be: ENABLE or DISABLE.
// 487 * Output : None
// 488 * Return : None
// 489 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock10 Using cfiCommon0
CFI Function USART_ReceiverWakeUpCmd
THUMB
// 490 void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState)
// 491 {
// 492 /* Check the parameters */
// 493 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 494 assert_param(IS_FUNCTIONAL_STATE(NewState));
// 495
// 496 if (NewState != DISABLE)
USART_ReceiverWakeUpCmd:
CMP R1,#+0
LDRH R1,[R0, #+12]
BEQ.N ??USART_ReceiverWakeUpCmd_0
// 497 {
// 498 /* Enable the USART mute mode by setting the RWU bit in the CR1 register */
// 499 USARTx->CR1 |= CR1_RWU_Set;
ORRS R1,R1,#0x2
STRH R1,[R0, #+12]
BX LR
// 500 }
// 501 else
// 502 {
// 503 /* Disable the USART mute mode by clearing the RWU bit in the CR1 register */
// 504 USARTx->CR1 &= CR1_RWU_Reset;
??USART_ReceiverWakeUpCmd_0:
LDR.N R2,??DataTable5 ;; 0xfffd
CFI EndBlock cfiBlock10
REQUIRE ?Subroutine1
;; // Fall through to label ?Subroutine1
// 505 }
// 506 }
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock11 Using cfiCommon0
CFI NoFunction
THUMB
?Subroutine1:
ANDS R2,R2,R1
STRH R2,[R0, #+12]
BX LR ;; return
CFI EndBlock cfiBlock11
// 507
// 508 /*******************************************************************************
// 509 * Function Name : USART_LINBreakDetectLengthConfig
// 510 * Description : Sets the USART LIN Break detection length.
// 511 * Input : - USARTx: Select the USART or the UART peripheral.
// 512 * This parameter can be one of the following values:
// 513 * - USART1, USART2, USART3, UART4 or UART5.
// 514 * - USART_LINBreakDetectLength: specifies the LIN break
// 515 * detection length.
// 516 * This parameter can be one of the following values:
// 517 * - USART_LINBreakDetectLength_10b: 10-bit break detection
// 518 * - USART_LINBreakDetectLength_11b: 11-bit break detection
// 519 * Output : None
// 520 * Return : None
// 521 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock12 Using cfiCommon0
CFI Function USART_LINBreakDetectLengthConfig
THUMB
// 522 void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, u16 USART_LINBreakDetectLength)
// 523 {
// 524 /* Check the parameters */
// 525 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 526 assert_param(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength));
// 527
// 528 USARTx->CR2 &= CR2_LBDL_Mask;
USART_LINBreakDetectLengthConfig:
LDRH R2,[R0, #+16]
LDR.N R3,??DataTable4 ;; 0xffdf
CFI EndBlock cfiBlock12
REQUIRE ?Subroutine0
;; // Fall through to label ?Subroutine0
// 529 USARTx->CR2 |= USART_LINBreakDetectLength;
// 530 }
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock13 Using cfiCommon0
CFI NoFunction
THUMB
?Subroutine0:
ANDS R3,R3,R2
STRH R3,[R0, #+16]
LDRH R2,[R0, #+16]
??Subroutine0_0:
ORRS R1,R1,R2
STRH R1,[R0, #+16]
BX LR ;; return
CFI EndBlock cfiBlock13
// 531
// 532 /*******************************************************************************
// 533 * Function Name : USART_LINCmd
// 534 * Description : Enables or disables the USART抯 LIN mode.
// 535 * Input : - USARTx: Select the USART or the UART peripheral.
// 536 * This parameter can be one of the following values:
// 537 * - USART1, USART2, USART3, UART4 or UART5.
// 538 * - NewState: new state of the USART LIN mode.
// 539 * This parameter can be: ENABLE or DISABLE.
// 540 * Output : None
// 541 * Return : None
// 542 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock14 Using cfiCommon0
CFI Function USART_LINCmd
THUMB
// 543 void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState)
// 544 {
// 545 /* Check the parameters */
// 546 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 547 assert_param(IS_FUNCTIONAL_STATE(NewState));
// 548
// 549 if (NewState != DISABLE)
USART_LINCmd:
CMP R1,#+0
LDRH R1,[R0, #+16]
BEQ.N ??USART_LINCmd_0
// 550 {
// 551 /* Enable the LIN mode by setting the LINEN bit in the CR2 register */
// 552 USARTx->CR2 |= CR2_LINEN_Set;
ORRS R1,R1,#0x4000
STRH R1,[R0, #+16]
BX LR
// 553 }
// 554 else
// 555 {
// 556 /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */
// 557 USARTx->CR2 &= CR2_LINEN_Reset;
??USART_LINCmd_0:
LDR.N R2,??USART_LINCmd_1 ;; 0xbfff
ANDS R2,R2,R1
STRH R2,[R0, #+16]
// 558 }
// 559 }
BX LR ;; return
Nop
DATA
??USART_LINCmd_1:
DC32 0xbfff
CFI EndBlock cfiBlock14
// 560
// 561 /*******************************************************************************
// 562 * Function Name : USART_SendData
// 563 * Description : Transmits single data through the USARTx peripheral.
// 564 * Input : - USARTx: Select the USART or the UART peripheral.
// 565 * This parameter can be one of the following values:
// 566 * - USART1, USART2, USART3, UART4 or UART5.
// 567 * - Data: the data to transmit.
// 568 * Output : None
// 569 * Return : None
// 570 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock15 Using cfiCommon0
CFI Function USART_SendData
THUMB
// 571 void USART_SendData(USART_TypeDef* USARTx, u16 Data)
// 572 {
// 573 /* Check the parameters */
// 574 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 575 assert_param(IS_USART_DATA(Data));
// 576
// 577 /* Transmit Data */
// 578 USARTx->DR = (Data & (u16)0x01FF);
USART_SendData:
LSLS R1,R1,#+23
LSRS R1,R1,#+23
STRH R1,[R0, #+4]
// 579 }
BX LR ;; return
CFI EndBlock cfiBlock15
// 580
// 581 /*******************************************************************************
// 582 * Function Name : USART_ReceiveData
// 583 * Description : Returns the most recent received data by the USARTx peripheral.
// 584 * Input : - USARTx: Select the USART or the UART peripheral.
// 585 * This parameter can be one of the following values:
// 586 * - USART1, USART2, USART3, UART4 or UART5.
// 587 * Output : None
// 588 * Return : The received data.
// 589 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock16 Using cfiCommon0
CFI Function USART_ReceiveData
THUMB
// 590 u16 USART_ReceiveData(USART_TypeDef* USARTx)
// 591 {
// 592 /* Check the parameters */
// 593 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 594
// 595 /* Receive Data */
// 596 return (u16)(USARTx->DR & (u16)0x01FF);
USART_ReceiveData:
LDRH R0,[R0, #+4]
LSLS R0,R0,#+23
LSRS R0,R0,#+23
BX LR ;; return
CFI EndBlock cfiBlock16
// 597 }
// 598
// 599 /*******************************************************************************
// 600 * Function Name : USART_SendBreak
// 601 * Description : Transmits break characters.
// 602 * Input : - USARTx: Select the USART or the UART peripheral.
// 603 * This parameter can be one of the following values:
// 604 * - USART1, USART2, USART3, UART4 or UART5.
// 605 * Output : None
// 606 * Return : None
// 607 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock17 Using cfiCommon0
CFI Function USART_SendBreak
THUMB
// 608 void USART_SendBreak(USART_TypeDef* USARTx)
// 609 {
// 610 /* Check the parameters */
// 611 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 612
// 613 /* Send break characters */
// 614 USARTx->CR1 |= CR1_SBK_Set;
USART_SendBreak:
LDRH R1,[R0, #+12]
ORRS R1,R1,#0x1
STRH R1,[R0, #+12]
// 615 }
BX LR ;; return
CFI EndBlock cfiBlock17
// 616
// 617 /*******************************************************************************
// 618 * Function Name : USART_SetGuardTime
// 619 * Description : Sets the specified USART guard time.
// 620 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
// 621 * peripheral.
// 622 * Note: The guard time bits are not available for UART4 and UART5.
// 623 * - USART_GuardTime: specifies the guard time.
// 624 * Output : None
// 625 * Return : None
// 626 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock18 Using cfiCommon0
CFI Function USART_SetGuardTime
THUMB
// 627 void USART_SetGuardTime(USART_TypeDef* USARTx, u8 USART_GuardTime)
// 628 {
// 629 /* Check the parameters */
// 630 assert_param(IS_USART_123_PERIPH(USARTx));
// 631
// 632 /* Clear the USART Guard time */
// 633 USARTx->GTPR &= GTPR_LSB_Mask;
USART_SetGuardTime:
LDRH R2,[R0, #+24]
UXTB R2,R2
STRH R2,[R0, #+24]
// 634 /* Set the USART guard time */
// 635 USARTx->GTPR |= (u16)((u16)USART_GuardTime << 0x08);
LDRH R2,[R0, #+24]
ORRS R1,R2,R1, LSL #+8
STRH R1,[R0, #+24]
// 636 }
BX LR ;; return
CFI EndBlock cfiBlock18
// 637
// 638 /*******************************************************************************
// 639 * Function Name : USART_SetPrescaler
// 640 * Description : Sets the system clock prescaler.
// 641 * Input : - USARTx: Select the USART or the UART peripheral.
// 642 * This parameter can be one of the following values:
// 643 * - USART1, USART2, USART3, UART4 or UART5.
// 644 * Note: The function is used for IrDA mode with UART4 and UART5.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -