📄 stm32f10x_usart.lst
字号:
\ 0000000C 8181 STRH R1,[R0, #+12]
402 }
\ 0000000E 7047 BX LR ;; return
\ ??USART_WakeUpConfig_0:
\ 00000010 FFF70000 DC32 0xf7ff
403
404 /*******************************************************************************
405 * Function Name : USART_ReceiverWakeUpCmd
406 * Description : Determines if the USART is in mute mode or not.
407 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
408 * peripheral.
409 * - NewState: new state of the USART mode.
410 * This parameter can be: ENABLE or DISABLE.
411 * Output : None
412 * Return : None
413 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
414 void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState)
415 {
416 /* Check the parameters */
417 assert(IS_FUNCTIONAL_STATE(NewState));
418
419 if (NewState != DISABLE)
\ USART_ReceiverWakeUpCmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 8189 LDRH R1,[R0, #+12]
\ 00000004 03D0 BEQ.N ??USART_ReceiverWakeUpCmd_0
420 {
421 /* Enable the mute mode USART by setting the RWU bit in the CR1 register */
422 USARTx->CR1 |= CR1_RWU_Set;
\ 00000006 51F00201 ORRS R1,R1,#0x2
\ 0000000A 8181 STRH R1,[R0, #+12]
\ 0000000C 7047 BX LR
423 }
424 else
425 {
426 /* Disable the mute mode USART by clearing the RWU bit in the CR1 register */
427 USARTx->CR1 &= CR1_RWU_Reset;
\ ??USART_ReceiverWakeUpCmd_0:
\ 0000000E .... LDR.N R2,??DataTable5 ;; 0xfffd
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 8281 STRH R2,[R0, #+12]
428 }
429 }
\ 00000014 7047 BX LR ;; return
430
431 /*******************************************************************************
432 * Function Name : USART_LINBreakDetectLengthConfig
433 * Description : Sets the USART LIN Break detection length.
434 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
435 * peripheral.
436 * - USART_LINBreakDetectLength: specifies the LIN break
437 * detection length.
438 * This parameter can be one of the following values:
439 * - USART_LINBreakDetectLength_10b
440 * - USART_LINBreakDetectLength_11b
441 * Output : None
442 * Return : None
443 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
444 void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, u16 USART_LINBreakDetectLength)
445 {
446 /* Check the parameters */
447 assert(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength));
448
449 USARTx->CR2 &= CR3_LBDL_Mask;
\ USART_LINBreakDetectLengthConfig:
\ 00000000 028A LDRH R2,[R0, #+16]
\ 00000002 .... LDR.N R3,??DataTable4 ;; 0xffdf
\ 00000004 1340 ANDS R3,R3,R2
\ 00000006 0382 STRH R3,[R0, #+16]
450 USARTx->CR2 |= USART_LINBreakDetectLength;
\ 00000008 028A LDRH R2,[R0, #+16]
\ 0000000A 1143 ORRS R1,R1,R2
\ 0000000C 0182 STRH R1,[R0, #+16]
451 }
\ 0000000E 7047 BX LR ;; return
452
453 /*******************************************************************************
454 * Function Name : USART_LINCmd
455 * Description : Enables or disables the USART抯 LIN mode.
456 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
457 * peripheral.
458 * - NewState: new state of the USART LIN mode.
459 * This parameter can be: ENABLE or DISABLE.
460 * Output : None
461 * Return : None
462 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
463 void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState)
464 {
465 /* Check the parameters */
466 assert(IS_FUNCTIONAL_STATE(NewState));
467
468 if (NewState != DISABLE)
\ USART_LINCmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 018A LDRH R1,[R0, #+16]
\ 00000004 03D0 BEQ.N ??USART_LINCmd_0
469 {
470 /* Enable the LIN mode by setting the LINE bit in the CR2 register */
471 USARTx->CR2 |= CR2_LINE_Set;
\ 00000006 51F48041 ORRS R1,R1,#0x4000
\ 0000000A 0182 STRH R1,[R0, #+16]
\ 0000000C 7047 BX LR
472 }
473 else
474 {
475 /* Disable the LIN mode by clearing the LINE bit in the CR2 register */
476 USARTx->CR2 &= CR2_LINE_Reset;
\ ??USART_LINCmd_0:
\ 0000000E 024A LDR.N R2,??USART_LINCmd_1 ;; 0xbfff
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 0282 STRH R2,[R0, #+16]
477 }
478 }
\ 00000014 7047 BX LR ;; return
\ 00000016 00BF Nop
\ ??USART_LINCmd_1:
\ 00000018 FFBF0000 DC32 0xbfff
479
480 /*******************************************************************************
481 * Function Name : USART_SendData
482 * Description : Transmits signle data through the USARTx peripheral.
483 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
484 * peripheral.
485 * - Data: the data to transmit.
486 * Output : None
487 * Return : None
488 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
489 void USART_SendData(USART_TypeDef* USARTx, u16 Data)
490 {
491 /* Check the parameters */
492 assert(IS_USART_DATA(Data));
493
494 /* Transmit Data */
495 USARTx->DR = (Data & (u16)0x01FF);
\ USART_SendData:
\ 00000000 C905 LSLS R1,R1,#+23
\ 00000002 C90D LSRS R1,R1,#+23
\ 00000004 8180 STRH R1,[R0, #+4]
496 }
\ 00000006 7047 BX LR ;; return
497
498 /*******************************************************************************
499 * Function Name : USART_ReceiveData
500 * Description : Returns the most recent received data by the USARTx peripheral.
501 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
502 * peripheral.
503 * Output : None
504 * Return : The received data.
505 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
506 u16 USART_ReceiveData(USART_TypeDef* USARTx)
507 {
508 /* Receive Data */
509 return (u16)(USARTx->DR & (u16)0x01FF);
\ USART_ReceiveData:
\ 00000000 8088 LDRH R0,[R0, #+4]
\ 00000002 C005 LSLS R0,R0,#+23
\ 00000004 C00D LSRS R0,R0,#+23
\ 00000006 7047 BX LR ;; return
510 }
511
512 /*******************************************************************************
513 * Function Name : USART_SendBreak
514 * Description : Transmits break characters.
515 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
516 * peripheral.
517 * Output : None
518 * Return : None
519 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
520 void USART_SendBreak(USART_TypeDef* USARTx)
521 {
522 /* Send break characters */
523 USARTx->CR1 |= CR1_SBK_Set;
\ USART_SendBreak:
\ 00000000 8189 LDRH R1,[R0, #+12]
\ 00000002 51F00101 ORRS R1,R1,#0x1
\ 00000006 8181 STRH R1,[R0, #+12]
524 }
\ 00000008 7047 BX LR ;; return
525
526 /*******************************************************************************
527 * Function Name : USART_SetGuardTime
528 * Description : Sets the specified USART guard time.
529 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
530 * peripheral.
531 * - USART_GuardTime: specifies the guard time.
532 * Output : None
533 * Return : None
534 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
535 void USART_SetGuardTime(USART_TypeDef* USARTx, u8 USART_GuardTime)
536 {
537 /* Clear the USART Guard time */
538 USARTx->GTPR &= GTPR_LSB_Mask;
\ USART_SetGuardTime:
\ 00000000 028B LDRH R2,[R0, #+24]
\ 00000002 D2B2 UXTB R2,R2
\ 00000004 0283 STRH R2,[R0, #+24]
539 /* Set the USART guard time */
540 USARTx->GTPR |= (u16)((u16)USART_GuardTime << 0x08);
\ 00000006 028B LDRH R2,[R0, #+24]
\ 00000008 52EA0121 ORRS R1,R2,R1, LSL #+8
\ 0000000C 0183 STRH R1,[R0, #+24]
541 }
\ 0000000E 7047 BX LR ;; return
542
543 /*******************************************************************************
544 * Function Name : USART_SetPrescaler
545 * Description : Sets the system clock prescaler.
546 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
547 * peripheral.
548 * - USART_Prescaler: specifies the prescaler clock.
549 * Output : None
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -